all repos — fluxbox @ 9f59ce18a21c8544d996235787ff1d7a6557153d

custom fork of the fluxbox windowmanager

change default toolbar tools to:
prevworkspace, workspacename, nextworkspace, iconbar, systemtray, clock
Mark Tiefenbruck mark@fluxbox.org
commit

9f59ce18a21c8544d996235787ff1d7a6557153d

parent

5f9f2475b72e977fa96214e368c34c588b265888

3 files changed, 8 insertions(+), 28 deletions(-)

jump to
M src/FbTk/StringUtil.ccsrc/FbTk/StringUtil.cc

@@ -63,7 +63,7 @@

/** Tries to find a string in another and ignoring the case of the characters - Returns 0 on success else pointer to str. + Returns 0 on failure else pointer to str. */ const char *strcasestr(const char *str, const char *ptn) { const char *s2, *p2;
M src/ToolFactory.ccsrc/ToolFactory.cc

@@ -101,36 +101,17 @@ } else if (name == "systemtray") {

item = new SystemTray(parent, dynamic_cast<ButtonTheme &>(*m_systray_theme), screen()); } else if (name == "clock") { item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu()); - } else if (name == "nextworkspace" || - name == "prevworkspace") { - - FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse(name)); - if (*cmd == 0) // we need a command - return 0; - - // TODO maybe direction of arrows should depend on toolbar layout ? - FbTk::FbDrawable::TriangleType arrow_type = FbTk::FbDrawable::LEFT; - if (name == "nextworkspace") - arrow_type = FbTk::FbDrawable::RIGHT; - - ArrowButton *win = new ArrowButton(arrow_type, parent, - 0, 0, - button_size, button_size); - win->setOnClick(cmd); - item = new ButtonTool(win, ToolbarItem::SQUARE, - dynamic_cast<ButtonTheme &>(*m_button_theme), - screen().imageControl()); - } else { - FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse(name)); if (*cmd == 0) // we need a command return 0; - FbTk::FbDrawable::TriangleType arrow_type = FbTk::FbDrawable::LEFT; - if (name == "nextwindow") - arrow_type = FbTk::FbDrawable::RIGHT; - + // TODO maybe direction of arrows should depend on toolbar layout ? + FbTk::FbDrawable::TriangleType arrow_type = FbTk::FbDrawable::RIGHT; + const char *tmp = name.c_str(); + if (FbTk::StringUtil::strcasestr(tmp, "prev")) + arrow_type = FbTk::FbDrawable::LEFT; + ArrowButton *win = new ArrowButton(arrow_type, parent, 0, 0, button_size, button_size);

@@ -138,7 +119,6 @@ win->setOnClick(cmd);

item = new ButtonTool(win, ToolbarItem::SQUARE, dynamic_cast<ButtonTheme &>(*m_button_theme), screen().imageControl()); - } if (item)
M src/Toolbar.ccsrc/Toolbar.cc

@@ -243,7 +243,7 @@ scrn.name() + ".toolbar.onhead", scrn.altName() + ".Toolbar.onHead"),

m_rc_placement(scrn.resourceManager(), Toolbar::BOTTOMCENTER, scrn.name() + ".toolbar.placement", scrn.altName() + ".Toolbar.Placement"), m_rc_height(scrn.resourceManager(), 0, scrn.name() + ".toolbar.height", scrn.altName() + ".Toolbar.Height"), - m_rc_tools(scrn.resourceManager(), "workspacename, prevworkspace, nextworkspace, iconbar, systemtray, prevwindow, nextwindow, clock", + m_rc_tools(scrn.resourceManager(), "prevworkspace, workspacename, nextworkspace, iconbar, systemtray, clock", scrn.name() + ".toolbar.tools", scrn.altName() + ".Toolbar.Tools"), m_shape(new FbTk::Shape(frame.window, 0)), m_resize_lock(false) {