aboutsummaryrefslogtreecommitdiff
path: root/src/ToolFactory.cc
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-07-24 08:18:07 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2016-08-06 15:09:05 (GMT)
commitf6e1f555f91059a0462db7d60b3a0923fed25652 (patch)
treeac5748f5fbe74ba8a1191f0a43a74d1b3c091388 /src/ToolFactory.cc
parent50b6102bbf998fc1d8393d4d48bf9507c359a9b9 (diff)
downloadfluxbox-f6e1f555f91059a0462db7d60b3a0923fed25652.zip
fluxbox-f6e1f555f91059a0462db7d60b3a0923fed25652.tar.bz2
Add SpacerTool
This allows to add random spacers, fixed size or stretching, to the toolbar. CCBUG: 1141
Diffstat (limited to 'src/ToolFactory.cc')
-rw-r--r--src/ToolFactory.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc
index 60b283c..a033656 100644
--- a/src/ToolFactory.cc
+++ b/src/ToolFactory.cc
@@ -29,6 +29,7 @@
29#endif 29#endif
30#include "IconbarTool.hh" 30#include "IconbarTool.hh"
31#include "WorkspaceNameTool.hh" 31#include "WorkspaceNameTool.hh"
32#include "SpacerTool.hh"
32#include "ArrowButton.hh" 33#include "ArrowButton.hh"
33 34
34// Themes 35// Themes
@@ -98,6 +99,16 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &
98#endif 99#endif
99 } else if (name == "clock") { 100 } else if (name == "clock") {
100 item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu()); 101 item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu());
102 } else if (name.find("spacer") == 0) {
103 int size = -1;
104 if (name.size() > 6) { // spacer_20 creates a 20px spacer
105 if (name.at(6) != '_')
106 return 0;
107 size = atoi(name.substr(7, std::string::npos).c_str());
108 if (size < 1)
109 return 0;
110 }
111 item = new SpacerTool(size);
101 } else { 112 } else {
102 113
103 std::string cmd_str = name; 114 std::string cmd_str = name;