From d48d4299e27632e52a78943dd746ee2759e2fe79 Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Tue, 8 Dec 2020 12:32:03 +0200 Subject: [PATCH] fix - stretch to fit shortcuts table on the configuration window --- src/config/configwindow.cpp | 4 ++-- src/config/shortcutswidget.cpp | 8 +++----- src/config/shortcutswidget.h | 3 +++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/config/configwindow.cpp b/src/config/configwindow.cpp index e7d5be6a..48e5a270 100644 --- a/src/config/configwindow.cpp +++ b/src/config/configwindow.cpp @@ -37,8 +37,8 @@ ConfigWindow::ConfigWindow(QWidget* parent) : QTabWidget(parent) { setAttribute(Qt::WA_DeleteOnClose); - const int size = GlobalValues::buttonBaseSize() * 12; - setMinimumSize(size, size); + setMinimumSize(GlobalValues::buttonBaseSize() * 15, + GlobalValues::buttonBaseSize() * 12); setWindowIcon(QIcon(":img/app/flameshot.svg")); setWindowTitle(tr("Configuration")); diff --git a/src/config/shortcutswidget.cpp b/src/config/shortcutswidget.cpp index 75386cab..24c27c1d 100644 --- a/src/config/shortcutswidget.cpp +++ b/src/config/shortcutswidget.cpp @@ -48,7 +48,7 @@ ShortcutsWidget::ShortcutsWidget(QWidget* parent) #endif m_layout = new QVBoxLayout(this); - m_layout->setAlignment(Qt::AlignHCenter); + m_layout->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); m_shortcuts = m_config.shortcuts(); initInfoTable(); @@ -116,10 +116,8 @@ void ShortcutsWidget::initInfoTable() // adjust size m_table->resizeColumnsToContents(); m_table->resizeRowsToContents(); - m_table->setMinimumWidth(400); - m_table->setMaximumWidth(600); - - m_table->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch); + m_table->horizontalHeader()->setMinimumSectionSize(200); + m_table->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); m_table->horizontalHeader()->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); } diff --git a/src/config/shortcutswidget.h b/src/config/shortcutswidget.h index 8845c45b..3d01657a 100644 --- a/src/config/shortcutswidget.h +++ b/src/config/shortcutswidget.h @@ -45,7 +45,10 @@ private slots: void slotShortcutCellClicked(int, int); private: +#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \ + defined(Q_OS_MACX)) QString m_res; +#endif ConfigHandler m_config; QTableWidget* m_table; QVBoxLayout* m_layout;