summaryrefslogtreecommitdiffstats
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 9eff3d5..61c883e 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1692,6 +1692,13 @@ void MainWindow::buildSavedQueryRow(QWidget *parent, QVBoxLayout *layout)
box->addWidget(sentButton);
}
+ // Everything above is left-aligned; the stretch here pushes what follows
+ // to the right edge. The buttons are the row's content and read as a set,
+ // while the overflow menu is a control over that set, so it sits apart
+ // from them rather than trailing the last one.
+ const int contentCount = box->count();
+ box->addStretch(1);
+
// The overflow menu, and only when something is in it: an empty menu
// button is a control that always does nothing.
if (!unpinned.isEmpty()) {
@@ -1707,12 +1714,13 @@ void MainWindow::buildSavedQueryRow(QWidget *parent, QVBoxLayout *layout)
box->addWidget(menuButton);
}
- box->addStretch(1);
layout->addWidget(row);
- // Nothing saved and no sent folder leaves an empty strip of padding, so
- // the row goes away rather than sitting there as a gap.
- if (box->count() == 1)
+ // Nothing on either side of the stretch leaves an empty strip of padding,
+ // so the row goes away rather than sitting there as a gap. Counted before
+ // the stretch was added, since the stretch is always there: an unpinned
+ // query with no pinned ones still needs the row for its menu.
+ if (contentCount == 0 && unpinned.isEmpty())
row->hide();
}