This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  07a0639c93b5cb91833396e0d95391af751ffbb5 (commit)
       via  854ae5830572017d429a9d0c2d5215fca24f4447 (commit)
      from  87ce0de15fe02fe4d96d13cb46c7a352803d5126 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/07a0639c93b5cb91833396e0d95391af751ffbb5

commit 07a0639c93b5cb91833396e0d95391af751ffbb5
Author: Iain Patterson <[email protected]>
Date:   Tue Feb 14 13:13:55 2012 +0000

    Don't shrink icons in switchpanel.
    
    Icons in the switchpanel are constrained to the value of the IconSize
    preference but the grid in which they are arranged is fixed at 64 pixels.
    If IconSize is less than 64x64 the panel will show smaller icons with a
    wide spacing, which looks pretty stupid.
    
    Fix it by forcing the switchpanel to attempt to load images at the size
    it's going to use.  The icon it actually gets may of course still be
    smaller.

diff --git a/src/defaults.c b/src/defaults.c
index b5ea8e2..0a353f2 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -966,7 +966,7 @@ void wDefaultsCheckDomains(void* arg)
                                                /* Update the panel image if 
changed */
                                                /* Don't worry. If the image is 
the same these
                                                 * functions will have no 
performance impact. */
-                                               image = wDefaultGetImage(scr, 
"Logo", "WMPanel");
+                                               image = wDefaultGetImage(scr, 
"Logo", "WMPanel", wPreferences.icon_size);
 
                                                if (!image) {
                                                        wwarning(_("could not 
load logo image for panels: %s"),
diff --git a/src/defaults.h b/src/defaults.h
index 2dcf339..fdf09cd 100644
--- a/src/defaults.h
+++ b/src/defaults.h
@@ -52,7 +52,7 @@ void wSaveDefaults(WScreen *scr);
 char *wDefaultGetIconFile(WScreen *scr, char *instance, char *class,
                           Bool noDefault);
 
-RImage *wDefaultGetImage(WScreen *scr, char *winstance, char *wclass);
+RImage *wDefaultGetImage(WScreen *scr, char *winstance, char *wclass, int 
max_size);
 
 void wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
                             WWindowAttributes *attr, WWindowAttributes *mask,
diff --git a/src/icon.c b/src/icon.c
index 5660d6b..be1b3a7 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -154,7 +154,7 @@ WIcon *wIconCreate(WWindow * wwin)
 #else
        icon->show_title = 1;
 #endif
-       icon->file_image = wDefaultGetImage(scr, wwin->wm_instance, 
wwin->wm_class);
+       icon->file_image = wDefaultGetImage(scr, wwin->wm_instance, 
wwin->wm_class, wPreferences.icon_size);
 
        file = wDefaultGetIconFile(scr, wwin->wm_instance, wwin->wm_class, 
False);
        if (file) {
@@ -215,7 +215,7 @@ WIcon *wIconCreateWithIconFile(WScreen * scr, char 
*iconfile, int tile)
                        wwarning(_("error loading image file "%s": %s"), 
iconfile, RMessageForError(RErrorCode));
                }
 
-               icon->file_image = wIconValidateIconSize(scr, icon->file_image);
+               icon->file_image = wIconValidateIconSize(scr, icon->file_image, 
wPreferences.icon_size);
 
                icon->file = wstrdup(iconfile);
        }
@@ -354,7 +354,7 @@ void wIconChangeTitle(WIcon * icon, char *new_title)
        wIconPaint(icon);
 }
 
-RImage *wIconValidateIconSize(WScreen * scr, RImage * icon)
+RImage *wIconValidateIconSize(WScreen * scr, RImage * icon, int max_size)
 {
        RImage *tmp;
        int w, h;
@@ -362,9 +362,9 @@ RImage *wIconValidateIconSize(WScreen * scr, RImage * icon)
        if (!icon)
                return NULL;
 #ifndef DONT_SCALE_ICONS
-       if (wPreferences.icon_size != 64) {
-               w = wPreferences.icon_size * icon->width / 64;
-               h = wPreferences.icon_size * icon->height / 64;
+       if (max_size != 64) {
+               w = max_size * icon->width / 64;
+               h = max_size * icon->height / 64;
 
                tmp = RScaleImage(icon, w, h);
                RReleaseImage(icon);
@@ -394,7 +394,7 @@ Bool wIconChangeImageFile(WIcon * icon, char *file)
        path = FindImage(wPreferences.icon_path, file);
 
        if (path && (image = RLoadImage(scr->rcontext, path, 0))) {
-               icon->file_image = 
wIconValidateIconSize(icon->core->screen_ptr, image);
+               icon->file_image = 
wIconValidateIconSize(icon->core->screen_ptr, image, wPreferences.icon_size);
                wIconUpdate(icon);
        } else {
                error = 1;
@@ -706,7 +706,7 @@ void wIconUpdate(WIcon * icon)
                                }
  make_icons:
 
-                               image = wIconValidateIconSize(scr, image);
+                               image = wIconValidateIconSize(scr, image, 
wPreferences.icon_size);
                                scr->def_icon_pixmap = makeIcon(scr, image, 
False, False, icon->tile_type, icon->highlighted);
                                scr->def_ticon_pixmap = makeIcon(scr, image, 
True, False, icon->tile_type, icon->highlighted);
                                if (image)
diff --git a/src/icon.h b/src/icon.h
index d0f87ec..9786995 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -66,7 +66,7 @@ void wIconChangeTitle(WIcon *icon, char *new_title);
 Bool wIconChangeImageFile(WIcon *icon, char *file);
 void wIconSelect(WIcon *icon);
 
-RImage *wIconValidateIconSize(WScreen *scr, RImage *icon);
+RImage *wIconValidateIconSize(WScreen *scr, RImage *icon, int max_size);
 
 char *wIconStore(WIcon *icon);
 
diff --git a/src/screen.c b/src/screen.c
index e2cda33..5c12147 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -402,7 +402,7 @@ static void createPixmaps(WScreen * scr)
                pix->shared = 1;
        scr->menu_shade_indicator = pix;
 
-       image = wDefaultGetImage(scr, "Logo", "WMPanel");
+       image = wDefaultGetImage(scr, "Logo", "WMPanel", 
wPreferences.icon_size);
 
        if (!image) {
                wwarning(_("could not load logo image for panels: %s"), 
RMessageForError(RErrorCode));
diff --git a/src/switchpanel.c b/src/switchpanel.c
index 3836991..aac3a22 100644
--- a/src/switchpanel.c
+++ b/src/switchpanel.c
@@ -177,7 +177,7 @@ static void addIconForWindow(WSwitchPanel * panel, WMWidget 
* parent, WWindow *
        // it's very likely that most of them are instances of the same thing,
        // so caching them should get performance acceptable in these cases.
        if (!image)
-               image = wDefaultGetImage(panel->scr, wwin->wm_instance, 
wwin->wm_class);
+               image = wDefaultGetImage(panel->scr, wwin->wm_instance, 
wwin->wm_class, ICON_TILE_SIZE);
 
        if (!image && !panel->defIcon) {
                char *file = wDefaultGetIconFile(panel->scr, NULL, NULL, False);
diff --git a/src/wdefaults.c b/src/wdefaults.c
index 8df9dc8..ee42d00 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -399,7 +399,7 @@ char *wDefaultGetIconFile(WScreen * scr, char *instance, 
char *class, Bool noDef
        return tmp;
 }
 
-RImage *wDefaultGetImage(WScreen * scr, char *winstance, char *wclass)
+RImage *wDefaultGetImage(WScreen * scr, char *winstance, char *wclass, int 
max_size)
 {
        char *file_name;
        char *path;
@@ -422,7 +422,7 @@ RImage *wDefaultGetImage(WScreen * scr, char *winstance, 
char *wclass)
        }
        wfree(path);
 
-       image = wIconValidateIconSize(scr, image);
+       image = wIconValidateIconSize(scr, image, max_size);
 
        return image;
 }

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog  |    7 +++++++
 src/defaults.c    |    2 +-
 src/defaults.h    |    2 +-
 src/icon.c        |   16 ++++++++--------
 src/icon.h        |    2 +-
 src/screen.c      |    2 +-
 src/switchpanel.c |    2 +-
 src/wdefaults.c   |    4 ++--
 8 files changed, 22 insertions(+), 15 deletions(-)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to