From beb4069845e5706d6450fa183e27514298479784 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Wed, 29 Jan 2025 19:17:39 -0500 Subject: [PATCH] fix: Screen Missing Icons on server config Fixes#8155 --- src/apps/deskflow-gui/widgets/ScreenSetupView.cpp | 13 +++++++++++-- src/lib/gui/config/Screen.h | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/apps/deskflow-gui/widgets/ScreenSetupView.cpp b/src/apps/deskflow-gui/widgets/ScreenSetupView.cpp index 86c1ba4ea..01930728e 100644 --- a/src/apps/deskflow-gui/widgets/ScreenSetupView.cpp +++ b/src/apps/deskflow-gui/widgets/ScreenSetupView.cpp @@ -1,5 +1,6 @@ /* * Deskflow -- mouse and keyboard sharing utility + * SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello * SPDX-FileCopyrightText: (C) 2012 Symless Ltd. * SPDX-FileCopyrightText: (C) 2008 Volker Lanz * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception @@ -27,7 +28,7 @@ ScreenSetupView::ScreenSetupView(QWidget *parent) : QTableView(parent) setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setIconSize(QSize(64, 64)); + setIconSize(QSize(96, 96)); horizontalHeader()->hide(); verticalHeader()->hide(); } @@ -140,8 +141,16 @@ void ScreenSetupView::startDrag(Qt::DropActions) void ScreenSetupView::initViewItemOption(QStyleOptionViewItem *option) const { + // HACK make a basic widget and init from it + auto w = new QWidget(); + option->initFrom(w); + w->deleteLater(); + delete w; + + option->decorationSize = QSize(96, 96); option->showDecorationSelected = true; option->decorationPosition = QStyleOptionViewItem::Top; - option->displayAlignment = Qt::AlignCenter; + option->decorationAlignment = Qt::AlignHCenter | Qt::AlignVCenter; + option->displayAlignment = Qt::AlignTop | Qt::AlignHCenter; option->textElideMode = Qt::ElideMiddle; } diff --git a/src/lib/gui/config/Screen.h b/src/lib/gui/config/Screen.h index a25057f40..f7d1a77e2 100644 --- a/src/lib/gui/config/Screen.h +++ b/src/lib/gui/config/Screen.h @@ -1,5 +1,6 @@ /* * Deskflow -- mouse and keyboard sharing utility + * SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello * SPDX-FileCopyrightText: (C) 2012 Symless Ltd. * SPDX-FileCopyrightText: (C) 2008 Volker Lanz * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception @@ -164,7 +165,7 @@ protected: } private: - QPixmap m_Pixmap = QIcon::fromTheme("video-display").pixmap(QSize(64, 64)); + QPixmap m_Pixmap = QIcon::fromTheme("video-display").pixmap(QSize(96, 96)); QString m_Name; QStringList m_Aliases; QList m_Modifiers;