diff options
author | Mathias Gumz <akira@fluxbox.org> | 2015-01-15 13:24:46 (GMT) |
---|---|---|
committer | Mathias Gumz <akira@fluxbox.org> | 2015-01-15 13:25:05 (GMT) |
commit | 8387742c8860694777f7c2c62da0a90c9e836988 (patch) | |
tree | e5bd5a50c3e033ea73a9339474750287d06aeb3f /src/SendToMenu.cc | |
parent | b4cd45549013e8b45f95bf3e123cd14684948e91 (diff) | |
download | fluxbox-8387742c8860694777f7c2c62da0a90c9e836988.zip fluxbox-8387742c8860694777f7c2c62da0a90c9e836988.tar.bz2 |
Refactor menu code: be more explicit and compact
This commit is a preparation step for some menu cleanup ahead. To make it
easier to understand which types of MenuItems are added where and when, I
converted the overloaded FbTk::Menu::insert() functions into explicit ones
(Menu::insertSubmenu(), Menu::insertItem(), etc. ). This makes it possible
to just grep for 'insertSubmenu()'.
Side effect this commit: it trims down the very verbose creation of menu items
in regards to how the labels are created.
Minor: FbTk::Menu::shown and FbTk::Menu::s_focused are moved out of the class.
Diffstat (limited to 'src/SendToMenu.cc')
-rw-r--r-- | src/SendToMenu.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SendToMenu.cc b/src/SendToMenu.cc index afdc854..120a939 100644 --- a/src/SendToMenu.cc +++ b/src/SendToMenu.cc | |||
@@ -84,12 +84,12 @@ void SendToMenu::rebuildMenu() { | |||
84 | for (size_t i = 0; i < wlist.size(); ++i) { | 84 | for (size_t i = 0; i < wlist.size(); ++i) { |
85 | FbTk::RefCount<FbTk::Command<void> > sendto_cmd(new SendToCmd(i, false)); | 85 | FbTk::RefCount<FbTk::Command<void> > sendto_cmd(new SendToCmd(i, false)); |
86 | FbTk::RefCount<FbTk::Command<void> > sendto_follow_cmd(new SendToCmd(i, true)); | 86 | FbTk::RefCount<FbTk::Command<void> > sendto_follow_cmd(new SendToCmd(i, true)); |
87 | 87 | ||
88 | FbTk::MultiButtonMenuItem* item = new FbTk::MultiButtonMenuItem(3, wlist[i]->name()); | 88 | FbTk::MultiButtonMenuItem* item = new FbTk::MultiButtonMenuItem(3, wlist[i]->name()); |
89 | item->setCommand(1, sendto_cmd); | 89 | item->setCommand(1, sendto_cmd); |
90 | item->setCommand(2, sendto_follow_cmd); | 90 | item->setCommand(2, sendto_follow_cmd); |
91 | item->setCommand(3, sendto_cmd); | 91 | item->setCommand(3, sendto_cmd); |
92 | insert(item); | 92 | insertItem(item); |
93 | } | 93 | } |
94 | 94 | ||
95 | updateMenu(); | 95 | updateMenu(); |