mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
change Clearance to ExtendSpace. Also add ExtendSpace option for menu
title and menu text..
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user