aboutsummaryrefslogtreecommitdiff
path: root/src/gui/main-window.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/main-window.C')
-rw-r--r--src/gui/main-window.C15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/main-window.C b/src/gui/main-window.C
index 21571532..9cb219bf 100644
--- a/src/gui/main-window.C
+++ b/src/gui/main-window.C
@@ -37,9 +37,22 @@
namespace OpenAxiom {
+ // Attempt to resize the main window so that on the first exposure
+ // the exchanges in this debate have the preferred geometry and the
+ // horizontal scroll bar is not needed.
static void
try_to_honor_widget_size(MainWindow* w, Debate* debate) {
- w->resize(debate->size());
+ // Force a show first, to provoke conversation size.
+ // That helps getting the sizes right. On the other hand, it
+ // makes for several resize event roundring leading to
+ // an awkward looking brief window showing. FIXME.
+ w->show();
+ QSize diff = debate->exchanges()->size() - debate->viewport()->size();
+ if (diff.width() < 0)
+ diff.setWidth(0);
+ if (diff.height() < 0)
+ diff.setHeight(0);
+ w->resize(w->size() + diff);
}
MainWindow::MainWindow() : tabs(this) {