From d1068c0a60ec66929096fbf1aa23d146a191cc4a Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Tue, 24 Jul 2007 01:48:34 +0200 Subject: [PATCH] Various style related changes. This includes: Not forcing an even label_height Changing the cursor to BUSY (from BUSYPOINTER) Making the label area in the dirfocus popup different No menu item padding Nice blue colors for the focus cycle indicator Not making shadows increase text boundaries --- openbox/focus_cycle_indicator.c | 4 ++-- openbox/menuframe.c | 4 +++- openbox/popup.c | 16 +++++++++++----- openbox/screen.c | 2 +- render/font.c | 6 +++--- render/theme.c | 1 - 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/openbox/focus_cycle_indicator.c b/openbox/focus_cycle_indicator.c index 79071314..0318069b 100644 --- a/openbox/focus_cycle_indicator.c +++ b/openbox/focus_cycle_indicator.c @@ -80,13 +80,13 @@ void focus_cycle_indicator_startup(gboolean reconfig) stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.right)); stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.bottom)); - color_white = RrColorNew(ob_rr_inst, 0xff, 0xff, 0xff); + color_white = RrColorNew(ob_rr_inst, 0x00, 0x00, 0xff); a_focus_indicator = RrAppearanceNew(ob_rr_inst, 4); a_focus_indicator->surface.grad = RR_SURFACE_SOLID; a_focus_indicator->surface.relief = RR_RELIEF_FLAT; a_focus_indicator->surface.primary = RrColorNew(ob_rr_inst, - 0, 0, 0); + 0xA6, 0xCA, 0xF4); a_focus_indicator->texture[0].type = RR_TEXTURE_LINE_ART; a_focus_indicator->texture[0].data.lineart.color = color_white; a_focus_indicator->texture[1].type = RR_TEXTURE_LINE_ART; diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 2c666e3f..9ab94ff8 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -28,7 +28,7 @@ #include "config.h" #include "render/theme.h" -#define PADDING 2 +#define PADDING 0 #define SEPARATOR_HEIGHT 3 #define MAX_MENU_WIDTH 400 @@ -753,6 +753,8 @@ void menu_frame_render(ObMenuFrame *self) h += th; } + w += 20; + /* if the last entry is a labeled separator, then make its border overlap with the menu's outside border */ it = g_list_last(self->entries); diff --git a/openbox/popup.c b/openbox/popup.c index d49148ff..1be0e1b6 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -180,9 +180,15 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text) /* get the height, which is also used for the icon width */ emptyy = t + b + ob_rr_theme->paddingy * 2; - if (self->h) - texth = self->h - emptyy; - h = texth * self->iconhm + emptyy; + if (self->hasicon) { + if (self->h) + h = self->h - emptyy; + h = h * self->iconhm + emptyy; + } else { + if (self->h) + texth = self->h - emptyy; + h = texth * self->iconhm + emptyy; + } if (self->textw) textw = self->textw; @@ -191,8 +197,8 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text) emptyx = l + r + ob_rr_theme->paddingx * 2; if (self->hasicon) { - iconw = texth * self->iconwm; - iconh = texth * self->iconhm; + iconw = h * self->iconwm; + iconh = h * self->iconhm; textx += iconw + ob_rr_theme->paddingx; if (textw) emptyx += ob_rr_theme->paddingx; /* between the icon and text */ diff --git a/openbox/screen.c b/openbox/screen.c index 93ec57f5..fcfaac3f 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -1571,7 +1571,7 @@ void screen_set_root_cursor() { if (sn_app_starting()) XDefineCursor(ob_display, RootWindow(ob_display, ob_screen), - ob_cursor(OB_CURSOR_BUSYPOINTER)); + ob_cursor(OB_CURSOR_BUSY)); else XDefineCursor(ob_display, RootWindow(ob_display, ob_screen), ob_cursor(OB_CURSOR_POINTER)); diff --git a/render/font.c b/render/font.c index 8d389d8b..0aa89dbe 100644 --- a/render/font.c +++ b/render/font.c @@ -158,8 +158,8 @@ static void font_measure_full(const RrFont *f, const gchar *str, rect.width = (rect.width + PANGO_SCALE - 1) / PANGO_SCALE; rect.height = (rect.height + PANGO_SCALE - 1) / PANGO_SCALE; #endif - *x = rect.width + ABS(shadow_x) + 4 /* we put a 2 px edge on each side */; - *y = rect.height + ABS(shadow_y); + *x = rect.width + /* ABS(shadow_x) +*/ 4 /* we put a 2 px edge on each side */; + *y = rect.height /*+ ABS(shadow_y) */; } RrSize *RrFontMeasureString(const RrFont *f, const gchar *str, @@ -173,7 +173,7 @@ RrSize *RrFontMeasureString(const RrFont *f, const gchar *str, gint RrFontHeight(const RrFont *f, gint shadow_y) { - return (f->ascent + f->descent) / PANGO_SCALE + ABS(shadow_y); + return (f->ascent + f->descent) / PANGO_SCALE + 0-1;//ABS(shadow_y); } static inline int font_calculate_baseline(RrFont *f, gint height) diff --git a/render/theme.c b/render/theme.c index a624ea9d..9b5190dd 100644 --- a/render/theme.c +++ b/render/theme.c @@ -1367,7 +1367,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, RrMargins(theme->a_focused_label, &fl, &ft, &fr, &fb); RrMargins(theme->a_unfocused_label, &ul, &ut, &ur, &ub); theme->label_height = theme->win_font_height + MAX(ft + fb, ut + ub); - theme->label_height += theme->label_height % 2; /* this would be nice I think, since padding.width can now be 0, but it breaks frame.c horribly and I don't feel like fixing that -- 2.34.1