aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2006-02-20 21:04:35 (GMT)
committerfluxgen <fluxgen>2006-02-20 21:04:35 (GMT)
commit369b4e1b92491aa57b0bf430b89bf732b80fa6a4 (patch)
tree2bf00a93ad1c195ef7d446e8989069f218a2cd47 /src/Toolbar.cc
parent2566d84561ce9f5ecaf1adcce97eb578747034e3 (diff)
downloadfluxbox-369b4e1b92491aa57b0bf430b89bf732b80fa6a4.zip
fluxbox-369b4e1b92491aa57b0bf430b89bf732b80fa6a4.tar.bz2
moved class Layer from class Fluxbox and thus reduces some dependecies
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 5f046d6..a735188 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -33,13 +33,13 @@
33#include "ToolbarTheme.hh" 33#include "ToolbarTheme.hh"
34 34
35#include "FbTk/I18n.hh" 35#include "FbTk/I18n.hh"
36#include "fluxbox.hh"
37#include "Screen.hh" 36#include "Screen.hh"
38#include "IntResMenuItem.hh" 37#include "IntResMenuItem.hh"
39#include "BoolMenuItem.hh" 38#include "BoolMenuItem.hh"
40#include "Xinerama.hh" 39#include "Xinerama.hh"
41#include "Strut.hh" 40#include "Strut.hh"
42#include "CommandParser.hh" 41#include "CommandParser.hh"
42#include "Layer.hh"
43 43
44#include "FbTk/ImageControl.hh" 44#include "FbTk/ImageControl.hh"
45#include "FbTk/MacroCommand.hh" 45#include "FbTk/MacroCommand.hh"
@@ -198,15 +198,15 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
198 m_layeritem(frame.window, layer), 198 m_layeritem(frame.window, layer),
199 m_layermenu(scrn.menuTheme(), 199 m_layermenu(scrn.menuTheme(),
200 scrn.imageControl(), 200 scrn.imageControl(),
201 *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), 201 *scrn.layerManager().getLayer(Layer::MENU),
202 this, 202 this,
203 true), 203 true),
204 m_placementmenu(scrn.menuTheme(), 204 m_placementmenu(scrn.menuTheme(),
205 scrn.imageControl(), 205 scrn.imageControl(),
206 *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), 206 *scrn.layerManager().getLayer(Layer::MENU)),
207 m_toolbarmenu(scrn.menuTheme(), 207 m_toolbarmenu(scrn.menuTheme(),
208 scrn.imageControl(), 208 scrn.imageControl(),
209 *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), 209 *scrn.layerManager().getLayer(Layer::MENU)),
210 m_theme(scrn.screenNumber()), 210 m_theme(scrn.screenNumber()),
211 m_tool_factory(scrn), 211 m_tool_factory(scrn),
212 m_strut(0), 212 m_strut(0),
@@ -220,7 +220,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
220 scrn.name() + ".toolbar.widthPercent", scrn.altName() + ".Toolbar.WidthPercent"), 220 scrn.name() + ".toolbar.widthPercent", scrn.altName() + ".Toolbar.WidthPercent"),
221 m_rc_alpha(scrn.resourceManager(), 255, 221 m_rc_alpha(scrn.resourceManager(), 255,
222 scrn.name() + ".toolbar.alpha", scrn.altName() + ".Toolbar.Alpha"), 222 scrn.name() + ".toolbar.alpha", scrn.altName() + ".Toolbar.Alpha"),
223 m_rc_layernum(scrn.resourceManager(), Fluxbox::Layer(Fluxbox::instance()->getDesktopLayer()), 223 m_rc_layernum(scrn.resourceManager(), Layer(Layer::DESKTOP),
224 scrn.name() + ".toolbar.layer", scrn.altName() + ".Toolbar.Layer"), 224 scrn.name() + ".toolbar.layer", scrn.altName() + ".Toolbar.Layer"),
225 m_rc_on_head(scrn.resourceManager(), 0, 225 m_rc_on_head(scrn.resourceManager(), 0,
226 scrn.name() + ".toolbar.onhead", scrn.altName() + ".Toolbar.onHead"), 226 scrn.name() + ".toolbar.onhead", scrn.altName() + ".Toolbar.onHead"),
@@ -799,7 +799,8 @@ void Toolbar::setupMenus() {
799 visible_macro->add(reconfig_toolbar); 799 visible_macro->add(reconfig_toolbar);
800 visible_macro->add(save_resources); 800 visible_macro->add(save_resources);
801 RefCommand toggle_visible_cmd(visible_macro); 801 RefCommand toggle_visible_cmd(visible_macro);
802 menu().insert(new BoolMenuItem(_FBTEXT(Common, Visible, "Visible", "Whether this item is visible"), 802 menu().insert(new BoolMenuItem(_FBTEXT(Common, Visible,
803 "Visible", "Whether this item is visible"),
803 *m_rc_visible, toggle_visible_cmd)); 804 *m_rc_visible, toggle_visible_cmd));
804 805
805 menu().insert(new BoolMenuItem(_FBTEXT(Common, AutoHide, 806 menu().insert(new BoolMenuItem(_FBTEXT(Common, AutoHide,
@@ -807,27 +808,33 @@ void Toolbar::setupMenus() {
807 *m_rc_auto_hide, 808 *m_rc_auto_hide,
808 reconfig_toolbar_and_save_resource)); 809 reconfig_toolbar_and_save_resource));
809 810
810 MenuItem *toolbar_menuitem = new IntResMenuItem(_FBTEXT(Toolbar, WidthPercent, "Toolbar width percent", "Percentage of screen width taken by toolbar"), 811 MenuItem *toolbar_menuitem =
811 m_rc_width_percent, 812 new IntResMenuItem(_FBTEXT(Toolbar, WidthPercent,
812 0, 100, menu()); // min/max value 813 "Toolbar width percent",
814 "Percentage of screen width taken by toolbar"),
815 m_rc_width_percent,
816 0, 100, menu()); // min/max value
813 817
814 818
815 toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource); 819 toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource);
816 menu().insert(toolbar_menuitem); 820 menu().insert(toolbar_menuitem);
817 821
818 menu().insert(new BoolMenuItem(_FBTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"), 822 menu().insert(new BoolMenuItem(_FBTEXT(Common, MaximizeOver,
823 "Maximize Over",
824 "Maximize over this thing when maximizing"),
819 *m_rc_maximize_over, 825 *m_rc_maximize_over,
820 reconfig_toolbar_and_save_resource)); 826 reconfig_toolbar_and_save_resource));
821 menu().insert(_FBTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), &layerMenu()); 827 menu().insert(_FBTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), &layerMenu());
822 828
823 if (screen().hasXinerama()) { 829 if (screen().hasXinerama()) {
824 menu().insert(_FBTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"), 830 menu().insert(_FBTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"),
825 new XineramaHeadMenu<Toolbar>(screen().menuTheme(), 831 new XineramaHeadMenu<Toolbar>(screen().menuTheme(),
826 screen(), 832 screen(),
827 screen().imageControl(), 833 screen().imageControl(),
828 *screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), 834 *screen().layerManager().getLayer(::Layer::MENU),
829 *this, 835 *this,
830 _FBTEXT(Toolbar, OnHead, "Toolbar on Head", "Title of toolbar on head menu"))); 836 _FBTEXT(Toolbar, OnHead, "Toolbar on Head",
837 "Title of toolbar on head menu")));
831 } 838 }
832 839
833 typedef pair<const char*, Toolbar::Placement> PlacementP; 840 typedef pair<const char*, Toolbar::Placement> PlacementP;