summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/TextButton.cc20
-rw-r--r--src/Toolbar.cc92
2 files changed, 56 insertions, 56 deletions
diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc
index 794acd5..30cc62a 100644
--- a/src/FbTk/TextButton.cc
+++ b/src/FbTk/TextButton.cc
@@ -29,8 +29,8 @@ using namespace std;
29 29
30namespace FbTk { 30namespace FbTk {
31 31
32TextButton::TextButton(const FbTk::FbWindow &parent, 32TextButton::TextButton(const FbTk::FbWindow &parent,
33 const FbTk::Font &font, 33 const FbTk::Font &font,
34 const std::string &text): 34 const std::string &text):
35 FbTk::Button(parent, 0, 0, 10, 10), 35 FbTk::Button(parent, 0, 0, 10, 10),
36 m_font(&font), 36 m_font(&font),
@@ -53,7 +53,7 @@ void TextButton::resize(unsigned int width, unsigned int height) {
53void TextButton::moveResize(int x, int y, 53void TextButton::moveResize(int x, int y,
54 unsigned int width, unsigned int height) { 54 unsigned int width, unsigned int height) {
55 m_buffer.resize(width, height); 55 m_buffer.resize(width, height);
56 56
57 if (backgroundPixmap() != ParentRelative) 57 if (backgroundPixmap() != ParentRelative)
58 FbWindow::setBackgroundPixmap(m_buffer.drawable()); 58 FbWindow::setBackgroundPixmap(m_buffer.drawable());
59 Button::moveResize(x, y, width, height); 59 Button::moveResize(x, y, width, height);
@@ -94,7 +94,7 @@ void TextButton::setTextPadding(unsigned int padding) {
94 setTextPaddingRight(padding/2); 94 setTextPaddingRight(padding/2);
95} 95}
96 96
97/// clear window and redraw text 97/// clear window and redraw text
98void TextButton::clear() { 98void TextButton::clear() {
99 TextButton::clearArea(0, 0, 99 TextButton::clearArea(0, 0,
100 width(), height()); 100 width(), height());
@@ -113,12 +113,12 @@ void TextButton::clearArea(int x, int y,
113 width, height); 113 width, height);
114 114
115 } else { // fill with background color 115 } else { // fill with background color
116 FbTk::GContext gc(m_buffer); 116 FbTk::GContext gc(m_buffer);
117 gc.setForeground(backgroundColor()); 117 gc.setForeground(backgroundColor());
118 m_buffer.fillRectangle(gc.gc(), 118 m_buffer.fillRectangle(gc.gc(),
119 x, y, 119 x, y,
120 width, height); 120 width, height);
121 121
122 } 122 }
123 123
124 drawText(); 124 drawText();
@@ -128,14 +128,14 @@ void TextButton::clearArea(int x, int y,
128 updateTransparent(x, y, width, height); 128 updateTransparent(x, y, width, height);
129 129
130 FbWindow::clearArea(x, y, width, height, exposure); 130 FbWindow::clearArea(x, y, width, height, exposure);
131 131
132 } else { // parent relative 132 } else { // parent relative
133 FbWindow::setBufferPixmap(0); 133 FbWindow::setBufferPixmap(0);
134 FbWindow::setBackgroundPixmap(backgroundPixmap()); 134 FbWindow::setBackgroundPixmap(backgroundPixmap());
135 Button::clearArea(x, y, width, height, exposure); 135 Button::clearArea(x, y, width, height, exposure);
136 updateTransparent(x, y, width, height); 136 updateTransparent(x, y, width, height);
137 drawText(); 137 drawText();
138 } 138 }
139} 139}
140 140
141unsigned int TextButton::textWidth() const { 141unsigned int TextButton::textWidth() const {
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 8426bac..a9b4c9d 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -116,7 +116,7 @@ getString() {
116 break; 116 break;
117 case Toolbar::TOPCENTER: 117 case Toolbar::TOPCENTER:
118 return string("TopCenter"); 118 return string("TopCenter");
119 break; 119 break;
120 case Toolbar::BOTTOMCENTER: 120 case Toolbar::BOTTOMCENTER:
121 return string("BottomCenter"); 121 return string("BottomCenter");
122 break; 122 break;
@@ -156,7 +156,7 @@ public:
156 SetToolbarPlacementCmd(Toolbar &tbar, Toolbar::Placement place):m_tbar(tbar), m_place(place) { } 156 SetToolbarPlacementCmd(Toolbar &tbar, Toolbar::Placement place):m_tbar(tbar), m_place(place) { }
157 void execute() { 157 void execute() {
158 m_tbar.setPlacement(m_place); 158 m_tbar.setPlacement(m_place);
159 m_tbar.reconfigure(); 159 m_tbar.reconfigure();
160 Fluxbox::instance()->save_rc(); 160 Fluxbox::instance()->save_rc();
161 } 161 }
162private: 162private:
@@ -175,7 +175,7 @@ Toolbar::Frame::Frame(FbTk::EventHandler &evh, int screen_num):
175 ButtonPressMask | ButtonReleaseMask | ExposureMask | 175 ButtonPressMask | ButtonReleaseMask | ExposureMask |
176 EnterWindowMask | LeaveWindowMask | SubstructureNotifyMask, 176 EnterWindowMask | LeaveWindowMask | SubstructureNotifyMask,
177 177
178 true) // override redirect 178 true) // override redirect
179{ 179{
180 180
181 FbTk::EventManager &evm = *FbTk::EventManager::instance(); 181 FbTk::EventManager &evm = *FbTk::EventManager::instance();
@@ -196,9 +196,9 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
196 m_window_pm(0), 196 m_window_pm(0),
197 m_screen(scrn), 197 m_screen(scrn),
198 m_layeritem(frame.window, layer), 198 m_layeritem(frame.window, layer),
199 m_layermenu(scrn.menuTheme(), 199 m_layermenu(scrn.menuTheme(),
200 scrn.imageControl(), 200 scrn.imageControl(),
201 *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), 201 *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
202 this, 202 this,
203 true), 203 true),
204 m_placementmenu(scrn.menuTheme(), 204 m_placementmenu(scrn.menuTheme(),
@@ -211,23 +211,23 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
211 m_tool_factory(scrn), 211 m_tool_factory(scrn),
212 m_strut(0), 212 m_strut(0),
213 // lock rcmanager here 213 // lock rcmanager here
214 m_rc_auto_hide(scrn.resourceManager().lock(), false, 214 m_rc_auto_hide(scrn.resourceManager().lock(), false,
215 scrn.name() + ".toolbar.autoHide", scrn.altName() + ".Toolbar.AutoHide"), 215 scrn.name() + ".toolbar.autoHide", scrn.altName() + ".Toolbar.AutoHide"),
216 m_rc_maximize_over(scrn.resourceManager(), false, 216 m_rc_maximize_over(scrn.resourceManager(), false,
217 scrn.name() + ".toolbar.maxOver", scrn.altName() + ".Toolbar.MaxOver"), 217 scrn.name() + ".toolbar.maxOver", scrn.altName() + ".Toolbar.MaxOver"),
218 m_rc_visible(scrn.resourceManager(), true, scrn.name() + ".toolbar.visible", scrn.altName() + ".Toolbar.Visible"), 218 m_rc_visible(scrn.resourceManager(), true, scrn.name() + ".toolbar.visible", scrn.altName() + ".Toolbar.Visible"),
219 m_rc_width_percent(scrn.resourceManager(), 65, 219 m_rc_width_percent(scrn.resourceManager(), 65,
220 scrn.name() + ".toolbar.widthPercent", scrn.altName() + ".Toolbar.WidthPercent"), 220 scrn.name() + ".toolbar.widthPercent", scrn.altName() + ".Toolbar.WidthPercent"),
221 m_rc_alpha(scrn.resourceManager(), 255, 221 m_rc_alpha(scrn.resourceManager(), 255,
222 scrn.name() + ".toolbar.alpha", scrn.altName() + ".Toolbar.Alpha"), 222 scrn.name() + ".toolbar.alpha", scrn.altName() + ".Toolbar.Alpha"),
223 m_rc_layernum(scrn.resourceManager(), Fluxbox::Layer(Fluxbox::instance()->getDesktopLayer()), 223 m_rc_layernum(scrn.resourceManager(), Fluxbox::Layer(Fluxbox::instance()->getDesktopLayer()),
224 scrn.name() + ".toolbar.layer", scrn.altName() + ".Toolbar.Layer"), 224 scrn.name() + ".toolbar.layer", scrn.altName() + ".Toolbar.Layer"),
225 m_rc_on_head(scrn.resourceManager(), 0, 225 m_rc_on_head(scrn.resourceManager(), 0,
226 scrn.name() + ".toolbar.onhead", scrn.altName() + ".Toolbar.onHead"), 226 scrn.name() + ".toolbar.onhead", scrn.altName() + ".Toolbar.onHead"),
227 m_rc_placement(scrn.resourceManager(), Toolbar::BOTTOMCENTER, 227 m_rc_placement(scrn.resourceManager(), Toolbar::BOTTOMCENTER,
228 scrn.name() + ".toolbar.placement", scrn.altName() + ".Toolbar.Placement"), 228 scrn.name() + ".toolbar.placement", scrn.altName() + ".Toolbar.Placement"),
229 m_rc_height(scrn.resourceManager(), 0, scrn.name() + ".toolbar.height", scrn.altName() + ".Toolbar.Height"), 229 m_rc_height(scrn.resourceManager(), 0, scrn.name() + ".toolbar.height", scrn.altName() + ".Toolbar.Height"),
230 m_rc_tools(scrn.resourceManager(), "workspacename, prevworkspace, nextworkspace, iconbar, systemtray, prevwindow, nextwindow, clock", 230 m_rc_tools(scrn.resourceManager(), "workspacename, prevworkspace, nextworkspace, iconbar, systemtray, prevwindow, nextwindow, clock",
231 scrn.name() + ".toolbar.tools", scrn.altName() + ".Toolbar.Tools"), 231 scrn.name() + ".toolbar.tools", scrn.altName() + ".Toolbar.Tools"),
232 m_shape(new Shape(frame.window, 0)), 232 m_shape(new Shape(frame.window, 0)),
233 m_resize_lock(false) { 233 m_resize_lock(false) {
@@ -248,13 +248,13 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
248 setupMenus(); 248 setupMenus();
249 // add menu to screen 249 // add menu to screen
250 screen().addConfigMenu(_FBTEXT(Toolbar, Toolbar, "Toolbar", "title of toolbar menu item"), menu()); 250 screen().addConfigMenu(_FBTEXT(Toolbar, Toolbar, "Toolbar", "title of toolbar menu item"), menu());
251 251
252 // geometry settings 252 // geometry settings
253 frame.width = width; 253 frame.width = width;
254 frame.height = 10; 254 frame.height = 10;
255 frame.bevel_w = 1; 255 frame.bevel_w = 1;
256 frame.grab_x = frame.grab_y = 0; 256 frame.grab_x = frame.grab_y = 0;
257 257
258 // setup hide timer 258 // setup hide timer
259 m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay()); 259 m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay());
260 FbTk::RefCount<FbTk::Command> toggle_hidden(new FbTk::SimpleCommand<Toolbar>(*this, &Toolbar::toggleHidden)); 260 FbTk::RefCount<FbTk::Command> toggle_hidden(new FbTk::SimpleCommand<Toolbar>(*this, &Toolbar::toggleHidden));
@@ -270,7 +270,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
270 // setup to listen to child events 270 // setup to listen to child events
271 FbTk::EventManager::instance()->addParent(*this, window()); 271 FbTk::EventManager::instance()->addParent(*this, window());
272 // get everything together 272 // get everything together
273 reconfigure(); 273 reconfigure();
274 // this gets done by the screen later as it loads 274 // this gets done by the screen later as it loads
275 275
276} 276}
@@ -304,7 +304,7 @@ void Toolbar::updateStrut() {
304 // if the user dont want to request space for toolbar. 304 // if the user dont want to request space for toolbar.
305 if (doAutoHide() || *m_rc_maximize_over) { 305 if (doAutoHide() || *m_rc_maximize_over) {
306 if (had_strut) 306 if (had_strut)
307 screen().updateAvailableWorkspaceArea(); 307 screen().updateAvailableWorkspaceArea();
308 return; 308 return;
309 } 309 }
310 310
@@ -366,7 +366,7 @@ void Toolbar::reconfigure() {
366 366
367 bool need_update = false; 367 bool need_update = false;
368 // parse and transform to lower case 368 // parse and transform to lower case
369 std::list<std::string> tools; 369 std::list<std::string> tools;
370 FbTk::StringUtil::stringtok(tools, *m_rc_tools, ", "); 370 FbTk::StringUtil::stringtok(tools, *m_rc_tools, ", ");
371 transform(tools.begin(), 371 transform(tools.begin(),
372 tools.end(), 372 tools.end(),
@@ -393,10 +393,10 @@ void Toolbar::reconfigure() {
393 deleteItems(); 393 deleteItems();
394 394
395 m_tools = tools; // copy values 395 m_tools = tools; // copy values
396 396
397 if (m_tools.size()) { 397 if (m_tools.size()) {
398 // make lower case 398 // make lower case
399 transform(m_tools.begin(), m_tools.end(), 399 transform(m_tools.begin(), m_tools.end(),
400 m_tools.begin(), 400 m_tools.begin(),
401 FbTk::StringUtil::toLower); 401 FbTk::StringUtil::toLower);
402 402
@@ -421,7 +421,7 @@ void Toolbar::reconfigure() {
421 421
422 frame.bevel_w = theme().bevelWidth(); 422 frame.bevel_w = theme().bevelWidth();
423 // destroy shape if the theme wasn't specified with one, 423 // destroy shape if the theme wasn't specified with one,
424 // or create one 424 // or create one
425 if (theme().shape() == false && m_shape.get()) 425 if (theme().shape() == false && m_shape.get())
426 m_shape.reset(0); 426 m_shape.reset(0);
427 else if (theme().shape() && m_shape.get() == 0) { 427 else if (theme().shape() && m_shape.get() == 0) {
@@ -451,7 +451,7 @@ void Toolbar::reconfigure() {
451 } 451 }
452 if (tmp) 452 if (tmp)
453 screen().imageControl().removeImage(tmp); 453 screen().imageControl().removeImage(tmp);
454 454
455 frame.window.setBorderColor(theme().border().color()); 455 frame.window.setBorderColor(theme().border().color());
456 frame.window.setBorderWidth(theme().border().width()); 456 frame.window.setBorderWidth(theme().border().width());
457 457
@@ -463,7 +463,7 @@ void Toolbar::reconfigure() {
463 } 463 }
464 frame.window.clear(); 464 frame.window.clear();
465 frame.window.updateTransparent(); 465 frame.window.updateTransparent();
466 466
467 if (theme().shape() && m_shape.get()) 467 if (theme().shape() && m_shape.get())
468 m_shape->update(); 468 m_shape->update();
469 469
@@ -480,7 +480,7 @@ void Toolbar::reconfigure() {
480 } 480 }
481 481
482 menu().reconfigure(); 482 menu().reconfigure();
483 // we're done with all resizing and stuff now we can request a new 483 // we're done with all resizing and stuff now we can request a new
484 // area to be reserved on screen 484 // area to be reserved on screen
485 updateStrut(); 485 updateStrut();
486 486
@@ -499,7 +499,7 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
499 int head = screen().getHead(be.x_root, be.y_root); 499 int head = screen().getHead(be.x_root, be.y_root);
500 int borderw = menu().fbwindow().borderWidth(); 500 int borderw = menu().fbwindow().borderWidth();
501 pair<int, int> m = screen().clampToHead(head, 501 pair<int, int> m = screen().clampToHead(head,
502 be.x_root - (menu().width() / 2), 502 be.x_root - (menu().width() / 2),
503 be.y_root - (menu().titleWindow().height() / 2), 503 be.y_root - (menu().titleWindow().height() / 2),
504 menu().width() + 2*borderw, 504 menu().width() + 2*borderw,
505 menu().height() + 2*borderw); 505 menu().height() + 2*borderw);
@@ -513,7 +513,7 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
513 menu().grabInputFocus(); 513 menu().grabInputFocus();
514 } else 514 } else
515 menu().hide(); 515 menu().hide();
516 516
517} 517}
518 518
519 519
@@ -551,9 +551,9 @@ void Toolbar::leaveNotifyEvent(XCrossingEvent &event) {
551 return; 551 return;
552 552
553 if (isHidden()) { 553 if (isHidden()) {
554 if (m_hide_timer.isTiming()) 554 if (m_hide_timer.isTiming())
555 m_hide_timer.stop(); 555 m_hide_timer.stop();
556 } else if (! menu().isVisible() && ! m_hide_timer.isTiming()) 556 } else if (! menu().isVisible() && ! m_hide_timer.isTiming())
557 m_hide_timer.start(); 557 m_hide_timer.start();
558 558
559} 559}
@@ -578,7 +578,7 @@ void Toolbar::handleEvent(XEvent &event) {
578 event.xconfigure.window != window().window()) { 578 event.xconfigure.window != window().window()) {
579 rearrangeItems(); 579 rearrangeItems();
580 } 580 }
581*/ 581*/
582} 582}
583 583
584void Toolbar::update(FbTk::Subject *subj) { 584void Toolbar::update(FbTk::Subject *subj) {
@@ -626,7 +626,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
626 int border_width = theme().border().width(); 626 int border_width = theme().border().width();
627 627
628 frame.width = (head_w - 2*border_width) * (*m_rc_width_percent) / 100; 628 frame.width = (head_w - 2*border_width) * (*m_rc_width_percent) / 100;
629 //!! TODO: change this 629 //!! TODO: change this
630 // max height of each toolbar items font... 630 // max height of each toolbar items font...
631 unsigned int max_height = m_tool_factory.maxFontHeight(); 631 unsigned int max_height = m_tool_factory.maxFontHeight();
632 632
@@ -769,13 +769,13 @@ void Toolbar::toggleHidden() {
769 m_hidden = ! m_hidden; 769 m_hidden = ! m_hidden;
770 if (isHidden()) 770 if (isHidden())
771 frame.window.move(frame.x_hidden, frame.y_hidden); 771 frame.window.move(frame.x_hidden, frame.y_hidden);
772 else 772 else
773 frame.window.move(frame.x, frame.y); 773 frame.window.move(frame.x, frame.y);
774 774
775} 775}
776 776
777void Toolbar::moveToLayer(int layernum) { 777void Toolbar::moveToLayer(int layernum) {
778 m_layeritem.moveToLayer(layernum); 778 m_layeritem.moveToLayer(layernum);
779 *m_rc_layernum = layernum; 779 *m_rc_layernum = layernum;
780} 780}
781 781
@@ -787,15 +787,15 @@ void Toolbar::setupMenus() {
787 typedef SimpleCommand<Toolbar> ToolbarCommand; 787 typedef SimpleCommand<Toolbar> ToolbarCommand;
788 788
789 //!! TODO: this should be inserted by the workspace tool 789 //!! TODO: this should be inserted by the workspace tool
790 790
791 791
792 RefCommand start_edit(CommandParser::instance().parseLine("setworkspacenamedialog")); 792 RefCommand start_edit(CommandParser::instance().parseLine("setworkspacenamedialog"));
793 menu().insert(_FBTEXT(Toolbar, EditWkspcName, 793 menu().insert(_FBTEXT(Toolbar, EditWkspcName,
794 "Edit current workspace name", "Edit current workspace name"), 794 "Edit current workspace name", "Edit current workspace name"),
795 start_edit); 795 start_edit);
796 796
797 menu().setLabel(_FBTEXT(Toolbar, Toolbar, 797 menu().setLabel(_FBTEXT(Toolbar, Toolbar,
798 "Toolbar", "Title of Toolbar menu")); 798 "Toolbar", "Title of Toolbar menu"));
799 799
800 MenuItem *toolbar_menuitem = new IntResMenuItem(_FBTEXT(Toolbar, WidthPercent, "Toolbar width percent", "Percentage of screen width taken by toolbar"), 800 MenuItem *toolbar_menuitem = new IntResMenuItem(_FBTEXT(Toolbar, WidthPercent, "Toolbar width percent", "Percentage of screen width taken by toolbar"),
801 m_rc_width_percent, 801 m_rc_width_percent,
@@ -809,7 +809,7 @@ void Toolbar::setupMenus() {
809 toolbar_menuitem_macro->add(save_resources); 809 toolbar_menuitem_macro->add(save_resources);
810 810
811 RefCommand reconfig_toolbar_and_save_resource(toolbar_menuitem_macro); 811 RefCommand reconfig_toolbar_and_save_resource(toolbar_menuitem_macro);
812 toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource); 812 toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource);
813 813
814 menu().insert(toolbar_menuitem); 814 menu().insert(toolbar_menuitem);
815 815
@@ -823,7 +823,7 @@ void Toolbar::setupMenus() {
823 visible_macro->add(toggle_visible); 823 visible_macro->add(toggle_visible);
824 visible_macro->add(save_resources); 824 visible_macro->add(save_resources);
825 RefCommand toggle_visible_cmd(visible_macro); 825 RefCommand toggle_visible_cmd(visible_macro);
826 menu().insert(new BoolMenuItem(_FBTEXT(Common, Visible, "Visible", "Whether this item is visible"), 826 menu().insert(new BoolMenuItem(_FBTEXT(Common, Visible, "Visible", "Whether this item is visible"),
827 *m_rc_visible, toggle_visible_cmd)); 827 *m_rc_visible, toggle_visible_cmd));
828 828
829 menu().insert(new BoolMenuItem(_FBTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"), 829 menu().insert(new BoolMenuItem(_FBTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"),
@@ -842,7 +842,7 @@ void Toolbar::setupMenus() {
842 *this, 842 *this,
843 _FBTEXT(Toolbar, OnHead, "Toolbar on Head", "Title of toolbar on head menu"))); 843 _FBTEXT(Toolbar, OnHead, "Toolbar on Head", "Title of toolbar on head menu")));
844 } 844 }
845 845
846 typedef pair<const char*, Toolbar::Placement> PlacementP; 846 typedef pair<const char*, Toolbar::Placement> PlacementP;
847 typedef list<PlacementP> Placements; 847 typedef list<PlacementP> Placements;
848 Placements place_menu; 848 Placements place_menu;
@@ -863,7 +863,7 @@ void Toolbar::setupMenus() {
863 place_menu.push_back(PlacementP(_FBTEXT(Align, RightCenter, "Right Center", "Right Center"), Toolbar::RIGHTCENTER)); 863 place_menu.push_back(PlacementP(_FBTEXT(Align, RightCenter, "Right Center", "Right Center"), Toolbar::RIGHTCENTER));
864 place_menu.push_back(PlacementP(_FBTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), Toolbar::RIGHTBOTTOM)); 864 place_menu.push_back(PlacementP(_FBTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), Toolbar::RIGHTBOTTOM));
865 place_menu.push_back(PlacementP(_FBTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Toolbar::BOTTOMRIGHT)); 865 place_menu.push_back(PlacementP(_FBTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Toolbar::BOTTOMRIGHT));
866 866
867 867
868 placementMenu().setMinimumSublevels(3); 868 placementMenu().setMinimumSublevels(3);
869 // create items in sub menu 869 // create items in sub menu
@@ -877,7 +877,7 @@ void Toolbar::setupMenus() {
877 } else { 877 } else {
878 RefCommand setplace(new SetToolbarPlacementCmd(*this, placement)); 878 RefCommand setplace(new SetToolbarPlacementCmd(*this, placement));
879 placementMenu().insert(str, setplace); 879 placementMenu().insert(str, setplace);
880 880
881 } 881 }
882 place_menu.pop_front(); 882 place_menu.pop_front();
883 } 883 }
@@ -886,12 +886,12 @@ void Toolbar::setupMenus() {
886 886
887 887
888 // this saves resources and clears the slit window to update alpha value 888 // this saves resources and clears the slit window to update alpha value
889 FbTk::MenuItem *alpha_menuitem = 889 FbTk::MenuItem *alpha_menuitem =
890 new IntResMenuItem(_FBTEXT(Common, Alpha, "Alpha", "Transparency level"), 890 new IntResMenuItem(_FBTEXT(Common, Alpha, "Alpha", "Transparency level"),
891 m_rc_alpha, 891 m_rc_alpha,
892 0, 255); 892 0, 255);
893 // setup command for alpha value 893 // setup command for alpha value
894 MacroCommand *alpha_macrocmd = new MacroCommand(); 894 MacroCommand *alpha_macrocmd = new MacroCommand();
895 RefCount<Command> alpha_cmd(new SimpleCommand<Toolbar>(*this, &Toolbar::updateAlpha)); 895 RefCount<Command> alpha_cmd(new SimpleCommand<Toolbar>(*this, &Toolbar::updateAlpha));
896 alpha_macrocmd->add(save_resources); 896 alpha_macrocmd->add(save_resources);
897 alpha_macrocmd->add(alpha_cmd); 897 alpha_macrocmd->add(alpha_cmd);
@@ -908,7 +908,7 @@ void Toolbar::saveOnHead(int head) {
908} 908}
909 909
910/* 910/*
911 * Place items next to each other, with a bevel width between, 911 * Place items next to each other, with a bevel width between,
912 * above and below each item. BUT, if there is no bevel width, then 912 * above and below each item. BUT, if there is no bevel width, then
913 * borders should be merged for evenness. 913 * borders should be merged for evenness.
914 */ 914 */
@@ -998,7 +998,7 @@ void Toolbar::rearrangeItems() {
998 if (bevel_width == 0) { 998 if (bevel_width == 0) {
999 offset = -borderW; 999 offset = -borderW;
1000 size_offset = 0; 1000 size_offset = 0;
1001 if (borderW > last_bw) 1001 if (borderW > last_bw)
1002 next_x += borderW; 1002 next_x += borderW;
1003 else 1003 else
1004 next_x += last_bw; 1004 next_x += last_bw;
@@ -1014,10 +1014,10 @@ void Toolbar::rearrangeItems() {
1014 (*item_it)->moveResize(next_x + offset, offset, extra + relative_width, height() - size_offset); 1014 (*item_it)->moveResize(next_x + offset, offset, extra + relative_width, height() - size_offset);
1015 } else if ((*item_it)->type() == ToolbarItem::SQUARE) { 1015 } else if ((*item_it)->type() == ToolbarItem::SQUARE) {
1016 (*item_it)->moveResize(next_x + offset, offset, 1016 (*item_it)->moveResize(next_x + offset, offset,
1017 height() - size_offset, height() - size_offset); 1017 height() - size_offset, height() - size_offset);
1018 } else { // fixed size 1018 } else { // fixed size
1019 (*item_it)->moveResize(next_x + offset, offset, 1019 (*item_it)->moveResize(next_x + offset, offset,
1020 (*item_it)->width(), height() - size_offset); 1020 (*item_it)->width(), height() - size_offset);
1021 } 1021 }
1022 (*item_it)->show(); 1022 (*item_it)->show();
1023 next_x += (*item_it)->width() + bevel_width; 1023 next_x += (*item_it)->width() + bevel_width;