* [PATCH QGit 3/4] Avoid submenus with merely 1 entry
@ 2009-06-06 11:57 Markus Heidelberg
0 siblings, 0 replies; only message in thread
From: Markus Heidelberg @ 2009-06-06 11:57 UTC (permalink / raw)
To: Marco Costalba; +Cc: git, Markus Heidelberg
Display the branch/tag in the main context menu in these cases, where
only the last branch/tag would go into a submenu.
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
src/mainimpl.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/mainimpl.cpp b/src/mainimpl.cpp
index 24b4ef1..38bbfbe 100644
--- a/src/mainimpl.cpp
+++ b/src/mainimpl.cpp
@@ -1197,7 +1197,8 @@ void MainImpl::doContexPopup(SCRef sha) {
contextMenu.addSeparator();
FOREACH_SL (it, bn) {
- if (cntMenuEntries(contextMenu) < MAX_MENU_ENTRIES)
+ if (cntMenuEntries(contextMenu) < MAX_MENU_ENTRIES
+ || (*it == bn.last() && contextSubMenu.isEmpty() && tn.empty()))
act = contextMenu.addAction(*it);
else
act = contextSubMenu.addAction(*it);
@@ -1211,7 +1212,8 @@ void MainImpl::doContexPopup(SCRef sha) {
contextMenu.addSeparator();
FOREACH_SL (it, tn) {
- if (cntMenuEntries(contextMenu) < MAX_MENU_ENTRIES)
+ if (cntMenuEntries(contextMenu) < MAX_MENU_ENTRIES
+ || (*it == tn.last() && contextSubMenu.isEmpty()))
act = contextMenu.addAction(*it);
else
act = contextSubMenu.addAction(*it);
--
1.6.3.2.213.g30b07
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-06-06 11:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-06 11:57 [PATCH QGit 3/4] Avoid submenus with merely 1 entry Markus Heidelberg
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).