aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-02-18 15:11:12 (GMT)
committerrathnor <rathnor>2003-02-18 15:11:12 (GMT)
commitb4ffe4fe21699c7123728aeeb99576a540b3694e (patch)
treef8a133be750f844f3c48f5a631fb8bf088544549 /src/Toolbar.cc
parentaa602770fbbd4e84154028d3181d275b81ea914d (diff)
downloadfluxbox_pavel-b4ffe4fe21699c7123728aeeb99576a540b3694e.zip
fluxbox_pavel-b4ffe4fe21699c7123728aeeb99576a540b3694e.tar.bz2
Added layer menus for windows, toolbar, and slit, plus associated
resources. Cleaned up some cruft from the previous layering setup.
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 15613ba..101900a 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.58 2003/02/17 12:32:21 fluxgen Exp $ 25// $Id: Toolbar.cc,v 1.59 2003/02/18 15:11:09 rathnor Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -92,6 +92,8 @@ void setupMenus(Toolbar &tbar) {
92 "Toolbar")); 92 "Toolbar"));
93 menu.setInternalMenu(); 93 menu.setInternalMenu();
94 94
95 menu.insert("Layer...", tbar.layermenu());
96
95 using namespace FbTk; 97 using namespace FbTk;
96 RefCount<Command> start_edit(new SimpleCommand<Toolbar>(tbar, &Toolbar::edit)); 98 RefCount<Command> start_edit(new SimpleCommand<Toolbar>(tbar, &Toolbar::edit));
97 menu.insert(i18n->getMessage( 99 menu.insert(i18n->getMessage(
@@ -166,8 +168,7 @@ Toolbar::Frame::~Frame() {
166 evm.remove(clock); 168 evm.remove(clock);
167} 169}
168 170
169Toolbar::Toolbar(BScreen &scrn, size_t width): 171Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
170 on_top(scrn.isToolbarOnTop()),
171 editing(false), 172 editing(false),
172 hidden(scrn.doToolbarAutoHide()), 173 hidden(scrn.doToolbarAutoHide()),
173 do_auto_hide(scrn.doToolbarAutoHide()), 174 do_auto_hide(scrn.doToolbarAutoHide()),
@@ -177,10 +178,20 @@ Toolbar::Toolbar(BScreen &scrn, size_t width):
177 clock_timer(this), // get the clock updating every minute 178 clock_timer(this), // get the clock updating every minute
178 hide_timer(&hide_handler), 179 hide_timer(&hide_handler),
179 m_toolbarmenu(*scrn.menuTheme(), scrn.getScreenNumber(), *scrn.getImageControl()), 180 m_toolbarmenu(*scrn.menuTheme(), scrn.getScreenNumber(), *scrn.getImageControl()),
181 m_layermenu(0),
180 m_theme(scrn.getScreenNumber()), 182 m_theme(scrn.getScreenNumber()),
181 m_place(BOTTOMCENTER), 183 m_place(BOTTOMCENTER),
182 m_themelistener(*this) { 184 m_themelistener(*this),
185 m_layeritem(0)
186{
183 187
188 m_layermenu = new LayerMenu<Toolbar>(
189 *scrn.menuTheme(),
190 scrn.getScreenNumber(),
191 *scrn.getImageControl(),
192 *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
193 this);
194
184 // we need to get notified when the theme is reloaded 195 // we need to get notified when the theme is reloaded
185 m_theme.addListener(m_themelistener); 196 m_theme.addListener(m_themelistener);
186 197
@@ -194,6 +205,8 @@ Toolbar::Toolbar(BScreen &scrn, size_t width):
194 frame.button_w = 20; 205 frame.button_w = 20;
195 frame.bevel_w = 1; 206 frame.bevel_w = 1;
196 207
208 m_layeritem = new FbTk::XLayerItem(frame.window, layer);
209
197 timeval delay; 210 timeval delay;
198 delay.tv_sec = 1; 211 delay.tv_sec = 1;
199 delay.tv_usec = 0; 212 delay.tv_usec = 0;
@@ -247,6 +260,8 @@ Toolbar::~Toolbar() {
247 if (frame.clk) image_ctrl.removeImage(frame.clk); 260 if (frame.clk) image_ctrl.removeImage(frame.clk);
248 if (frame.button) image_ctrl.removeImage(frame.button); 261 if (frame.button) image_ctrl.removeImage(frame.button);
249 if (frame.pbutton) image_ctrl.removeImage(frame.pbutton); 262 if (frame.pbutton) image_ctrl.removeImage(frame.pbutton);
263 if (m_layeritem) delete m_layeritem;
264 if (m_layermenu) delete m_layermenu;
250 265
251} 266}
252 267
@@ -748,13 +763,6 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
748 checkClock(true, true); 763 checkClock(true, true);
749 } 764 }
750#endif // HAVE_STRFTIME 765#endif // HAVE_STRFTIME
751 else if (! on_top) {
752 Workspace::Stack st;
753 st.push_back(frame.window.window());
754 screen().raiseWindows(st);
755 }
756 } else if (be.button == 2 && (! on_top)) {
757 frame.window.lower();
758 } else if (be.button == 3) { 766 } else if (be.button == 3) {
759 FluxboxWindow *fluxboxwin = 0; 767 FluxboxWindow *fluxboxwin = 0;
760 // if we clicked on a icon then show window menu 768 // if we clicked on a icon then show window menu