#include "i18n.hh"
#include "blackbox.hh"
-#include "Clientmenu.hh"
#include "Font.hh"
#include "GCCache.hh"
-#include "Iconmenu.hh"
#include "Image.hh"
-#include "Rootmenu.hh"
#include "Screen.hh"
#include "Toolbar.hh"
#include "Window.hh"
#include "Workspace.hh"
+#include "Clientmenu.hh"
#include "Workspacemenu.hh"
#include "Slit.hh"
int pos = frame.bevel_w * 2; // this is modified by doJustify()
style->doJustify(t, pos, frame.clock_w, frame.bevel_w * 4);
+
+#ifdef XFT
+ XClearWindow(display, frame.clock);
+#endif // XFT
+
style->font->drawString(frame.clock, pos, 1, style->c_text, t);
}
}
return;
}
+#ifdef XFT
+ redraw = true;
+#endif // XFT
+
if (redraw)
XClearWindow(display, frame.window_label);
void Toolbar::redrawWorkspaceLabel(bool redraw) {
const string& name = screen->getCurrentWorkspace()->getName();
+#ifdef XFT
+ redraw = true;
+#endif // XFT
+
if (redraw)
XClearWindow(display, frame.workspace_label);
void Toolbar::drawArrow(Drawable surface, bool left) const {
+ ToolbarStyle *style = screen->getToolbarStyle();
+
+ BPen pen(style->b_pic);
+
int hh = frame.button_w / 2, hw = frame.button_w / 2;
XPoint pts[3];
const int bullet_size = 3;
+
if (left) {
- pts[0].x = hw - bullet_size;
- pts[0].y = hh;
- pts[1].x = 2 * bullet_size;
- pts[1].y = bullet_size;
- pts[2].x = 0;
- pts[2].y = -(2 * bullet_size);
+#ifdef BITMAPBUTTONS
+ if (style->left_button.mask != None) {
+ XSetClipMask(blackbox->getXDisplay(), pen.gc(), style->left_button.mask);
+ XSetClipOrigin(blackbox->getXDisplay(), pen.gc(),
+ (frame.button_w - style->left_button.w)/2,
+ (frame.button_w - style->left_button.h)/2);
+
+ XFillRectangle(blackbox->getXDisplay(), surface, pen.gc(),
+ (frame.button_w - style->left_button.w)/2,
+ (frame.button_w - style->left_button.h)/2,
+ style->left_button.w, style->left_button.h);
+
+ XSetClipMask(blackbox->getXDisplay(), pen.gc(), None);
+ XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0);
+ } else {
+#endif // BITMAPBUTTONS
+ pts[0].x = hw - bullet_size;
+ pts[0].y = hh;
+ pts[1].x = 2 * bullet_size;
+ pts[1].y = bullet_size;
+ pts[2].x = 0;
+ pts[2].y = -(2 * bullet_size);
+ XFillPolygon(display, surface, pen.gc(), pts, 3, Convex,
+ CoordModePrevious);
+#ifdef BITMAPBUTTONS
+ }
+#endif // BITMAPBUTTONS
} else {
- pts[0].x = hw - bullet_size;
- pts[0].y = hh - bullet_size;
- pts[1].x = (2 * bullet_size);
- pts[1].y = bullet_size;
- pts[2].x = -(2 * bullet_size);
- pts[2].y = bullet_size;
+#ifdef BITMAPBUTTONS
+ if (style->right_button.mask != None) {
+ XSetClipMask(blackbox->getXDisplay(), pen.gc(),
+ style->right_button.mask);
+ XSetClipOrigin(blackbox->getXDisplay(), pen.gc(),
+ (frame.button_w - style->right_button.w)/2,
+ (frame.button_w - style->right_button.h)/2);
+
+ XFillRectangle(blackbox->getXDisplay(), surface, pen.gc(),
+ (frame.button_w - style->right_button.w)/2,
+ (frame.button_w - style->right_button.h)/2,
+ (frame.button_w + style->right_button.w)/2,
+ (frame.button_w + style->right_button.h)/2);
+
+ XSetClipMask(blackbox->getXDisplay(), pen.gc(), None);
+ XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0);
+ } else {
+#endif // BITMAPBUTTONS
+ pts[0].x = hw - bullet_size;
+ pts[0].y = hh - bullet_size;
+ pts[1].x = (2 * bullet_size);
+ pts[1].y = bullet_size;
+ pts[2].x = -(2 * bullet_size);
+ pts[2].y = bullet_size;
+ XFillPolygon(display, surface, pen.gc(), pts, 3, Convex,
+ CoordModePrevious);
+#ifdef BITMAPBUTTONS
+ }
+#endif
}
-
- BPen pen(screen->getToolbarStyle()->b_pic);
- XFillPolygon(display, surface, pen.gc(), pts, 3, Convex, CoordModePrevious);
}
editing = False;
blackbox->setNoFocus(False);
- if (blackbox->getFocusedWindow()) {
+ if (blackbox->getFocusedWindow())
blackbox->getFocusedWindow()->setInputFocus();
- } else {
+ else
blackbox->setFocusedWindow(0);
- }
-
- Workspace *wkspc = screen->getCurrentWorkspace();
- wkspc->setName(new_workspace_name);
- wkspc->getMenu()->hide();
- screen->getWorkspacemenu()->changeItemLabel(wkspc->getID() + 2,
- wkspc->getName());
- screen->getWorkspacemenu()->update();
+ // the toolbar will be reconfigured when the change to the workspace name
+ // gets caught in the PropertyNotify event handler
+ screen->getCurrentWorkspace()->setName(new_workspace_name);
new_workspace_name.erase();
new_name_pos = 0;
else
XSetWindowBackgroundPixmap(display, frame.workspace_label,
frame.wlabel);
- reconfigure();
} else if (! (ks == XK_Shift_L || ks == XK_Shift_R ||
ks == XK_Control_L || ks == XK_Control_R ||
ks == XK_Caps_Lock || ks == XK_Shift_Lock ||