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  263a50a92a32d9cd837f90b03197ce4a3d2392ff (commit)
       via  0c3b76a0c92beb3891891dbfd23d3b34dee4bd05 (commit)
      from  fffd8e799a960579c4f98008e1272bbe050e9257 (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/263a50a92a32d9cd837f90b03197ce4a3d2392ff

commit 263a50a92a32d9cd837f90b03197ce4a3d2392ff
Author: David Maciejak <[email protected]>
Date:   Fri Mar 7 19:45:50 2014 +0800

    Fixed unknown image format detection in Icon Chooser preview mode
    
    When pressing the Preview button from Icon chooser, a list of preview
    icons is displayed. When a unknown image format is encountered the
    list is showing duplicated entries. That patch is correcting that issue
    and adding rescale feature to that preview show.

diff --git a/src/dialog.c b/src/dialog.c
index 52188664..221f6aca 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -741,11 +741,12 @@ static void drawIconProc(WMList * lPtr, int index, 
Drawable d, char *text, int s
        color.blue = WMBlueComponentOfColor(back) >> 8;
        color.alpha = WMGetColorAlpha(back) >> 8;
 
-       pixmap = WMCreateBlendedPixmapFromFile(wmscr, file, &color, 0, 0);
+       pixmap = WMCreateBlendedPixmapFromFile(wmscr, file, &color, 64, 100);
        wfree(file);
 
        if (!pixmap) {
-               /*WMRemoveListItem(lPtr, index); */
+               /* if unknow image format, just remove the entry from the 
preview list */
+               WMRemoveListItem(lPtr, index);
                return;
        }
 
@@ -758,10 +759,9 @@ static void drawIconProc(WMList * lPtr, int index, 
Drawable d, char *text, int s
        size = WMGetPixmapSize(pixmap);
 
        XSetClipMask(dpy, copygc, WMGetPixmapMaskXID(pixmap));
-       XSetClipOrigin(dpy, copygc, x + (width - size.width) / 2, y + 2);
-       XCopyArea(dpy, WMGetPixmapXID(pixmap), d, copygc, 0, 0,
-                 size.width > 100 ? 100 : size.width, size.height > 64 ? 64 : 
size.height,
-                 x + (width - size.width) / 2, y + 2);
+       /* the icon is centered */
+       XSetClipOrigin(dpy, copygc, x + (width - size.width) / 2, y + (height - 
size.height) / 2);
+       XCopyArea(dpy, WMGetPixmapXID(pixmap), d, copygc, 0, 0, size.width, 
size.height, x + (width - size.width) / 2, y + (height - size.height) / 2);
 
        {
                int i, j;

http://repo.or.cz/w/wmaker-crm.git/commit/0c3b76a0c92beb3891891dbfd23d3b34dee4bd05

commit 0c3b76a0c92beb3891891dbfd23d3b34dee4bd05
Author: David Maciejak <[email protected]>
Date:   Fri Mar 7 08:39:28 2014 +0800

    Scale image to fit in preview panel

diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h
index d3b4f285..aa958447 100644
--- a/WINGs/WINGs/WINGs.h
+++ b/WINGs/WINGs/WINGs.h
@@ -839,7 +839,7 @@ WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, 
RImage *image,
                                           const RColor *color);
 
 WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, const char *fileName,
-                                        const RColor *color);
+                                        const RColor *color, unsigned wHeight, 
unsigned wWidth);
 
 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
 
diff --git a/WINGs/wpixmap.c b/WINGs/wpixmap.c
index 55c457b4..5511a137 100644
--- a/WINGs/wpixmap.c
+++ b/WINGs/wpixmap.c
@@ -117,7 +117,8 @@ WMPixmap *WMCreateBlendedPixmapFromRImage(WMScreen * 
scrPtr, RImage * image, con
        return pixPtr;
 }
 
-WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen * scrPtr, const char 
*fileName, const RColor * color)
+WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen * scrPtr, const char 
*fileName, const RColor * color,
+                                       unsigned wHeight, unsigned wWidth)
 {
        WMPixmap *pixPtr;
        RImage *image;
@@ -126,10 +127,19 @@ WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen * 
scrPtr, const char *fileName,
        if (!image)
                return NULL;
 
-       RCombineImageWithColor(image, color);
+       /* scale it if requested to fit in the widget */
+       if (wHeight > 0 && wWidth > 0 && (image->height > wHeight || 
image->width > wWidth)) {
+               RImage *tmp;
+               tmp = image;
+               if (image->width > image->height)
+                       image = RScaleImage(tmp, wWidth, image->height * 
wHeight / image->width);
+               else
+                       image = RScaleImage(tmp, image->width * wWidth / 
image->height, wHeight);
+               RReleaseImage(tmp);
+       }
 
+       RCombineImageWithColor(image, color);
        pixPtr = WMCreatePixmapFromRImage(scrPtr, image, 0);
-
        RReleaseImage(image);
 
        return pixPtr;
diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c
index f83ec3a1..7978f722 100644
--- a/WPrefs.app/MouseSettings.c
+++ b/WPrefs.app/MouseSettings.c
@@ -446,7 +446,7 @@ static void createPanel(Panel * p)
        WMSetLabelImagePosition(panel->speedL, WIPImageOnly);
        path = LocateImage(SPEED_ICON_FILE);
        if (path) {
-               icon = WMCreateBlendedPixmapFromFile(scr, path, &color);
+               icon = WMCreateBlendedPixmapFromFile(scr, path, &color, 0, 0);
                if (icon) {
                        WMSetLabelImage(panel->speedL, icon);
                        WMReleasePixmap(icon);
diff --git a/WPrefs.app/WPrefs.c b/WPrefs.app/WPrefs.c
index 31192aaa..b80e0991 100644
--- a/WPrefs.app/WPrefs.c
+++ b/WPrefs.app/WPrefs.c
@@ -456,7 +456,7 @@ void SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, 
const char *file)
        color.blue = 0xae;
        color.alpha = 0;
        if (iconPath) {
-               icon = WMCreateBlendedPixmapFromFile(scr, iconPath, &color);
+               icon = WMCreateBlendedPixmapFromFile(scr, iconPath, &color, 0, 
0);
                if (!icon)
                        wwarning(_("could not load icon file %s"), iconPath);
        } else {
@@ -470,7 +470,7 @@ void SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, 
const char *file)
        color.blue = 0xff;
        color.alpha = 0;
        if (iconPath) {
-               icon = WMCreateBlendedPixmapFromFile(scr, iconPath, &color);
+               icon = WMCreateBlendedPixmapFromFile(scr, iconPath, &color, 0, 
0);
                if (!icon)
                        wwarning(_("could not load icon file %s"), iconPath);
        } else {
diff --git a/src/dialog.c b/src/dialog.c
index 69fd31d4..52188664 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -619,7 +619,8 @@ static void setViewedImage(IconPanel *panel, const char 
*file)
        color.green = 0xaa;
        color.blue = 0xae;
        color.alpha = 0;
-       pixmap = WMCreateBlendedPixmapFromFile(WMWidgetScreen(panel->win), 
file, &color);
+       pixmap = WMCreateBlendedPixmapFromFile(WMWidgetScreen(panel->win), 
file, &color, 75, 75);
+
        if (!pixmap) {
                WMSetButtonEnabled(panel->okButton, False);
 
@@ -649,9 +650,7 @@ static void listCallback(void *self, void *data)
                path = item->text;
 
                WMSetTextFieldText(panel->fileField, path);
-
                WMSetLabelImage(panel->iconView, NULL);
-
                WMSetButtonEnabled(panel->okButton, False);
 
                WMClearList(panel->iconList);
@@ -742,7 +741,7 @@ static void drawIconProc(WMList * lPtr, int index, Drawable 
d, char *text, int s
        color.blue = WMBlueComponentOfColor(back) >> 8;
        color.alpha = WMGetColorAlpha(back) >> 8;
 
-       pixmap = WMCreateBlendedPixmapFromFile(wmscr, file, &color);
+       pixmap = WMCreateBlendedPixmapFromFile(wmscr, file, &color, 0, 0);
        wfree(file);
 
        if (!pixmap) {
@@ -1524,7 +1523,7 @@ static WMPixmap *getWindowMakerIconImage(WMScreen *scr)
                gray.blue = 0xae;
                gray.alpha = 0;
 
-               pix = WMCreateBlendedPixmapFromFile(scr, path, &gray);
+               pix = WMCreateBlendedPixmapFromFile(scr, path, &gray, 0, 0);
                wfree(path);
        }
 
diff --git a/src/dockedapp.c b/src/dockedapp.c
index 19d55bbd..502c830c 100644
--- a/src/dockedapp.c
+++ b/src/dockedapp.c
@@ -103,7 +103,7 @@ static void updateSettingsPanelIcon(AppSettingsPanel * 
panel)
                        color.green = 0xaa;
                        color.blue = 0xae;
                        color.alpha = 0;
-                       pixmap = 
WMCreateBlendedPixmapFromFile(WMWidgetScreen(panel->win), path, &color);
+                       pixmap = 
WMCreateBlendedPixmapFromFile(WMWidgetScreen(panel->win), path, &color, 64, 64);
                        if (!pixmap) {
                                WMSetLabelImage(panel->iconLabel, NULL);
                        } else {

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

Summary of changes:
 WINGs/WINGs/WINGs.h        |    2 +-
 WINGs/wpixmap.c            |   16 +++++++++++++---
 WPrefs.app/MouseSettings.c |    2 +-
 WPrefs.app/WPrefs.c        |    4 ++--
 src/dialog.c               |   19 +++++++++----------
 src/dockedapp.c            |    2 +-
 6 files changed, 27 insertions(+), 18 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