diff options
Diffstat (limited to 'src/Slit.cc')
-rw-r--r-- | src/Slit.cc | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/Slit.cc b/src/Slit.cc index e8cd72c..af3a0be 100644 --- a/src/Slit.cc +++ b/src/Slit.cc | |||
@@ -260,9 +260,6 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) | |||
260 | m_slitmenu(scr.menuTheme(), | 260 | m_slitmenu(scr.menuTheme(), |
261 | scr.imageControl(), | 261 | scr.imageControl(), |
262 | *scr.layerManager().getLayer(Layer::MENU)), | 262 | *scr.layerManager().getLayer(Layer::MENU)), |
263 | m_placement_menu(scr.menuTheme(), | ||
264 | scr.imageControl(), | ||
265 | *scr.layerManager().getLayer(Layer::MENU)), | ||
266 | m_clientlist_menu(scr.menuTheme(), | 263 | m_clientlist_menu(scr.menuTheme(), |
267 | scr.imageControl(), | 264 | scr.imageControl(), |
268 | *scr.layerManager().getLayer(Layer::MENU)), | 265 | *scr.layerManager().getLayer(Layer::MENU)), |
@@ -274,6 +271,7 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) | |||
274 | "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False)), //KDE v2.x | 271 | "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False)), //KDE v2.x |
275 | 272 | ||
276 | m_layeritem(0), | 273 | m_layeritem(0), |
274 | |||
277 | m_slit_theme(new SlitTheme(scr.rootWindow().screenNumber())), | 275 | m_slit_theme(new SlitTheme(scr.rootWindow().screenNumber())), |
278 | m_strut(0), | 276 | m_strut(0), |
279 | // resources | 277 | // resources |
@@ -301,6 +299,8 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) | |||
301 | scr.resizeSig().attach(this); | 299 | scr.resizeSig().attach(this); |
302 | scr.reconfigureSig().attach(this); // if alpha changed (we disablethis signal when we get theme change sig) | 300 | scr.reconfigureSig().attach(this); // if alpha changed (we disablethis signal when we get theme change sig) |
303 | 301 | ||
302 | scr.addConfigMenu(_FBTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu); | ||
303 | |||
304 | frame.pixmap = None; | 304 | frame.pixmap = None; |
305 | // move the frame out of sight for a moment | 305 | // move the frame out of sight for a moment |
306 | frame.window.move(-frame.window.width(), -frame.window.height()); | 306 | frame.window.move(-frame.window.width(), -frame.window.height()); |
@@ -1236,10 +1236,17 @@ void Slit::setupMenu() { | |||
1236 | FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro); | 1236 | FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro); |
1237 | FbTk::RefCount<FbTk::Command> save_and_reconfigure_slit(s_a_reconf_slit_macro); | 1237 | FbTk::RefCount<FbTk::Command> save_and_reconfigure_slit(s_a_reconf_slit_macro); |
1238 | 1238 | ||
1239 | |||
1240 | // it'll be freed by the slitmenu (since not marked internal) | ||
1241 | FbMenu *placement_menu = new FbMenu(m_screen.menuTheme(), | ||
1242 | m_screen.imageControl(), | ||
1243 | *m_screen.layerManager().getLayer(::Layer::MENU)); | ||
1244 | |||
1245 | |||
1239 | // setup base menu | 1246 | // setup base menu |
1240 | m_slitmenu.setLabel(_FBTEXT(Slit, Slit, "Slit", "The Slit")); | 1247 | m_slitmenu.setLabel(_FBTEXT(Slit, Slit, "Slit", "The Slit")); |
1241 | m_slitmenu.insert(_FBTEXT(Menu, Placement, "Placement", "Title of Placement menu"), | 1248 | m_slitmenu.insert(_FBTEXT(Menu, Placement, "Placement", "Title of Placement menu"), |
1242 | &m_placement_menu); | 1249 | placement_menu); |
1243 | 1250 | ||
1244 | m_slitmenu.insert(_FBTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), m_layermenu.get()); | 1251 | m_slitmenu.insert(_FBTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), m_layermenu.get()); |
1245 | 1252 | ||
@@ -1287,10 +1294,11 @@ void Slit::setupMenu() { | |||
1287 | m_slitmenu.updateMenu(); | 1294 | m_slitmenu.updateMenu(); |
1288 | 1295 | ||
1289 | // setup sub menu | 1296 | // setup sub menu |
1290 | m_placement_menu.setLabel(_FBTEXT(Slit, Placement, "Slit Placement", "Slit Placement")); | 1297 | placement_menu->setLabel(_FBTEXT(Slit, Placement, "Slit Placement", "Slit Placement")); |
1291 | m_placement_menu.setMinimumSublevels(3); | 1298 | placement_menu->setMinimumSublevels(3); |
1292 | m_layermenu->setInternalMenu(); | 1299 | m_layermenu->setInternalMenu(); |
1293 | m_clientlist_menu.setInternalMenu(); | 1300 | m_clientlist_menu.setInternalMenu(); |
1301 | m_slitmenu.setInternalMenu(); | ||
1294 | 1302 | ||
1295 | typedef pair<const char *, Slit::Placement> PlacementP; | 1303 | typedef pair<const char *, Slit::Placement> PlacementP; |
1296 | typedef list<PlacementP> Placements; | 1304 | typedef list<PlacementP> Placements; |
@@ -1314,10 +1322,10 @@ void Slit::setupMenu() { | |||
1314 | Slit::Placement placement = place_menu.front().second; | 1322 | Slit::Placement placement = place_menu.front().second; |
1315 | 1323 | ||
1316 | if (str == 0) { | 1324 | if (str == 0) { |
1317 | m_placement_menu.insert(""); | 1325 | placement_menu->insert(""); |
1318 | m_placement_menu.setItemEnabled(i, false); | 1326 | placement_menu->setItemEnabled(i, false); |
1319 | } else { | 1327 | } else { |
1320 | m_placement_menu.insert(new PlaceSlitMenuItem(str, *this, | 1328 | placement_menu->insert(new PlaceSlitMenuItem(str, *this, |
1321 | placement, | 1329 | placement, |
1322 | save_and_reconfigure)); | 1330 | save_and_reconfigure)); |
1323 | 1331 | ||
@@ -1326,7 +1334,7 @@ void Slit::setupMenu() { | |||
1326 | } | 1334 | } |
1327 | 1335 | ||
1328 | // finaly update sub menu | 1336 | // finaly update sub menu |
1329 | m_placement_menu.updateMenu(); | 1337 | placement_menu->updateMenu(); |
1330 | } | 1338 | } |
1331 | 1339 | ||
1332 | void Slit::moveToLayer(int layernum) { | 1340 | void Slit::moveToLayer(int layernum) { |