From e538db9009059a5ce03ef01cdc68695bf8533269 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 16 Apr 2003 12:53:14 +0000 Subject: toolbar width percent menu item --- src/Toolbar.cc | 30 +++++++++++++++++++++++++++--- 1 file 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.70 2003/04/15 12:15:44 fluxgen Exp $ +// $Id: Toolbar.cc,v 1.71 2003/04/16 12:53:14 fluxgen Exp $ #include "Toolbar.hh" @@ -37,6 +37,8 @@ #include "Text.hh" #include "ArrowButton.hh" #include "SimpleCommand.hh" +#include "IntResMenuItem.hh" +#include "MacroCommand.hh" // use GNU extensions #ifndef _GNU_SOURCE @@ -100,7 +102,29 @@ void setupMenus(Toolbar &tbar) { menu.setLabel(i18n->getMessage( FBNLS::ToolbarSet, FBNLS::ToolbarToolbarTitle, - "Toolbar")); + "Toolbar")); + + FbTk::MenuItem *toolbar_menuitem = new IntResMenuItem("Toolbar width percent", + tbar.screen().getToolbarWidthPercentResource(), + 0, 100); // min/max value + + FbTk::RefCount reconfig_toolbar(new FbTk:: + SimpleCommand + (tbar, &Toolbar::reconfigure)); + FbTk::RefCount save_resources(new FbTk:: + SimpleCommand + (*Fluxbox::instance(), &Fluxbox::save_rc)); + FbTk::MacroCommand *toolbar_menuitem_macro = new FbTk::MacroCommand(); + toolbar_menuitem_macro->add(reconfig_toolbar); + toolbar_menuitem_macro->add(save_resources); + + FbTk::RefCount reconfig_toolbar_and_save_resource(toolbar_menuitem_macro); + + toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource); + + tbar.menu().insert(toolbar_menuitem); + + menu.setInternalMenu(); menu.insert("Layer...", &tbar.layermenu()); @@ -122,7 +146,7 @@ void setupMenus(Toolbar &tbar) { {0, 0, 0, Toolbar::BOTTOMCENTER}, {0, 0, 0, Toolbar::BOTTOMCENTER}, {0, 0, "Bottom Center", Toolbar::BOTTOMCENTER}, - {0, 0, "Top Left", Toolbar::TOPLEFT}, + {0, 0, "Top Right", Toolbar::TOPRIGHT}, {0, 0, "Right Top", Toolbar::RIGHTTOP}, {0, 0, "Right Center", Toolbar::RIGHTCENTER}, {0, 0, "Right Bottom", Toolbar::RIGHTBOTTOM}, -- cgit v0.11.2