aboutsummaryrefslogtreecommitdiff
path: root/src/Xinerama.hh
diff options
context:
space:
mode:
authorMathias Gumz <akira@fluxbox.org>2015-01-15 13:24:46 (GMT)
committerMathias Gumz <akira@fluxbox.org>2015-01-15 13:25:05 (GMT)
commit8387742c8860694777f7c2c62da0a90c9e836988 (patch)
treee5bd5a50c3e033ea73a9339474750287d06aeb3f /src/Xinerama.hh
parentb4cd45549013e8b45f95bf3e123cd14684948e91 (diff)
downloadfluxbox-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/Xinerama.hh')
-rw-r--r--src/Xinerama.hh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Xinerama.hh b/src/Xinerama.hh
index b0ff70e..5d305ed 100644
--- a/src/Xinerama.hh
+++ b/src/Xinerama.hh
@@ -51,7 +51,7 @@ public:
51 m_object.saveOnHead(m_headnum); 51 m_object.saveOnHead(m_headnum);
52 FbTk::RadioMenuItem::click(button, time, mods); 52 FbTk::RadioMenuItem::click(button, time, mods);
53 } 53 }
54 54
55private: 55private:
56 ItemType &m_object; 56 ItemType &m_object;
57 int m_headnum; 57 int m_headnum;
@@ -103,11 +103,11 @@ void XineramaHeadMenu<ItemType>::reloadHeads()
103*/ 103*/
104 std::string tname("Head "); 104 std::string tname("Head ");
105 tname += FbTk::StringUtil::number2String(i); 105 tname += FbTk::StringUtil::number2String(i);
106 insert(new XineramaHeadMenuItem<ItemType>( 106 insertItem(new XineramaHeadMenuItem<ItemType>(
107 tname.c_str(), m_object, i, saverc_cmd)); 107 tname.c_str(), m_object, i, saverc_cmd));
108 } 108 }
109 // TODO: nls 109 // TODO: nls
110 insert(new XineramaHeadMenuItem<ItemType>( 110 insertItem(new XineramaHeadMenuItem<ItemType>(
111 "All Heads", m_object, 0, saverc_cmd)); 111 "All Heads", m_object, 0, saverc_cmd));
112 updateMenu(); 112 updateMenu();
113} 113}