From e1d6f6380dc4f7719f369b48e327085b0e0f511b Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Mon, 9 Dec 2019 11:40:54 -0500 Subject: use paintEvent() to allow interactive resize because showEvent() is too early bumped to rc2 --- src/mainwindow.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f58473e9..eaecfca1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -207,6 +207,7 @@ MainWindow::MainWindow(Settings &settings : QMainWindow(parent) , ui(new Ui::MainWindow) , m_WasVisible(false) + , m_FirstPaint(true) , m_linksSeparator(nullptr) , m_Tutorial(this, "MainWindow") , m_OldProfileIndex(-1) @@ -687,15 +688,12 @@ void MainWindow::allowListResize() for (int i = 0; i < ui->modList->header()->count(); ++i) { ui->modList->header()->setSectionResizeMode(i, QHeaderView::Interactive); } - //ui->modList->header()->setSectionResizeMode(ui->modList->header()->count() - 1, QHeaderView::Stretch); ui->modList->header()->setStretchLastSection(true); - // allow resize on plugin list for (int i = 0; i < ui->espList->header()->count(); ++i) { ui->espList->header()->setSectionResizeMode(i, QHeaderView::Interactive); } - //ui->espList->header()->setSectionResizeMode(ui->espList->header()->count() - 1, QHeaderView::Stretch); ui->espList->header()->setStretchLastSection(true); } @@ -1286,14 +1284,22 @@ void MainWindow::showEvent(QShowEvent *event) m_OrganizerCore.settings().widgets().restoreIndex(ui->groupCombo); - allowListResize(); - m_OrganizerCore.settings().nexus().registerAsNXMHandler(false); m_WasVisible = true; updateProblemsButton(); } } +void MainWindow::paintEvent(QPaintEvent* event) +{ + if (m_FirstPaint) { + allowListResize(); + m_FirstPaint = false; + } + + QMainWindow::paintEvent(event); +} + void MainWindow::onBeforeClose() { storeSettings(); -- cgit v1.3.1