From 5b324d3ceeb0da37dd040210065f9fc2cd67db60 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 18 Nov 2016 21:40:16 +0100 Subject: Revert "gui: resize dialog boxes to fit text" This reverts commit d26048617d78396cc6381eaf06f19fee484d811c. --- gui/main-window.cpp | 22 ++++++++-------------- gui/main.cpp | 1 + 2 files changed, 9 insertions(+), 14 deletions(-) (limited to 'gui') 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 #include #include -#include #ifdef _WIN32 # include @@ -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 lib, ptr& orig) { t* dialog = reinterpret_cast(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* place, Args&&... params) else { *place = make_unique(std::forward(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; } } diff --git a/gui/main.cpp b/gui/main.cpp index acf82808..8bc09537 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -17,6 +17,7 @@ using namespace options; #include #include #include +#include #include #include #include -- cgit v1.2.3