mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
apercu: Make preview size a configuration option
Since the resolution of the Retina display tends to make everything small, the default apercu preview size (twice the icon size) couldn't be used to distinguish the window contents without tiring too much my eyes. Therefore, let's make the apercu size a configurable option. You can set it through the ApercuSize variable with $ wdwrite WindowMaker ApercuSize 4 in multiples of the icon size (in this case the apercu size will be four times the icon size). The default size remains 2 (twice the icon size).
This commit is contained in:
@@ -426,6 +426,7 @@ extern struct WPreferences {
|
|||||||
char cycle_ignore_minimized; /* Ignore minimized windows when cycling */
|
char cycle_ignore_minimized; /* Ignore minimized windows when cycling */
|
||||||
char strict_windoze_cycle; /* don't close switch panel when shift is released */
|
char strict_windoze_cycle; /* don't close switch panel when shift is released */
|
||||||
char panel_only_open; /* Only open the switch panel; don't switch */
|
char panel_only_open; /* Only open the switch panel; don't switch */
|
||||||
|
char apercu_size; /* Size of apercu preview as a multiple of icon size */
|
||||||
|
|
||||||
/* All delays here are in ms. 0 means instant auto-action. */
|
/* All delays here are in ms. 0 means instant auto-action. */
|
||||||
int clip_auto_raise_delay; /* Delay after which the clip will be raised when entered */
|
int clip_auto_raise_delay; /* Delay after which the clip will be raised when entered */
|
||||||
|
|||||||
@@ -423,8 +423,8 @@ static void showApercu(WScreen *scr, int x, int y, int height, int width, char *
|
|||||||
}
|
}
|
||||||
|
|
||||||
XCopyArea(dpy, apercu, pixmap, scr->draw_gc,
|
XCopyArea(dpy, apercu, pixmap, scr->draw_gc,
|
||||||
0, 0, (wPreferences.icon_size - 1 - APERCU_BORDER) * 2,
|
0, 0, (wPreferences.icon_size - 1 - APERCU_BORDER) * wPreferences.apercu_size,
|
||||||
(wPreferences.icon_size - 1 - APERCU_BORDER) * 2,
|
(wPreferences.icon_size - 1 - APERCU_BORDER) * wPreferences.apercu_size,
|
||||||
APERCU_BORDER, APERCU_BORDER + titleHeight);
|
APERCU_BORDER, APERCU_BORDER + titleHeight);
|
||||||
|
|
||||||
#ifdef SHAPED_BALLOON
|
#ifdef SHAPED_BALLOON
|
||||||
@@ -460,7 +460,7 @@ static void showBalloon(WScreen * scr)
|
|||||||
|
|
||||||
if (wPreferences.miniwin_apercu_balloon && scr->balloon->apercu != None)
|
if (wPreferences.miniwin_apercu_balloon && scr->balloon->apercu != None)
|
||||||
/* used to display either the apercu alone or the apercu and the title */
|
/* used to display either the apercu alone or the apercu and the title */
|
||||||
showApercu(scr, x, y, (wPreferences.icon_size - 1) * 2, (wPreferences.icon_size - 1) * 2,
|
showApercu(scr, x, y, (wPreferences.icon_size - 1) * wPreferences.apercu_size, (wPreferences.icon_size - 1) * wPreferences.apercu_size,
|
||||||
scr->balloon->text, scr->balloon->apercu);
|
scr->balloon->text, scr->balloon->apercu);
|
||||||
else
|
else
|
||||||
showText(scr, x, y, scr->balloon->h, w, scr->balloon->text);
|
showText(scr, x, y, scr->balloon->h, w, scr->balloon->text);
|
||||||
|
|||||||
@@ -479,6 +479,8 @@ WDefaultEntry optionList[] = {
|
|||||||
&wPreferences.strict_windoze_cycle, getBool, NULL, NULL, NULL},
|
&wPreferences.strict_windoze_cycle, getBool, NULL, NULL, NULL},
|
||||||
{"SwitchPanelOnlyOpen", "NO", NULL,
|
{"SwitchPanelOnlyOpen", "NO", NULL,
|
||||||
&wPreferences.panel_only_open, getBool, NULL, NULL, NULL},
|
&wPreferences.panel_only_open, getBool, NULL, NULL, NULL},
|
||||||
|
{"ApercuSize", "2", NULL,
|
||||||
|
&wPreferences.apercu_size, getInt, NULL, NULL, NULL},
|
||||||
|
|
||||||
/* style options */
|
/* style options */
|
||||||
|
|
||||||
|
|||||||
@@ -593,8 +593,8 @@ void set_icon_apercu(WIcon *icon, RImage *image)
|
|||||||
RImage *scaled_apercu;
|
RImage *scaled_apercu;
|
||||||
WScreen *scr = icon->core->screen_ptr;
|
WScreen *scr = icon->core->screen_ptr;
|
||||||
|
|
||||||
scaled_apercu = RSmoothScaleImage(image, (wPreferences.icon_size - 1 - APERCU_BORDER) * 2,
|
scaled_apercu = RSmoothScaleImage(image, (wPreferences.icon_size - 1 - APERCU_BORDER) * wPreferences.apercu_size,
|
||||||
(wPreferences.icon_size - 1 - APERCU_BORDER) * 2 );
|
(wPreferences.icon_size - 1 - APERCU_BORDER) * wPreferences.apercu_size);
|
||||||
|
|
||||||
if (RConvertImage(scr->rcontext, scaled_apercu, &tmp)) {
|
if (RConvertImage(scr->rcontext, scaled_apercu, &tmp)) {
|
||||||
if (icon->apercu != None)
|
if (icon->apercu != None)
|
||||||
|
|||||||
Reference in New Issue
Block a user