1
0
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:
id
2000-01-11 23:15:51 +00:00
parent c6bc1227de
commit 808d4e7df0
7 changed files with 31 additions and 17 deletions

View File

@@ -311,7 +311,9 @@ typedef struct WPreferences {
same workspace as parent */ same workspace as parent */
signed char title_justification; /* titlebar text alignment */ 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; char multi_byte_text;
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS

View File

@@ -558,8 +558,14 @@ WDefaultEntry optionList[] = {
{"WindowTitleFont", DEF_TITLE_FONT, NULL, {"WindowTitleFont", DEF_TITLE_FONT, NULL,
NULL, getFont, setWinTitleFont, NULL, getFont, setWinTitleFont,
}, },
{"WindowTitleClearance", DEF_TITLE_CLEARANCE, NULL, {"WindowTitleExtendSpace", DEF_WINDOW_TITLE_EXTEND_SPACE, NULL,
&wPreferences.title_clearance, getInt, setClearance &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, {"MenuTitleFont", DEF_MENU_TITLE_FONT, NULL,
NULL, getFont, setMenuTitleFont NULL, getFont, setMenuTitleFont
@@ -2414,7 +2420,7 @@ setJustify(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo)
static int static int
setClearance(WScreen *scr, WDefaultEntry *entry, void *bar, void *foo) 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 static int

View File

@@ -63,7 +63,7 @@ static void updateTitlebar(WFrameWindow *fwin);
WFrameWindow* WFrameWindow*
wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y, 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, WTexture **title_texture, WTexture **resize_texture,
unsigned long *color, unsigned long *color,
#ifdef DRAWSTRING_PLUGIN #ifdef DRAWSTRING_PLUGIN
@@ -83,6 +83,7 @@ wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
fwin->title_texture = title_texture; fwin->title_texture = title_texture;
fwin->resizebar_texture = resize_texture; fwin->resizebar_texture = resize_texture;
fwin->title_pixel = color; fwin->title_pixel = color;
fwin->title_clearance = clearance;
#ifdef DRAWSTRING_PLUGIN #ifdef DRAWSTRING_PLUGIN
fwin->drawstring_proc_offset = function_offset; fwin->drawstring_proc_offset = function_offset;
#endif #endif
@@ -136,7 +137,7 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
height = fwin->core->height - fwin->top_width - fwin->bottom_width; height = fwin->core->height - fwin->top_width - fwin->bottom_width;
if (flags & WFF_TITLEBAR) 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 else
theight = 0; theight = 0;
@@ -470,7 +471,7 @@ updateTitlebar(WFrameWindow *fwin)
int x, w; int x, w;
int theight; 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; x = 0;
w = fwin->core->width + 1; w = fwin->core->width + 1;
@@ -1081,16 +1082,16 @@ wFrameWindowPaint(WFrameWindow *fwin)
proc.drawString(scr->drawstring_func[fwin->flags.state proc.drawString(scr->drawstring_func[fwin->flags.state
+ fwin->drawstring_proc_offset]->arg, + fwin->drawstring_proc_offset]->arg,
fwin->titlebar->window, *fwin->title_gc, 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); fwin->titlebar->width, fwin->top_width, title, titlelen);
} else { } else {
WMDrawString(scr->wmscreen, fwin->titlebar->window, 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); title, titlelen);
} }
#else #else
WMDrawString(scr->wmscreen, fwin->titlebar->window, 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); title, titlelen);
#endif /* DRAWSTRING_PLUGIN */ #endif /* DRAWSTRING_PLUGIN */

View File

@@ -58,6 +58,7 @@ typedef struct WFrameWindow {
short workspace; /* workspace that the window occupies */ short workspace; /* workspace that the window occupies */
short top_width; short top_width;
int *title_clearance;
short bottom_width; short bottom_width;
short resizebar_corner_width; short resizebar_corner_width;
@@ -156,7 +157,7 @@ typedef struct WFrameWindow {
WFrameWindow* WFrameWindow*
wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y, 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 **title_texture,
union WTexture **resize_texture, union WTexture **resize_texture,
unsigned long *color, unsigned long *color,

View File

@@ -170,7 +170,7 @@ wMenuCreate(WScreen *screen, char *title, int main_menu)
menu->flags.titled = 1; menu->flags.titled = 1;
} }
menu->frame = 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_texture, NULL,
screen->menu_title_pixel, screen->menu_title_pixel,
#ifdef DRAWSTRING_PLUGIN #ifdef DRAWSTRING_PLUGIN
@@ -551,7 +551,7 @@ wMenuRealize(WMenu *menu)
twidth = 0; twidth = 0;
theight = 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; menu->entry_height = eheight;
mrwidth = 0; mrwidth = 0;
mwidth = 0; mwidth = 0;
@@ -784,7 +784,7 @@ paintEntry(WMenu *menu, int index, int selected)
x += MENU_INDICATOR_SPACE + 2; x += MENU_INDICATOR_SPACE + 2;
WMDrawString(scr->wmscreen, win, textGC, scr->menu_entry_font, 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) { if (entry->cascade>=0) {
/* draw the cascade indicator */ /* draw the cascade indicator */

View File

@@ -315,7 +315,9 @@
#define DEF_FRAME_THICKNESS 1 /* linewidth of the move/resize frame */ #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 #define DEF_XPM_CLOSENESS 40000

View File

@@ -913,7 +913,8 @@ wManageWindow(WScreen *scr, Window window)
foo |= WFF_RESIZEBAR; foo |= WFF_RESIZEBAR;
wwin->frame = wFrameWindowCreate(scr, window_level, 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->window_title_texture,
scr->resizebar_texture, scr->resizebar_texture,
scr->window_title_pixel, scr->window_title_pixel,
@@ -1278,7 +1279,8 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
wwin->frame = wFrameWindowCreate(scr, WMFloatingLevel, wwin->frame = wFrameWindowCreate(scr, WMFloatingLevel,
wwin->frame_x, wwin->frame_y, wwin->frame_x, wwin->frame_y,
width, height, foo, width, height,
&wPreferences.window_title_clearance, foo,
scr->window_title_texture, scr->window_title_texture,
scr->resizebar_texture, scr->resizebar_texture,
scr->window_title_pixel, scr->window_title_pixel,