fix - stretch to fit shortcuts table on the configuration window

This commit is contained in:
Yuriy Puchkov
2020-12-08 12:32:03 +02:00
parent 7e09b818c7
commit d48d4299e2
3 changed files with 8 additions and 7 deletions

View File

@@ -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"));

View File

@@ -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);
}

View File

@@ -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;