diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-11-18 21:40:16 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-11-18 21:40:16 +0100 |
commit | 5b324d3ceeb0da37dd040210065f9fc2cd67db60 (patch) | |
tree | 80d313f90da9010fe7709f2df1f1a2e46b0892b7 /gui/main-window.cpp | |
parent | ec6c5632446c04a643bc7a05e323fe4a16f0978b (diff) |
Revert "gui: resize dialog boxes to fit text"
This reverts commit d26048617d78396cc6381eaf06f19fee484d811c.
Diffstat (limited to 'gui/main-window.cpp')
-rw-r--r-- | gui/main-window.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/gui/main-window.cpp b/gui/main-window.cpp index 2489c983..d3e0baa8 100644 --- a/gui/main-window.cpp +++ b/gui/main-window.cpp @@ -21,7 +21,6 @@ #include <QString> #include <QChar> #include <QSignalBlocker> -#include <QStatusBar> #ifdef _WIN32 # include <windows.h> @@ -43,10 +42,7 @@ MainWindow::MainWindow() : menu_action_mappings(&tray_menu) { ui.setupUi(this); - setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - adjustSize(); setFixedSize(size()); - setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | windowFlags()); updateButtonState(false, false); if (group::ini_directory().size() == 0) @@ -579,10 +575,9 @@ bool mk_dialog(mem<dylib> lib, ptr<t>& orig) { t* dialog = reinterpret_cast<t*>(lib->Dialog()); dialog->setWindowFlags(Qt::Dialog); - dialog->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - dialog->adjustSize(); - dialog->setFixedSize(dialog->size()); - dialog->setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | dialog->windowFlags()); + // HACK: prevent stderr whining by adding a few pixels + dialog->setFixedSize(dialog->size() + QSize(4, 4)); + dialog->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); dialog->show(); orig.reset(dialog); @@ -625,12 +620,11 @@ static bool mk_window(ptr<t>* place, Args&&... params) else { *place = make_unique<t>(std::forward<Args>(params)...); - auto& dialog = *place; - dialog->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - dialog->adjustSize(); - dialog->setFixedSize(dialog->size()); - dialog->setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | dialog->windowFlags()); - dialog->show(); + (*place)->setWindowFlags(Qt::Dialog); + // HACK: prevent stderr whining by adding a few pixels + (*place)->setFixedSize((*place)->size() + QSize(4, 4)); + (*place)->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + (*place)->show(); return true; } } |