aboutsummaryrefslogtreecommitdiff
path: root/src/ToolFactory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ToolFactory.cc')
-rw-r--r--src/ToolFactory.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc
index d94105d..ee4666e 100644
--- a/src/ToolFactory.cc
+++ b/src/ToolFactory.cc
@@ -91,14 +91,19 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &
91 } else if (name == "clock") { 91 } else if (name == "clock") {
92 item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu()); 92 item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu());
93 } else { 93 } else {
94 FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse(name)); 94
95 std::string cmd_str = name;
96 if (name == "prevwindow" || name == "nextwindow") {
97 cmd_str += " (workspace=[current])";
98 }
99
100 FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse(cmd_str));
95 if (cmd == 0) // we need a command 101 if (cmd == 0) // we need a command
96 return 0; 102 return 0;
97 103
98 // TODO maybe direction of arrows should depend on toolbar layout ? 104 // TODO maybe direction of arrows should depend on toolbar layout ?
99 FbTk::FbDrawable::TriangleType arrow_type = FbTk::FbDrawable::RIGHT; 105 FbTk::FbDrawable::TriangleType arrow_type = FbTk::FbDrawable::RIGHT;
100 const char *tmp = name.c_str(); 106 if (name.find("prev") != std::string::npos)
101 if (FbTk::StringUtil::strcasestr(tmp, "prev"))
102 arrow_type = FbTk::FbDrawable::LEFT; 107 arrow_type = FbTk::FbDrawable::LEFT;
103 108
104 ArrowButton *win = new ArrowButton(arrow_type, parent, 109 ArrowButton *win = new ArrowButton(arrow_type, parent,