mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 14:08:06 +01:00
clearance for text on titlebar.
This commit is contained in:
@@ -311,6 +311,8 @@ 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;
|
||||||
|
|
||||||
char multi_byte_text;
|
char multi_byte_text;
|
||||||
#ifdef KEEP_XKB_LOCK_STATUS
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
char modelock;
|
char modelock;
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ static int getRImage();
|
|||||||
|
|
||||||
/* value setting functions */
|
/* value setting functions */
|
||||||
static int setJustify();
|
static int setJustify();
|
||||||
|
static int setClearance();
|
||||||
static int setIfDockPresent();
|
static int setIfDockPresent();
|
||||||
static int setStickyIcons();
|
static int setStickyIcons();
|
||||||
/*
|
/*
|
||||||
@@ -557,6 +558,9 @@ WDefaultEntry optionList[] = {
|
|||||||
{"WindowTitleFont", DEF_TITLE_FONT, NULL,
|
{"WindowTitleFont", DEF_TITLE_FONT, NULL,
|
||||||
NULL, getFont, setWinTitleFont,
|
NULL, getFont, setWinTitleFont,
|
||||||
},
|
},
|
||||||
|
{"WindowTitleClearance", DEF_TITLE_CLEARANCE, NULL,
|
||||||
|
&wPreferences.title_clearance, getInt, setClearance
|
||||||
|
},
|
||||||
{"MenuTitleFont", DEF_MENU_TITLE_FONT, NULL,
|
{"MenuTitleFont", DEF_MENU_TITLE_FONT, NULL,
|
||||||
NULL, getFont, setMenuTitleFont
|
NULL, getFont, setMenuTitleFont
|
||||||
},
|
},
|
||||||
@@ -2407,6 +2411,11 @@ setJustify(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo)
|
|||||||
return REFRESH_WINDOW_TITLE_COLOR;
|
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
|
static int
|
||||||
setIfDockPresent(WScreen *scr, WDefaultEntry *entry, int *flag, long which)
|
setIfDockPresent(WScreen *scr, WDefaultEntry *entry, int *flag, long which)
|
||||||
|
|||||||
@@ -136,7 +136,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;
|
theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT + (wPreferences.title_clearance << 1);
|
||||||
else
|
else
|
||||||
theight = 0;
|
theight = 0;
|
||||||
|
|
||||||
@@ -470,7 +470,7 @@ updateTitlebar(WFrameWindow *fwin)
|
|||||||
int x, w;
|
int x, w;
|
||||||
int theight;
|
int theight;
|
||||||
|
|
||||||
theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT;
|
theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT + (wPreferences.title_clearance << 1);
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
w = fwin->core->width + 1;
|
w = fwin->core->width + 1;
|
||||||
@@ -1081,16 +1081,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, TITLEBAR_EXTRA_HEIGHT/2,
|
*fwin->font, x, wPreferences.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, TITLEBAR_EXTRA_HEIGHT/2,
|
*fwin->title_gc, *fwin->font, x, wPreferences.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, TITLEBAR_EXTRA_HEIGHT/2,
|
*fwin->title_gc, *fwin->font, x, wPreferences.title_clearance + TITLEBAR_EXTRA_HEIGHT/2,
|
||||||
title, titlelen);
|
title, titlelen);
|
||||||
#endif /* DRAWSTRING_PLUGIN */
|
#endif /* DRAWSTRING_PLUGIN */
|
||||||
|
|
||||||
|
|||||||
@@ -315,6 +315,8 @@
|
|||||||
|
|
||||||
#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_XPM_CLOSENESS 40000
|
#define DEF_XPM_CLOSENESS 40000
|
||||||
|
|
||||||
/* default position of application menus */
|
/* default position of application menus */
|
||||||
|
|||||||
10
src/window.c
10
src/window.c
@@ -145,7 +145,15 @@ appearanceObserver(void *self, WMNotification *notif)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (flags & WFontSettings) {
|
if (flags & WFontSettings) {
|
||||||
wWindowConfigureBorders(wwin);
|
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) {
|
if (flags & WTextureSettings) {
|
||||||
wwin->frame->flags.need_texture_remake = 1;
|
wwin->frame->flags.need_texture_remake = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user