diff options
author | fluxgen <fluxgen> | 2003-04-16 12:53:14 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-04-16 12:53:14 (GMT) |
commit | e538db9009059a5ce03ef01cdc68695bf8533269 (patch) | |
tree | 44ef5989be8616503005bed21fb5668eb7d6c6c2 /src | |
parent | 0e251388f024f24ce57255f55215de5275fe6e95 (diff) | |
download | fluxbox_lack-e538db9009059a5ce03ef01cdc68695bf8533269.zip fluxbox_lack-e538db9009059a5ce03ef01cdc68695bf8533269.tar.bz2 |
toolbar width percent menu item
Diffstat (limited to 'src')
-rw-r--r-- | src/Toolbar.cc | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 8f9d2d5..3efcabd 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Toolbar.cc,v 1.70 2003/04/15 12:15:44 fluxgen Exp $ | 25 | // $Id: Toolbar.cc,v 1.71 2003/04/16 12:53:14 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Toolbar.hh" | 27 | #include "Toolbar.hh" |
28 | 28 | ||
@@ -37,6 +37,8 @@ | |||
37 | #include "Text.hh" | 37 | #include "Text.hh" |
38 | #include "ArrowButton.hh" | 38 | #include "ArrowButton.hh" |
39 | #include "SimpleCommand.hh" | 39 | #include "SimpleCommand.hh" |
40 | #include "IntResMenuItem.hh" | ||
41 | #include "MacroCommand.hh" | ||
40 | 42 | ||
41 | // use GNU extensions | 43 | // use GNU extensions |
42 | #ifndef _GNU_SOURCE | 44 | #ifndef _GNU_SOURCE |
@@ -100,7 +102,29 @@ void setupMenus(Toolbar &tbar) { | |||
100 | 102 | ||
101 | menu.setLabel(i18n->getMessage( | 103 | menu.setLabel(i18n->getMessage( |
102 | FBNLS::ToolbarSet, FBNLS::ToolbarToolbarTitle, | 104 | FBNLS::ToolbarSet, FBNLS::ToolbarToolbarTitle, |
103 | "Toolbar")); | 105 | "Toolbar")); |
106 | |||
107 | FbTk::MenuItem *toolbar_menuitem = new IntResMenuItem("Toolbar width percent", | ||
108 | tbar.screen().getToolbarWidthPercentResource(), | ||
109 | 0, 100); // min/max value | ||
110 | |||
111 | FbTk::RefCount<FbTk::Command> reconfig_toolbar(new FbTk:: | ||
112 | SimpleCommand<Toolbar> | ||
113 | (tbar, &Toolbar::reconfigure)); | ||
114 | FbTk::RefCount<FbTk::Command> save_resources(new FbTk:: | ||
115 | SimpleCommand<Fluxbox> | ||
116 | (*Fluxbox::instance(), &Fluxbox::save_rc)); | ||
117 | FbTk::MacroCommand *toolbar_menuitem_macro = new FbTk::MacroCommand(); | ||
118 | toolbar_menuitem_macro->add(reconfig_toolbar); | ||
119 | toolbar_menuitem_macro->add(save_resources); | ||
120 | |||
121 | FbTk::RefCount<FbTk::Command> reconfig_toolbar_and_save_resource(toolbar_menuitem_macro); | ||
122 | |||
123 | toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource); | ||
124 | |||
125 | tbar.menu().insert(toolbar_menuitem); | ||
126 | |||
127 | |||
104 | menu.setInternalMenu(); | 128 | menu.setInternalMenu(); |
105 | 129 | ||
106 | menu.insert("Layer...", &tbar.layermenu()); | 130 | menu.insert("Layer...", &tbar.layermenu()); |
@@ -122,7 +146,7 @@ void setupMenus(Toolbar &tbar) { | |||
122 | {0, 0, 0, Toolbar::BOTTOMCENTER}, | 146 | {0, 0, 0, Toolbar::BOTTOMCENTER}, |
123 | {0, 0, 0, Toolbar::BOTTOMCENTER}, | 147 | {0, 0, 0, Toolbar::BOTTOMCENTER}, |
124 | {0, 0, "Bottom Center", Toolbar::BOTTOMCENTER}, | 148 | {0, 0, "Bottom Center", Toolbar::BOTTOMCENTER}, |
125 | {0, 0, "Top Left", Toolbar::TOPLEFT}, | 149 | {0, 0, "Top Right", Toolbar::TOPRIGHT}, |
126 | {0, 0, "Right Top", Toolbar::RIGHTTOP}, | 150 | {0, 0, "Right Top", Toolbar::RIGHTTOP}, |
127 | {0, 0, "Right Center", Toolbar::RIGHTCENTER}, | 151 | {0, 0, "Right Center", Toolbar::RIGHTCENTER}, |
128 | {0, 0, "Right Bottom", Toolbar::RIGHTBOTTOM}, | 152 | {0, 0, "Right Bottom", Toolbar::RIGHTBOTTOM}, |