all repos — fluxbox @ 8e33dad39f17cf73d9a12e3509d94d1aa88c32f5

custom fork of the fluxbox windowmanager

white-space cosmetic
mathias mathias
commit

8e33dad39f17cf73d9a12e3509d94d1aa88c32f5

parent

31d8f96685d7c530f6a3aa12eb8ca5cd5e82daeb

2 files changed, 56 insertions(+), 56 deletions(-)

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

@@ -29,8 +29,8 @@ using namespace std;

namespace FbTk { -TextButton::TextButton(const FbTk::FbWindow &parent, - const FbTk::Font &font, +TextButton::TextButton(const FbTk::FbWindow &parent, + const FbTk::Font &font, const std::string &text): FbTk::Button(parent, 0, 0, 10, 10), m_font(&font),

@@ -53,7 +53,7 @@

void TextButton::moveResize(int x, int y, unsigned int width, unsigned int height) { m_buffer.resize(width, height); - + if (backgroundPixmap() != ParentRelative) FbWindow::setBackgroundPixmap(m_buffer.drawable()); Button::moveResize(x, y, width, height);

@@ -94,7 +94,7 @@ setTextPaddingLeft(padding/2);

setTextPaddingRight(padding/2); } -/// clear window and redraw text +/// clear window and redraw text void TextButton::clear() { TextButton::clearArea(0, 0, width(), height());

@@ -113,12 +113,12 @@ x, y,

width, height); } else { // fill with background color - FbTk::GContext gc(m_buffer); + FbTk::GContext gc(m_buffer); gc.setForeground(backgroundColor()); m_buffer.fillRectangle(gc.gc(), x, y, width, height); - + } drawText();

@@ -128,14 +128,14 @@ FbWindow::setBackgroundPixmap(m_buffer.drawable());

updateTransparent(x, y, width, height); FbWindow::clearArea(x, y, width, height, exposure); - - } else { // parent relative + + } else { // parent relative FbWindow::setBufferPixmap(0); - FbWindow::setBackgroundPixmap(backgroundPixmap()); + FbWindow::setBackgroundPixmap(backgroundPixmap()); Button::clearArea(x, y, width, height, exposure); updateTransparent(x, y, width, height); drawText(); - } + } } unsigned int TextButton::textWidth() const {
M src/Toolbar.ccsrc/Toolbar.cc

@@ -116,7 +116,7 @@ return string("BottomLeft");

break; case Toolbar::TOPCENTER: return string("TopCenter"); - break; + break; case Toolbar::BOTTOMCENTER: return string("BottomCenter"); break;

@@ -156,7 +156,7 @@ public:

SetToolbarPlacementCmd(Toolbar &tbar, Toolbar::Placement place):m_tbar(tbar), m_place(place) { } void execute() { m_tbar.setPlacement(m_place); - m_tbar.reconfigure(); + m_tbar.reconfigure(); Fluxbox::instance()->save_rc(); } private:

@@ -175,7 +175,7 @@ // event mask

ButtonPressMask | ButtonReleaseMask | ExposureMask | EnterWindowMask | LeaveWindowMask | SubstructureNotifyMask, - true) // override redirect + true) // override redirect { FbTk::EventManager &evm = *FbTk::EventManager::instance();

@@ -196,9 +196,9 @@ frame(*this, scrn.screenNumber()),

m_window_pm(0), m_screen(scrn), m_layeritem(frame.window, layer), - m_layermenu(scrn.menuTheme(), + m_layermenu(scrn.menuTheme(), scrn.imageControl(), - *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), + *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), this, true), m_placementmenu(scrn.menuTheme(),

@@ -211,23 +211,23 @@ m_theme(scrn.screenNumber()),

m_tool_factory(scrn), m_strut(0), // lock rcmanager here - m_rc_auto_hide(scrn.resourceManager().lock(), false, + m_rc_auto_hide(scrn.resourceManager().lock(), false, scrn.name() + ".toolbar.autoHide", scrn.altName() + ".Toolbar.AutoHide"), m_rc_maximize_over(scrn.resourceManager(), false, scrn.name() + ".toolbar.maxOver", scrn.altName() + ".Toolbar.MaxOver"), m_rc_visible(scrn.resourceManager(), true, scrn.name() + ".toolbar.visible", scrn.altName() + ".Toolbar.Visible"), - m_rc_width_percent(scrn.resourceManager(), 65, - scrn.name() + ".toolbar.widthPercent", scrn.altName() + ".Toolbar.WidthPercent"), - m_rc_alpha(scrn.resourceManager(), 255, - scrn.name() + ".toolbar.alpha", scrn.altName() + ".Toolbar.Alpha"), - m_rc_layernum(scrn.resourceManager(), Fluxbox::Layer(Fluxbox::instance()->getDesktopLayer()), + m_rc_width_percent(scrn.resourceManager(), 65, + scrn.name() + ".toolbar.widthPercent", scrn.altName() + ".Toolbar.WidthPercent"), + m_rc_alpha(scrn.resourceManager(), 255, + scrn.name() + ".toolbar.alpha", scrn.altName() + ".Toolbar.Alpha"), + m_rc_layernum(scrn.resourceManager(), Fluxbox::Layer(Fluxbox::instance()->getDesktopLayer()), scrn.name() + ".toolbar.layer", scrn.altName() + ".Toolbar.Layer"), m_rc_on_head(scrn.resourceManager(), 0, scrn.name() + ".toolbar.onhead", scrn.altName() + ".Toolbar.onHead"), - m_rc_placement(scrn.resourceManager(), Toolbar::BOTTOMCENTER, + 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(), "workspacename, prevworkspace, nextworkspace, iconbar, systemtray, prevwindow, nextwindow, clock", scrn.name() + ".toolbar.tools", scrn.altName() + ".Toolbar.Tools"), m_shape(new Shape(frame.window, 0)), m_resize_lock(false) {

@@ -248,13 +248,13 @@ m_placementmenu.setInternalMenu();

setupMenus(); // add menu to screen screen().addConfigMenu(_FBTEXT(Toolbar, Toolbar, "Toolbar", "title of toolbar menu item"), menu()); - + // geometry settings frame.width = width; frame.height = 10; frame.bevel_w = 1; frame.grab_x = frame.grab_y = 0; - + // setup hide timer m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay()); FbTk::RefCount<FbTk::Command> toggle_hidden(new FbTk::SimpleCommand<Toolbar>(*this, &Toolbar::toggleHidden));

@@ -270,7 +270,7 @@ scrn.resourceManager().unlock();

// setup to listen to child events FbTk::EventManager::instance()->addParent(*this, window()); // get everything together - reconfigure(); + reconfigure(); // this gets done by the screen later as it loads }

@@ -304,7 +304,7 @@ // we should request space if we're in autohide mode or

// if the user dont want to request space for toolbar. if (doAutoHide() || *m_rc_maximize_over) { if (had_strut) - screen().updateAvailableWorkspaceArea(); + screen().updateAvailableWorkspaceArea(); return; }

@@ -366,7 +366,7 @@ // parse resource tools and determine if we need to rebuild toolbar

bool need_update = false; // parse and transform to lower case - std::list<std::string> tools; + std::list<std::string> tools; FbTk::StringUtil::stringtok(tools, *m_rc_tools, ", "); transform(tools.begin(), tools.end(),

@@ -393,10 +393,10 @@ // destroy tools and rebuild them

deleteItems(); m_tools = tools; // copy values - + if (m_tools.size()) { // make lower case - transform(m_tools.begin(), m_tools.end(), + transform(m_tools.begin(), m_tools.end(), m_tools.begin(), FbTk::StringUtil::toLower);

@@ -421,7 +421,7 @@ m_hide_timer.start();

frame.bevel_w = theme().bevelWidth(); // destroy shape if the theme wasn't specified with one, - // or create one + // or create one if (theme().shape() == false && m_shape.get()) m_shape.reset(0); else if (theme().shape() && m_shape.get() == 0) {

@@ -451,7 +451,7 @@ frame.window.setBackgroundPixmap(m_window_pm);

} if (tmp) screen().imageControl().removeImage(tmp); - + frame.window.setBorderColor(theme().border().color()); frame.window.setBorderWidth(theme().border().width());

@@ -463,7 +463,7 @@ frame.window.setAlpha(alpha());

} frame.window.clear(); frame.window.updateTransparent(); - + if (theme().shape() && m_shape.get()) m_shape->update();

@@ -480,7 +480,7 @@ (*item_it)->renderTheme(alpha());

} menu().reconfigure(); - // we're done with all resizing and stuff now we can request a new + // we're done with all resizing and stuff now we can request a new // area to be reserved on screen updateStrut();

@@ -499,7 +499,7 @@

int head = screen().getHead(be.x_root, be.y_root); int borderw = menu().fbwindow().borderWidth(); pair<int, int> m = screen().clampToHead(head, - be.x_root - (menu().width() / 2), + be.x_root - (menu().width() / 2), be.y_root - (menu().titleWindow().height() / 2), menu().width() + 2*borderw, menu().height() + 2*borderw);

@@ -513,7 +513,7 @@ menu().show();

menu().grabInputFocus(); } else menu().hide(); - + }

@@ -551,9 +551,9 @@ event.y_root > y() && event.y_root <= (int)(y() + height()))

return; if (isHidden()) { - if (m_hide_timer.isTiming()) + if (m_hide_timer.isTiming()) m_hide_timer.stop(); - } else if (! menu().isVisible() && ! m_hide_timer.isTiming()) + } else if (! menu().isVisible() && ! m_hide_timer.isTiming()) m_hide_timer.start(); }

@@ -578,7 +578,7 @@ if (event.type == ConfigureNotify &&

event.xconfigure.window != window().window()) { rearrangeItems(); } -*/ +*/ } void Toolbar::update(FbTk::Subject *subj) {

@@ -626,7 +626,7 @@ int bevel_width = theme().bevelWidth();

int border_width = theme().border().width(); frame.width = (head_w - 2*border_width) * (*m_rc_width_percent) / 100; - //!! TODO: change this + //!! TODO: change this // max height of each toolbar items font... unsigned int max_height = m_tool_factory.maxFontHeight();

@@ -769,13 +769,13 @@ // toggle hidden

m_hidden = ! m_hidden; if (isHidden()) frame.window.move(frame.x_hidden, frame.y_hidden); - else + else frame.window.move(frame.x, frame.y); } void Toolbar::moveToLayer(int layernum) { - m_layeritem.moveToLayer(layernum); + m_layeritem.moveToLayer(layernum); *m_rc_layernum = layernum; }

@@ -787,15 +787,15 @@ typedef RefCount<Command> RefCommand;

typedef SimpleCommand<Toolbar> ToolbarCommand; //!! TODO: this should be inserted by the workspace tool - + RefCommand start_edit(CommandParser::instance().parseLine("setworkspacenamedialog")); menu().insert(_FBTEXT(Toolbar, EditWkspcName, "Edit current workspace name", "Edit current workspace name"), start_edit); - + menu().setLabel(_FBTEXT(Toolbar, Toolbar, - "Toolbar", "Title of Toolbar menu")); + "Toolbar", "Title of Toolbar menu")); MenuItem *toolbar_menuitem = new IntResMenuItem(_FBTEXT(Toolbar, WidthPercent, "Toolbar width percent", "Percentage of screen width taken by toolbar"), m_rc_width_percent,

@@ -809,7 +809,7 @@ toolbar_menuitem_macro->add(reconfig_toolbar);

toolbar_menuitem_macro->add(save_resources); RefCommand reconfig_toolbar_and_save_resource(toolbar_menuitem_macro); - toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource); + toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource); menu().insert(toolbar_menuitem);

@@ -823,7 +823,7 @@ RefCommand toggle_visible(new ToolbarCommand(*this, &Toolbar::updateVisibleState));

visible_macro->add(toggle_visible); visible_macro->add(save_resources); RefCommand toggle_visible_cmd(visible_macro); - menu().insert(new BoolMenuItem(_FBTEXT(Common, Visible, "Visible", "Whether this item is visible"), + menu().insert(new BoolMenuItem(_FBTEXT(Common, Visible, "Visible", "Whether this item is visible"), *m_rc_visible, toggle_visible_cmd)); menu().insert(new BoolMenuItem(_FBTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"),

@@ -842,7 +842,7 @@ *screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),

*this, _FBTEXT(Toolbar, OnHead, "Toolbar on Head", "Title of toolbar on head menu"))); } - + typedef pair<const char*, Toolbar::Placement> PlacementP; typedef list<PlacementP> Placements; Placements place_menu;

@@ -863,7 +863,7 @@ place_menu.push_back(PlacementP(_FBTEXT(Align, RightTop, "Right Top", "Right Top"), Toolbar::RIGHTTOP));

place_menu.push_back(PlacementP(_FBTEXT(Align, RightCenter, "Right Center", "Right Center"), Toolbar::RIGHTCENTER)); place_menu.push_back(PlacementP(_FBTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), Toolbar::RIGHTBOTTOM)); place_menu.push_back(PlacementP(_FBTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Toolbar::BOTTOMRIGHT)); - + placementMenu().setMinimumSublevels(3); // create items in sub menu

@@ -877,7 +877,7 @@ placementMenu().setItemEnabled(i, false);

} else { RefCommand setplace(new SetToolbarPlacementCmd(*this, placement)); placementMenu().insert(str, setplace); - + } place_menu.pop_front(); }

@@ -886,12 +886,12 @@ placementMenu().updateMenu();

// this saves resources and clears the slit window to update alpha value - FbTk::MenuItem *alpha_menuitem = + FbTk::MenuItem *alpha_menuitem = new IntResMenuItem(_FBTEXT(Common, Alpha, "Alpha", "Transparency level"), m_rc_alpha, 0, 255); // setup command for alpha value - MacroCommand *alpha_macrocmd = new MacroCommand(); + MacroCommand *alpha_macrocmd = new MacroCommand(); RefCount<Command> alpha_cmd(new SimpleCommand<Toolbar>(*this, &Toolbar::updateAlpha)); alpha_macrocmd->add(save_resources); alpha_macrocmd->add(alpha_cmd);

@@ -908,7 +908,7 @@ reconfigure();

} /* - * Place items next to each other, with a bevel width between, + * Place items next to each other, with a bevel width between, * above and below each item. BUT, if there is no bevel width, then * borders should be merged for evenness. */

@@ -998,7 +998,7 @@

if (bevel_width == 0) { offset = -borderW; size_offset = 0; - if (borderW > last_bw) + if (borderW > last_bw) next_x += borderW; else next_x += last_bw;

@@ -1014,10 +1014,10 @@ }

(*item_it)->moveResize(next_x + offset, offset, extra + relative_width, height() - size_offset); } else if ((*item_it)->type() == ToolbarItem::SQUARE) { (*item_it)->moveResize(next_x + offset, offset, - height() - size_offset, height() - size_offset); + height() - size_offset, height() - size_offset); } else { // fixed size (*item_it)->moveResize(next_x + offset, offset, - (*item_it)->width(), height() - size_offset); + (*item_it)->width(), height() - size_offset); } (*item_it)->show(); next_x += (*item_it)->width() + bevel_width;