1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-23 14:42:29 +01:00

clearance for text on titlebar.

This commit is contained in:
id
2000-01-11 07:48:11 +00:00
parent eca1fc5e9f
commit 9fe3f77559
5 changed files with 27 additions and 6 deletions

View File

@@ -311,6 +311,8 @@ typedef struct WPreferences {
same workspace as parent */
signed char title_justification; /* titlebar text alignment */
int title_clearance;
char multi_byte_text;
#ifdef KEEP_XKB_LOCK_STATUS
char modelock;

View File

@@ -141,6 +141,7 @@ static int getRImage();
/* value setting functions */
static int setJustify();
static int setClearance();
static int setIfDockPresent();
static int setStickyIcons();
/*
@@ -557,6 +558,9 @@ WDefaultEntry optionList[] = {
{"WindowTitleFont", DEF_TITLE_FONT, NULL,
NULL, getFont, setWinTitleFont,
},
{"WindowTitleClearance", DEF_TITLE_CLEARANCE, NULL,
&wPreferences.title_clearance, getInt, setClearance
},
{"MenuTitleFont", DEF_MENU_TITLE_FONT, NULL,
NULL, getFont, setMenuTitleFont
},
@@ -2407,6 +2411,11 @@ setJustify(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo)
return REFRESH_WINDOW_TITLE_COLOR;
}
static int
setClearance(WScreen *scr, WDefaultEntry *entry, void *bar, void *foo)
{
return REFRESH_WINDOW_FONT|REFRESH_BUTTON_IMAGES|REFRESH_MENU_TITLE_FONT;
}
static int
setIfDockPresent(WScreen *scr, WDefaultEntry *entry, int *flag, long which)

View File

@@ -136,7 +136,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;
theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT + (wPreferences.title_clearance << 1);
else
theight = 0;
@@ -470,7 +470,7 @@ updateTitlebar(WFrameWindow *fwin)
int x, w;
int theight;
theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT;
theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT + (wPreferences.title_clearance << 1);
x = 0;
w = fwin->core->width + 1;
@@ -1081,16 +1081,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, TITLEBAR_EXTRA_HEIGHT/2,
*fwin->font, x, wPreferences.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, TITLEBAR_EXTRA_HEIGHT/2,
*fwin->title_gc, *fwin->font, x, wPreferences.title_clearance + TITLEBAR_EXTRA_HEIGHT/2,
title, titlelen);
}
#else
WMDrawString(scr->wmscreen, fwin->titlebar->window,
*fwin->title_gc, *fwin->font, x, TITLEBAR_EXTRA_HEIGHT/2,
*fwin->title_gc, *fwin->font, x, wPreferences.title_clearance + TITLEBAR_EXTRA_HEIGHT/2,
title, titlelen);
#endif /* DRAWSTRING_PLUGIN */

View File

@@ -315,6 +315,8 @@
#define DEF_FRAME_THICKNESS 1 /* linewidth of the move/resize frame */
#define DEF_TITLE_CLEARANCE 0
#define DEF_XPM_CLOSENESS 40000
/* default position of application menus */

View File

@@ -146,6 +146,14 @@ appearanceObserver(void *self, WMNotification *notif)
if (flags & WFontSettings) {
wWindowConfigureBorders(wwin);
if(wwin->flags.shaded) {
wFrameWindowResize(wwin->frame, wwin->frame->core->width,
wwin->frame->top_width - 1);
wwin->client.y = wwin->frame_y - wwin->client.height
+ wwin->frame->top_width;
wWindowSynthConfigureNotify(wwin);
}
}
if (flags & WTextureSettings) {
wwin->frame->flags.need_texture_remake = 1;