mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 05:18:06 +01:00
- added standard colormap support
- made icon images scale in the same proportion as the tiles
This commit is contained in:
10
src/icon.c
10
src/icon.c
@@ -400,6 +400,15 @@ wIconValidateIconSize(WScreen *scr, RImage *icon)
|
|||||||
if (!icon)
|
if (!icon)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (wPreferences.icon_size != 64) {
|
||||||
|
w = wPreferences.icon_size * icon->width / 64;
|
||||||
|
h = wPreferences.icon_size * icon->height / 64;
|
||||||
|
|
||||||
|
tmp = RScaleImage(icon, w, h);
|
||||||
|
RDestroyImage(icon);
|
||||||
|
icon = tmp;
|
||||||
|
}
|
||||||
|
#if 0
|
||||||
if (icon->width > wPreferences.icon_size
|
if (icon->width > wPreferences.icon_size
|
||||||
|| icon->height > wPreferences.icon_size) {
|
|| icon->height > wPreferences.icon_size) {
|
||||||
if (icon->width > icon->height) {
|
if (icon->width > icon->height) {
|
||||||
@@ -413,6 +422,7 @@ wIconValidateIconSize(WScreen *scr, RImage *icon)
|
|||||||
RDestroyImage(icon);
|
RDestroyImage(icon);
|
||||||
icon = tmp;
|
icon = tmp;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -736,15 +736,19 @@ wScreenInit(int screen_number)
|
|||||||
XDefineCursor(dpy, scr->root_win, wCursor[WCUR_DEFAULT]);
|
XDefineCursor(dpy, scr->root_win, wCursor[WCUR_DEFAULT]);
|
||||||
|
|
||||||
/* screen descriptor for raster graphic library */
|
/* screen descriptor for raster graphic library */
|
||||||
rattr.flags = RC_RenderMode | RC_ColorsPerChannel;
|
rattr.flags = RC_RenderMode | RC_ColorsPerChannel | RC_StandardColormap;
|
||||||
rattr.render_mode = wPreferences.no_dithering
|
rattr.render_mode = wPreferences.no_dithering
|
||||||
? RBestMatchRendering
|
? RBestMatchRendering
|
||||||
: RDitheredRendering;
|
: RDitheredRendering;
|
||||||
|
|
||||||
|
/* if the std colormap stuff works ok, this will be ignored */
|
||||||
rattr.colors_per_channel = wPreferences.cmap_size;
|
rattr.colors_per_channel = wPreferences.cmap_size;
|
||||||
if (rattr.colors_per_channel<2)
|
if (rattr.colors_per_channel<2)
|
||||||
rattr.colors_per_channel = 2;
|
rattr.colors_per_channel = 2;
|
||||||
|
|
||||||
|
/* will only be accounted for in PseudoColor */
|
||||||
|
rattr.standard_colormap_mode = RCreateStdColormap;
|
||||||
|
|
||||||
if (wVisualID>=0) {
|
if (wVisualID>=0) {
|
||||||
rattr.flags |= RC_VisualID;
|
rattr.flags |= RC_VisualID;
|
||||||
rattr.visualid = wVisualID;
|
rattr.visualid = wVisualID;
|
||||||
|
|||||||
Reference in New Issue
Block a user