mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Renamed "apercu" to "minipreview" in the source code
To be consistent, all place where the not-properly-written "apercu" was used in the source code (of wmaker and WPrefs) it has been replaced by an appropriate "minipreview" or similar, to be in line with the new name suggested by Yuri Tarasievich. This new name is better understood by contributors who speak usual english, but not this word which comes From french but is sparsely understood by british people. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
35fe34ac85
commit
67b4302ef8
@@ -84,7 +84,7 @@ typedef struct _Panel {
|
|||||||
WMFrame *frame;
|
WMFrame *frame;
|
||||||
WMSlider *slider;
|
WMSlider *slider;
|
||||||
WMLabel *label;
|
WMLabel *label;
|
||||||
} apercu;
|
} minipreview;
|
||||||
|
|
||||||
WMFrame *sizeF;
|
WMFrame *sizeF;
|
||||||
WMPopUpButton *sizeP;
|
WMPopUpButton *sizeP;
|
||||||
@@ -98,9 +98,9 @@ typedef struct _Panel {
|
|||||||
* We set the slider min to taht number minus one, because when set to this
|
* We set the slider min to taht number minus one, because when set to this
|
||||||
* value WPrefs will consider that the user wants the feature turned off.
|
* value WPrefs will consider that the user wants the feature turned off.
|
||||||
*/
|
*/
|
||||||
static const int apercu_minimum_size = 2 * 24 - 1;
|
static const int minipreview_minimum_size = 2 * 24 - 1;
|
||||||
|
|
||||||
static const int apercu_maximum_size = 512; /* Arbitrary limit for the slider */
|
static const int minipreview_maximum_size = 512; /* Arbitrary limit for the slider */
|
||||||
|
|
||||||
#define ICON_FILE "iconprefs"
|
#define ICON_FILE "iconprefs"
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ static void showIconLayout(WMWidget * widget, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void apercu_slider_changed(WMWidget *w, void *data)
|
static void minipreview_slider_changed(WMWidget *w, void *data)
|
||||||
{
|
{
|
||||||
_Panel *panel = (_Panel *) data;
|
_Panel *panel = (_Panel *) data;
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
@@ -151,17 +151,17 @@ static void apercu_slider_changed(WMWidget *w, void *data)
|
|||||||
/* Parameter is not used, but tell the compiler that it is ok */
|
/* Parameter is not used, but tell the compiler that it is ok */
|
||||||
(void) w;
|
(void) w;
|
||||||
|
|
||||||
value = WMGetSliderValue(panel->apercu.slider);
|
value = WMGetSliderValue(panel->minipreview.slider);
|
||||||
|
|
||||||
/* Round the value to a multiple of 8 because it makes the displayed value look better */
|
/* Round the value to a multiple of 8 because it makes the displayed value look better */
|
||||||
value &= ~7;
|
value &= ~7;
|
||||||
|
|
||||||
if (value <= apercu_minimum_size)
|
if (value <= minipreview_minimum_size)
|
||||||
sprintf(buffer, _("OFF"));
|
sprintf(buffer, _("OFF"));
|
||||||
else
|
else
|
||||||
sprintf(buffer, "%i", value);
|
sprintf(buffer, "%i", value);
|
||||||
|
|
||||||
WMSetLabelText(panel->apercu.label, buffer);
|
WMSetLabelText(panel->minipreview.label, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void showData(_Panel * panel)
|
static void showData(_Panel * panel)
|
||||||
@@ -201,13 +201,13 @@ static void showData(_Panel * panel)
|
|||||||
b = GetBoolForKey("MiniwindowApercuBalloons");
|
b = GetBoolForKey("MiniwindowApercuBalloons");
|
||||||
if (b) {
|
if (b) {
|
||||||
i = GetIntegerForKey("ApercuSize");
|
i = GetIntegerForKey("ApercuSize");
|
||||||
if (i <= apercu_minimum_size)
|
if (i <= minipreview_minimum_size)
|
||||||
i = apercu_minimum_size;
|
i = minipreview_minimum_size;
|
||||||
} else {
|
} else {
|
||||||
i = apercu_minimum_size;
|
i = minipreview_minimum_size;
|
||||||
}
|
}
|
||||||
WMSetSliderValue(panel->apercu.slider, i);
|
WMSetSliderValue(panel->minipreview.slider, i);
|
||||||
apercu_slider_changed(panel->apercu.slider, panel);
|
minipreview_slider_changed(panel->minipreview.slider, panel);
|
||||||
|
|
||||||
/* Animation */
|
/* Animation */
|
||||||
str = GetStringForKey("IconificationStyle");
|
str = GetStringForKey("IconificationStyle");
|
||||||
@@ -340,28 +340,28 @@ static void createPanel(Panel * p)
|
|||||||
WMMapSubwidgets(panel->sizeF);
|
WMMapSubwidgets(panel->sizeF);
|
||||||
|
|
||||||
/***************** Mini-Previews ****************/
|
/***************** Mini-Previews ****************/
|
||||||
panel->apercu.frame = WMCreateFrame(panel->box);
|
panel->minipreview.frame = WMCreateFrame(panel->box);
|
||||||
WMResizeWidget(panel->apercu.frame, 156, 52);
|
WMResizeWidget(panel->minipreview.frame, 156, 52);
|
||||||
WMMoveWidget(panel->apercu.frame, 124, 168);
|
WMMoveWidget(panel->minipreview.frame, 124, 168);
|
||||||
WMSetFrameTitle(panel->apercu.frame, _("Mini-Previews for Icons"));
|
WMSetFrameTitle(panel->minipreview.frame, _("Mini-Previews for Icons"));
|
||||||
|
|
||||||
WMSetBalloonTextForView(_("The Mini-Preview provides a small view of the content of the\n"
|
WMSetBalloonTextForView(_("The Mini-Preview provides a small view of the content of the\n"
|
||||||
"window when the mouse is placed over the icon."),
|
"window when the mouse is placed over the icon."),
|
||||||
WMWidgetView(panel->apercu.frame));
|
WMWidgetView(panel->minipreview.frame));
|
||||||
|
|
||||||
panel->apercu.slider = WMCreateSlider(panel->apercu.frame);
|
panel->minipreview.slider = WMCreateSlider(panel->minipreview.frame);
|
||||||
WMResizeWidget(panel->apercu.slider, 109, 15);
|
WMResizeWidget(panel->minipreview.slider, 109, 15);
|
||||||
WMMoveWidget(panel->apercu.slider, 11, 23);
|
WMMoveWidget(panel->minipreview.slider, 11, 23);
|
||||||
WMSetSliderMinValue(panel->apercu.slider, apercu_minimum_size);
|
WMSetSliderMinValue(panel->minipreview.slider, minipreview_minimum_size);
|
||||||
WMSetSliderMaxValue(panel->apercu.slider, apercu_maximum_size);
|
WMSetSliderMaxValue(panel->minipreview.slider, minipreview_maximum_size);
|
||||||
WMSetSliderAction(panel->apercu.slider, apercu_slider_changed, panel);
|
WMSetSliderAction(panel->minipreview.slider, minipreview_slider_changed, panel);
|
||||||
|
|
||||||
panel->apercu.label = WMCreateLabel(panel->apercu.frame);
|
panel->minipreview.label = WMCreateLabel(panel->minipreview.frame);
|
||||||
WMResizeWidget(panel->apercu.label, 33, 15);
|
WMResizeWidget(panel->minipreview.label, 33, 15);
|
||||||
WMMoveWidget(panel->apercu.label, 120, 23);
|
WMMoveWidget(panel->minipreview.label, 120, 23);
|
||||||
WMSetLabelText(panel->apercu.label, _("OFF"));
|
WMSetLabelText(panel->minipreview.label, _("OFF"));
|
||||||
|
|
||||||
WMMapSubwidgets(panel->apercu.frame);
|
WMMapSubwidgets(panel->minipreview.frame);
|
||||||
|
|
||||||
/***************** Animation ****************/
|
/***************** Animation ****************/
|
||||||
panel->animF = WMCreateFrame(panel->box);
|
panel->animF = WMCreateFrame(panel->box);
|
||||||
@@ -429,12 +429,12 @@ static void storeData(_Panel * panel)
|
|||||||
|
|
||||||
SetStringForKey(icon_position_dbvalue[panel->iconPos], "IconPosition");
|
SetStringForKey(icon_position_dbvalue[panel->iconPos], "IconPosition");
|
||||||
|
|
||||||
i = WMGetSliderValue(panel->apercu.slider);
|
i = WMGetSliderValue(panel->minipreview.slider);
|
||||||
if (i <= apercu_minimum_size) {
|
if (i <= minipreview_minimum_size) {
|
||||||
SetBoolForKey(False, "MiniwindowApercuBalloons");
|
SetBoolForKey(False, "MiniwindowApercuBalloons");
|
||||||
} else {
|
} else {
|
||||||
SetBoolForKey(True, "MiniwindowApercuBalloons");
|
SetBoolForKey(True, "MiniwindowApercuBalloons");
|
||||||
if (i < apercu_maximum_size) {
|
if (i < minipreview_maximum_size) {
|
||||||
/*
|
/*
|
||||||
* If the value is bigger, it means it was edited by the user manually
|
* If the value is bigger, it means it was edited by the user manually
|
||||||
* so we keep as-is. Otherwise, we round it to a multiple of 8 like it
|
* so we keep as-is. Otherwise, we round it to a multiple of 8 like it
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ extern struct WPreferences {
|
|||||||
/* balloon text */
|
/* balloon text */
|
||||||
char window_balloon;
|
char window_balloon;
|
||||||
char miniwin_title_balloon;
|
char miniwin_title_balloon;
|
||||||
char miniwin_apercu_balloon;
|
char miniwin_preview_balloon;
|
||||||
char appicon_balloon;
|
char appicon_balloon;
|
||||||
char help_balloon;
|
char help_balloon;
|
||||||
|
|
||||||
@@ -446,7 +446,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 */
|
||||||
int apercu_size; /* Size of Mini-Previews in pixels */
|
int minipreview_size; /* Size of Mini-Previews in pixels */
|
||||||
|
|
||||||
/* 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 */
|
||||||
|
|||||||
@@ -1124,7 +1124,7 @@ void wIconifyWindow(WWindow *wwin)
|
|||||||
|
|
||||||
/* extract the window screenshot everytime, as the option can be enable anytime */
|
/* extract the window screenshot everytime, as the option can be enable anytime */
|
||||||
if (wwin->client_win && wwin->flags.mapped) {
|
if (wwin->client_win && wwin->flags.mapped) {
|
||||||
RImage *apercu;
|
RImage *mini_preview;
|
||||||
XImage *pimg;
|
XImage *pimg;
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
int x, y;
|
int x, y;
|
||||||
@@ -1144,12 +1144,12 @@ void wIconifyWindow(WWindow *wwin)
|
|||||||
|
|
||||||
pimg = XGetImage(dpy, wwin->client_win, 0, 0, w, h, AllPlanes, ZPixmap);
|
pimg = XGetImage(dpy, wwin->client_win, 0, 0, w, h, AllPlanes, ZPixmap);
|
||||||
if (pimg) {
|
if (pimg) {
|
||||||
apercu = RCreateImageFromXImage(wwin->screen_ptr->rcontext, pimg, NULL);
|
mini_preview = RCreateImageFromXImage(wwin->screen_ptr->rcontext, pimg, NULL);
|
||||||
XDestroyImage(pimg);
|
XDestroyImage(pimg);
|
||||||
|
|
||||||
if (apercu) {
|
if (mini_preview) {
|
||||||
set_icon_apercu(wwin->icon, apercu);
|
set_icon_minipreview(wwin->icon, mini_preview);
|
||||||
RReleaseImage(apercu);
|
RReleaseImage(mini_preview);
|
||||||
} else {
|
} else {
|
||||||
wwarning(_("window mini-preview creation failed"));
|
wwarning(_("window mini-preview creation failed"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ typedef struct _WBalloon {
|
|||||||
WMHandlerID timer;
|
WMHandlerID timer;
|
||||||
|
|
||||||
Pixmap contents;
|
Pixmap contents;
|
||||||
Pixmap apercu;
|
Pixmap mini_preview;
|
||||||
|
|
||||||
char mapped;
|
char mapped;
|
||||||
char ignoreTimer;
|
char ignoreTimer;
|
||||||
@@ -371,7 +371,7 @@ static void showText(WScreen *scr, int x, int y, int h, int w, const char *text)
|
|||||||
}
|
}
|
||||||
#endif /* !SHAPED_BALLOON */
|
#endif /* !SHAPED_BALLOON */
|
||||||
|
|
||||||
static void showApercu(WScreen *scr, int x, int y, const char *title, Pixmap apercu)
|
static void show_minipreview(WScreen *scr, int x, int y, const char *title, Pixmap mini_preview)
|
||||||
{
|
{
|
||||||
Pixmap pixmap;
|
Pixmap pixmap;
|
||||||
WMFont *font = scr->info_text_font;
|
WMFont *font = scr->info_text_font;
|
||||||
@@ -382,11 +382,11 @@ static void showApercu(WScreen *scr, int x, int y, const char *title, Pixmap ape
|
|||||||
if (scr->balloon->contents)
|
if (scr->balloon->contents)
|
||||||
XFreePixmap(dpy, scr->balloon->contents);
|
XFreePixmap(dpy, scr->balloon->contents);
|
||||||
|
|
||||||
width = wPreferences.apercu_size;
|
width = wPreferences.minipreview_size;
|
||||||
height = wPreferences.apercu_size;
|
height = wPreferences.minipreview_size;
|
||||||
|
|
||||||
if (wPreferences.miniwin_title_balloon) {
|
if (wPreferences.miniwin_title_balloon) {
|
||||||
shortenTitle = ShrinkString(font, title, width - APERCU_BORDER * 2);
|
shortenTitle = ShrinkString(font, title, width - MINIPREVIEW_BORDER * 2);
|
||||||
titleHeight = countLines(shortenTitle) * WMFontHeight(font) + 4;
|
titleHeight = countLines(shortenTitle) * WMFontHeight(font) + 4;
|
||||||
height += titleHeight;
|
height += titleHeight;
|
||||||
} else {
|
} else {
|
||||||
@@ -417,14 +417,14 @@ static void showApercu(WScreen *scr, int x, int y, const char *title, Pixmap ape
|
|||||||
|
|
||||||
if (shortenTitle != NULL) {
|
if (shortenTitle != NULL) {
|
||||||
drawMultiLineString(scr->wmscreen, pixmap, scr->window_title_color[0], font,
|
drawMultiLineString(scr->wmscreen, pixmap, scr->window_title_color[0], font,
|
||||||
APERCU_BORDER, APERCU_BORDER, shortenTitle, strlen(shortenTitle));
|
MINIPREVIEW_BORDER, MINIPREVIEW_BORDER, shortenTitle, strlen(shortenTitle));
|
||||||
wfree(shortenTitle);
|
wfree(shortenTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
XCopyArea(dpy, apercu, pixmap, scr->draw_gc,
|
XCopyArea(dpy, mini_preview, pixmap, scr->draw_gc,
|
||||||
0, 0, (wPreferences.apercu_size - 1 - APERCU_BORDER * 2),
|
0, 0, (wPreferences.minipreview_size - 1 - MINIPREVIEW_BORDER * 2),
|
||||||
(wPreferences.apercu_size - 1 - APERCU_BORDER * 2),
|
(wPreferences.minipreview_size - 1 - MINIPREVIEW_BORDER * 2),
|
||||||
APERCU_BORDER, APERCU_BORDER + titleHeight);
|
MINIPREVIEW_BORDER, MINIPREVIEW_BORDER + titleHeight);
|
||||||
|
|
||||||
#ifdef SHAPED_BALLOON
|
#ifdef SHAPED_BALLOON
|
||||||
XShapeCombineMask(dpy, scr->balloon->window, ShapeBounding, 0, 0, None, ShapeSet);
|
XShapeCombineMask(dpy, scr->balloon->window, ShapeBounding, 0, 0, None, ShapeSet);
|
||||||
@@ -457,9 +457,9 @@ static void showBalloon(WScreen *scr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wPreferences.miniwin_apercu_balloon && scr->balloon->apercu != None)
|
if (wPreferences.miniwin_preview_balloon && scr->balloon->mini_preview != None)
|
||||||
/* used to display either the mini-preview alone or the mini-preview with the title */
|
/* used to display either the mini-preview alone or the mini-preview with the title */
|
||||||
showApercu(scr, x, y, scr->balloon->text, scr->balloon->apercu);
|
show_minipreview(scr, x, y, scr->balloon->text, scr->balloon->mini_preview);
|
||||||
else
|
else
|
||||||
showText(scr, x, y, scr->balloon->h, w, scr->balloon->text);
|
showText(scr, x, y, scr->balloon->h, w, scr->balloon->text);
|
||||||
}
|
}
|
||||||
@@ -492,7 +492,7 @@ static void miniwindowBalloon(WObjDescriptor *object)
|
|||||||
}
|
}
|
||||||
scr->balloon->h = icon->core->height;
|
scr->balloon->h = icon->core->height;
|
||||||
scr->balloon->text = wstrdup(icon->icon_name);
|
scr->balloon->text = wstrdup(icon->icon_name);
|
||||||
scr->balloon->apercu = icon->apercu;
|
scr->balloon->mini_preview = icon->mini_preview;
|
||||||
scr->balloon->objectWindow = icon->core->window;
|
scr->balloon->objectWindow = icon->core->window;
|
||||||
|
|
||||||
if ((scr->balloon->prevType == object->parent_type || scr->balloon->prevType == WCLASS_APPICON)
|
if ((scr->balloon->prevType == object->parent_type || scr->balloon->prevType == WCLASS_APPICON)
|
||||||
@@ -617,7 +617,7 @@ void wBalloonEnteredObject(WScreen *scr, WObjDescriptor *object)
|
|||||||
wfree(scr->balloon->text);
|
wfree(scr->balloon->text);
|
||||||
scr->balloon->text = NULL;
|
scr->balloon->text = NULL;
|
||||||
|
|
||||||
scr->balloon->apercu = None;
|
scr->balloon->mini_preview = None;
|
||||||
|
|
||||||
if (!object) {
|
if (!object) {
|
||||||
wBalloonHide(scr);
|
wBalloonHide(scr);
|
||||||
@@ -635,7 +635,7 @@ void wBalloonEnteredObject(WScreen *scr, WObjDescriptor *object)
|
|||||||
appiconBalloon(object);
|
appiconBalloon(object);
|
||||||
break;
|
break;
|
||||||
case WCLASS_MINIWINDOW:
|
case WCLASS_MINIWINDOW:
|
||||||
if (wPreferences.miniwin_title_balloon || wPreferences.miniwin_apercu_balloon)
|
if (wPreferences.miniwin_title_balloon || wPreferences.miniwin_preview_balloon)
|
||||||
miniwindowBalloon(object);
|
miniwindowBalloon(object);
|
||||||
break;
|
break;
|
||||||
case WCLASS_APPICON:
|
case WCLASS_APPICON:
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ WDefaultEntry optionList[] = {
|
|||||||
{"MiniwindowTitleBalloons", "NO", NULL,
|
{"MiniwindowTitleBalloons", "NO", NULL,
|
||||||
&wPreferences.miniwin_title_balloon, getBool, NULL, NULL, NULL},
|
&wPreferences.miniwin_title_balloon, getBool, NULL, NULL, NULL},
|
||||||
{"MiniwindowApercuBalloons", "NO", NULL,
|
{"MiniwindowApercuBalloons", "NO", NULL,
|
||||||
&wPreferences.miniwin_apercu_balloon, getBool, NULL, NULL, NULL},
|
&wPreferences.miniwin_preview_balloon, getBool, NULL, NULL, NULL},
|
||||||
{"AppIconBalloons", "NO", NULL,
|
{"AppIconBalloons", "NO", NULL,
|
||||||
&wPreferences.appicon_balloon, getBool, NULL, NULL, NULL},
|
&wPreferences.appicon_balloon, getBool, NULL, NULL, NULL},
|
||||||
{"HelpBalloons", "NO", NULL,
|
{"HelpBalloons", "NO", NULL,
|
||||||
@@ -506,7 +506,7 @@ WDefaultEntry optionList[] = {
|
|||||||
{"SwitchPanelOnlyOpen", "NO", NULL,
|
{"SwitchPanelOnlyOpen", "NO", NULL,
|
||||||
&wPreferences.panel_only_open, getBool, NULL, NULL, NULL},
|
&wPreferences.panel_only_open, getBool, NULL, NULL, NULL},
|
||||||
{"ApercuSize", "128", NULL,
|
{"ApercuSize", "128", NULL,
|
||||||
&wPreferences.apercu_size, getInt, NULL, NULL, NULL},
|
&wPreferences.minipreview_size, getInt, NULL, NULL, NULL},
|
||||||
|
|
||||||
/* style options */
|
/* style options */
|
||||||
|
|
||||||
@@ -1190,18 +1190,18 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Backward Compatibility:
|
* Backward Compatibility:
|
||||||
* the option 'apercu_size' used to be coded as a multiple of the icon size in v0.95.6
|
* the option 'minipreview_size' used to be coded as a multiple of the icon size in v0.95.6
|
||||||
* it is now expressed directly in pixels, but to avoid breaking user's setting we check
|
* it is now expressed directly in pixels, but to avoid breaking user's setting we check
|
||||||
* for old coding and convert it now.
|
* for old coding and convert it now.
|
||||||
* This code should probably stay for at least 2 years, you should not consider removing
|
* This code should probably stay for at least 2 years, you should not consider removing
|
||||||
* it before year 2017
|
* it before year 2017
|
||||||
*/
|
*/
|
||||||
if (wPreferences.apercu_size < 24) {
|
if (wPreferences.minipreview_size < 24) {
|
||||||
/* 24 is the minimum icon size proposed in WPref's settings */
|
/* 24 is the minimum icon size proposed in WPref's settings */
|
||||||
wPreferences.apercu_size *= wPreferences.icon_size;
|
wPreferences.minipreview_size *= wPreferences.icon_size;
|
||||||
if (wPreferences.miniwin_apercu_balloon)
|
if (wPreferences.miniwin_preview_balloon)
|
||||||
wwarning(_("your ApercuSize setting is using old syntax, it is converted to %d pixels; consider running WPrefs.app to update your settings"),
|
wwarning(_("your ApercuSize setting is using old syntax, it is converted to %d pixels; consider running WPrefs.app to update your settings"),
|
||||||
wPreferences.apercu_size);
|
wPreferences.minipreview_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needs_refresh != 0 && !scr->flags.startup) {
|
if (needs_refresh != 0 && !scr->flags.startup) {
|
||||||
|
|||||||
22
src/icon.c
22
src/icon.c
@@ -225,8 +225,8 @@ void wIconDestroy(WIcon *icon)
|
|||||||
if (icon->pixmap)
|
if (icon->pixmap)
|
||||||
XFreePixmap(dpy, icon->pixmap);
|
XFreePixmap(dpy, icon->pixmap);
|
||||||
|
|
||||||
if (icon->apercu)
|
if (icon->mini_preview)
|
||||||
XFreePixmap(dpy, icon->apercu);
|
XFreePixmap(dpy, icon->mini_preview);
|
||||||
|
|
||||||
unset_icon_image(icon);
|
unset_icon_image(icon);
|
||||||
|
|
||||||
@@ -587,21 +587,21 @@ void set_icon_image_from_image(WIcon *icon, RImage *image)
|
|||||||
icon->file_image = image;
|
icon->file_image = image;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_icon_apercu(WIcon *icon, RImage *image)
|
void set_icon_minipreview(WIcon *icon, RImage *image)
|
||||||
{
|
{
|
||||||
Pixmap tmp;
|
Pixmap tmp;
|
||||||
RImage *scaled_apercu;
|
RImage *scaled_mini_preview;
|
||||||
WScreen *scr = icon->core->screen_ptr;
|
WScreen *scr = icon->core->screen_ptr;
|
||||||
|
|
||||||
scaled_apercu = RSmoothScaleImage(image, wPreferences.apercu_size - 2 * APERCU_BORDER,
|
scaled_mini_preview = RSmoothScaleImage(image, wPreferences.minipreview_size - 2 * MINIPREVIEW_BORDER,
|
||||||
wPreferences.apercu_size - 2 * APERCU_BORDER);
|
wPreferences.minipreview_size - 2 * MINIPREVIEW_BORDER);
|
||||||
|
|
||||||
if (RConvertImage(scr->rcontext, scaled_apercu, &tmp)) {
|
if (RConvertImage(scr->rcontext, scaled_mini_preview, &tmp)) {
|
||||||
if (icon->apercu != None)
|
if (icon->mini_preview != None)
|
||||||
XFreePixmap(dpy, icon->apercu);
|
XFreePixmap(dpy, icon->mini_preview);
|
||||||
icon->apercu = tmp;
|
icon->mini_preview = tmp;
|
||||||
}
|
}
|
||||||
RReleaseImage(scaled_apercu);
|
RReleaseImage(scaled_mini_preview);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wIconUpdate(WIcon *icon)
|
void wIconUpdate(WIcon *icon)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#define TILE_DRAWER 2
|
#define TILE_DRAWER 2
|
||||||
|
|
||||||
/* This is the border, in pixel, drawn around a Mini-Preview */
|
/* This is the border, in pixel, drawn around a Mini-Preview */
|
||||||
#define APERCU_BORDER 1
|
#define MINIPREVIEW_BORDER 1
|
||||||
|
|
||||||
typedef struct WIcon {
|
typedef struct WIcon {
|
||||||
WCoreWindow *core;
|
WCoreWindow *core;
|
||||||
@@ -51,7 +51,7 @@ typedef struct WIcon {
|
|||||||
unsigned int highlighted:1;
|
unsigned int highlighted:1;
|
||||||
|
|
||||||
Pixmap pixmap;
|
Pixmap pixmap;
|
||||||
Pixmap apercu;
|
Pixmap mini_preview;
|
||||||
|
|
||||||
WMHandlerID handlerID; /* timer handler ID for cycling select
|
WMHandlerID handlerID; /* timer handler ID for cycling select
|
||||||
* color */
|
* color */
|
||||||
@@ -78,6 +78,6 @@ char *get_name_for_instance_class(const char *wm_instance, const char *wm_class)
|
|||||||
|
|
||||||
void wIconSetHighlited(WIcon *icon, Bool flag);
|
void wIconSetHighlited(WIcon *icon, Bool flag);
|
||||||
void set_icon_image_from_image(WIcon *icon, RImage *image);
|
void set_icon_image_from_image(WIcon *icon, RImage *image);
|
||||||
void set_icon_apercu(WIcon *icon, RImage *image);
|
void set_icon_minipreview(WIcon *icon, RImage *image);
|
||||||
|
|
||||||
#endif /* WMICON_H_ */
|
#endif /* WMICON_H_ */
|
||||||
|
|||||||
10
src/wsmap.c
10
src/wsmap.c
@@ -73,22 +73,22 @@ void wWorkspaceMapUpdate(WScreen *scr)
|
|||||||
scr->scr_width, scr->scr_height,
|
scr->scr_width, scr->scr_height,
|
||||||
AllPlanes, ZPixmap);
|
AllPlanes, ZPixmap);
|
||||||
if (pimg) {
|
if (pimg) {
|
||||||
RImage *apercu;
|
RImage *mini_preview;
|
||||||
|
|
||||||
apercu = RCreateImageFromXImage(scr->rcontext, pimg, NULL);
|
mini_preview = RCreateImageFromXImage(scr->rcontext, pimg, NULL);
|
||||||
XDestroyImage(pimg);
|
XDestroyImage(pimg);
|
||||||
|
|
||||||
if (apercu) {
|
if (mini_preview) {
|
||||||
RImage *tmp = scr->workspaces[scr->current_workspace]->map;
|
RImage *tmp = scr->workspaces[scr->current_workspace]->map;
|
||||||
|
|
||||||
if (tmp)
|
if (tmp)
|
||||||
RReleaseImage(tmp);
|
RReleaseImage(tmp);
|
||||||
|
|
||||||
scr->workspaces[scr->current_workspace]->map =
|
scr->workspaces[scr->current_workspace]->map =
|
||||||
RSmoothScaleImage(apercu,
|
RSmoothScaleImage(mini_preview,
|
||||||
scr->scr_width / WORKSPACE_MAP_RATIO,
|
scr->scr_width / WORKSPACE_MAP_RATIO,
|
||||||
scr->scr_height / WORKSPACE_MAP_RATIO);
|
scr->scr_height / WORKSPACE_MAP_RATIO);
|
||||||
RReleaseImage(apercu);
|
RReleaseImage(mini_preview);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user