diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/windows/mailwindow.cpp | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp index da5192aee..ddc91603f 100644 --- a/src/gui/windows/mailwindow.cpp +++ b/src/gui/windows/mailwindow.cpp @@ -92,25 +92,39 @@ MailWindow::MailWindow() : if (setupWindow != nullptr) setupWindow->registerWindowForReset(this); - setDefaultSize(310, 180, ImagePosition::CENTER, 0, 0); - setMinWidth(310); - setMinHeight(250); center(); + // use line wrapping of mail subjects, instead. mListScrollArea->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); - - ContainerPlacer placer(nullptr, nullptr); - placer = getPlacer(0, 0); - - placer(0, 0, mListScrollArea, 4, 5).setPadding(3); - placer(4, 0, mRefreshButton, 1, 1); - placer(4, 1, mOpenButton, 1, 1); - placer(4, 2, mNewButton, 1, 1); - placer(4, 3, mDeleteButton, 1, 1); - placer(4, 4, mReturnButton, 1, 1); + // set reasonable minimum width for calculations below + mListScrollArea->setWidth(200); + + // at 0,0 and spawns/spans 4 columns and 6 rows + place(0, 0, mListScrollArea, 1, 6).setPadding(3); + // at column 5 and row 0... + place(1, 0, mRefreshButton, 1, 1); + place(1, 1, mOpenButton, 1, 1); + place(1, 2, mNewButton, 1, 1); + // Leave intentional gap in grid so that the button column (and thus, + // the whole window) can be resized without resizing any of the buttons. + // note: the empty cell still seems to enforce some padding, but this + // is fine. + place(1, 4, mDeleteButton, 1, 1); + place(1, 5, mReturnButton, 1, 1); Layout &layout = getLayout(); - layout.setRowHeight(0, LayoutType::SET); + // scrollarea column and 4th row eat all remaining available screen space. + layout.setColWidth(0, LayoutType::SET); + layout.setRowHeight(3, LayoutType::SET); + + // Enforce a minimum size. + int width = 0; + int height = 0; + layout.reflow(width, height); + setContentSize(width, height); + setMinWidth(getWidth()); + setMinHeight(getHeight()); + setDefaultSize(getWidth(), getHeight(), ImagePosition::CENTER, 0, 0); loadWindowState(); enableVisibleSound(true); |