diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 6fdb4c5e..f1367732 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -311,7 +311,9 @@ typedef struct WPreferences { same workspace as parent */ signed char title_justification; /* titlebar text alignment */ - int title_clearance; + int window_title_clearance; + int menu_title_clearance; + int menu_text_clearance; char multi_byte_text; #ifdef KEEP_XKB_LOCK_STATUS diff --git a/src/defaults.c b/src/defaults.c index f985422a..571145bf 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -558,8 +558,14 @@ WDefaultEntry optionList[] = { {"WindowTitleFont", DEF_TITLE_FONT, NULL, NULL, getFont, setWinTitleFont, }, - {"WindowTitleClearance", DEF_TITLE_CLEARANCE, NULL, - &wPreferences.title_clearance, getInt, setClearance + {"WindowTitleExtendSpace", DEF_WINDOW_TITLE_EXTEND_SPACE, NULL, + &wPreferences.window_title_clearance, getInt, setClearance + }, + {"MenuTitleExtendSpace", DEF_MENU_TITLE_EXTEND_SPACE, NULL, + &wPreferences.menu_title_clearance, getInt, setClearance + }, + {"MenuTextExtendSpace", DEF_MENU_TEXT_EXTEND_SPACE, NULL, + &wPreferences.menu_text_clearance, getInt, setClearance }, {"MenuTitleFont", DEF_MENU_TITLE_FONT, NULL, NULL, getFont, setMenuTitleFont @@ -2414,7 +2420,7 @@ setJustify(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo) static int setClearance(WScreen *scr, WDefaultEntry *entry, void *bar, void *foo) { - return REFRESH_WINDOW_FONT|REFRESH_BUTTON_IMAGES|REFRESH_MENU_TITLE_FONT; + return REFRESH_WINDOW_FONT|REFRESH_BUTTON_IMAGES|REFRESH_MENU_TITLE_FONT|REFRESH_MENU_FONT; } static int diff --git a/src/framewin.c b/src/framewin.c index 2c888002..7d9d0a8d 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -63,7 +63,7 @@ static void updateTitlebar(WFrameWindow *fwin); WFrameWindow* wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y, - int width, int height, int flags, + int width, int height, int *clearance, int flags, WTexture **title_texture, WTexture **resize_texture, unsigned long *color, #ifdef DRAWSTRING_PLUGIN @@ -83,6 +83,7 @@ wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y, fwin->title_texture = title_texture; fwin->resizebar_texture = resize_texture; fwin->title_pixel = color; + fwin->title_clearance = clearance; #ifdef DRAWSTRING_PLUGIN fwin->drawstring_proc_offset = function_offset; #endif @@ -136,7 +137,7 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags) height = fwin->core->height - fwin->top_width - fwin->bottom_width; if (flags & WFF_TITLEBAR) - theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT + (wPreferences.title_clearance << 1); + theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT + *fwin->title_clearance * 2; else theight = 0; @@ -470,7 +471,7 @@ updateTitlebar(WFrameWindow *fwin) int x, w; int theight; - theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT + (wPreferences.title_clearance << 1); + theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT + *fwin->title_clearance * 2; x = 0; w = fwin->core->width + 1; @@ -1081,16 +1082,16 @@ wFrameWindowPaint(WFrameWindow *fwin) proc.drawString(scr->drawstring_func[fwin->flags.state + fwin->drawstring_proc_offset]->arg, fwin->titlebar->window, *fwin->title_gc, - *fwin->font, x, wPreferences.title_clearance + TITLEBAR_EXTRA_HEIGHT/2, + *fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTRA_HEIGHT/2, fwin->titlebar->width, fwin->top_width, title, titlelen); } else { WMDrawString(scr->wmscreen, fwin->titlebar->window, - *fwin->title_gc, *fwin->font, x, wPreferences.title_clearance + TITLEBAR_EXTRA_HEIGHT/2, + *fwin->title_gc, *fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTRA_HEIGHT/2, title, titlelen); } #else WMDrawString(scr->wmscreen, fwin->titlebar->window, - *fwin->title_gc, *fwin->font, x, wPreferences.title_clearance + TITLEBAR_EXTRA_HEIGHT/2, + *fwin->title_gc, *fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTRA_HEIGHT/2, title, titlelen); #endif /* DRAWSTRING_PLUGIN */ diff --git a/src/framewin.h b/src/framewin.h index 13d86101..360af768 100644 --- a/src/framewin.h +++ b/src/framewin.h @@ -58,6 +58,7 @@ typedef struct WFrameWindow { short workspace; /* workspace that the window occupies */ short top_width; + int *title_clearance; short bottom_width; short resizebar_corner_width; @@ -156,7 +157,7 @@ typedef struct WFrameWindow { WFrameWindow* wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y, - int width, int height, int flags, + int width, int height, int *clearance, int flags, union WTexture **title_texture, union WTexture **resize_texture, unsigned long *color, diff --git a/src/menu.c b/src/menu.c index d0f8d342..7b0262c6 100644 --- a/src/menu.c +++ b/src/menu.c @@ -170,7 +170,7 @@ wMenuCreate(WScreen *screen, char *title, int main_menu) menu->flags.titled = 1; } menu->frame = - wFrameWindowCreate(screen, tmp, 8, 2, 1, 1, flags, + wFrameWindowCreate(screen, tmp, 8, 2, 1, 1, &wPreferences.menu_title_clearance, flags, screen->menu_title_texture, NULL, screen->menu_title_pixel, #ifdef DRAWSTRING_PLUGIN @@ -551,7 +551,7 @@ wMenuRealize(WMenu *menu) twidth = 0; theight = 0; } - eheight = WMFontHeight(scr->menu_entry_font) + 6; + eheight = WMFontHeight(scr->menu_entry_font) + 6 + wPreferences.menu_text_clearance * 2; menu->entry_height = eheight; mrwidth = 0; mwidth = 0; @@ -784,7 +784,7 @@ paintEntry(WMenu *menu, int index, int selected) x += MENU_INDICATOR_SPACE + 2; WMDrawString(scr->wmscreen, win, textGC, scr->menu_entry_font, - x, 3 + y, entry->text, strlen(entry->text)); + x, 3 + y + wPreferences.menu_text_clearance, entry->text, strlen(entry->text)); if (entry->cascade>=0) { /* draw the cascade indicator */ diff --git a/src/wconfig.h.in b/src/wconfig.h.in index 035ec796..39db65af 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -315,7 +315,9 @@ #define DEF_FRAME_THICKNESS 1 /* linewidth of the move/resize frame */ -#define DEF_TITLE_CLEARANCE 0 +#define DEF_WINDOW_TITLE_EXTEND_SPACE 0 +#define DEF_MENU_TITLE_EXTEND_SPACE 0 +#define DEF_MENU_TEXT_EXTEND_SPACE 0 #define DEF_XPM_CLOSENESS 40000 diff --git a/src/window.c b/src/window.c index 81d32fcd..e5d6c435 100644 --- a/src/window.c +++ b/src/window.c @@ -913,7 +913,8 @@ wManageWindow(WScreen *scr, Window window) foo |= WFF_RESIZEBAR; wwin->frame = wFrameWindowCreate(scr, window_level, - x, y, width, height, foo, + x, y, width, height, + &wPreferences.window_title_clearance, foo, scr->window_title_texture, scr->resizebar_texture, scr->window_title_pixel, @@ -1278,7 +1279,8 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner, wwin->frame = wFrameWindowCreate(scr, WMFloatingLevel, wwin->frame_x, wwin->frame_y, - width, height, foo, + width, height, + &wPreferences.window_title_clearance, foo, scr->window_title_texture, scr->resizebar_texture, scr->window_title_pixel,