fix - stretch to fit shortcuts table on the configuration window
This commit is contained in:
@@ -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"));
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user