[Pkg-wmaker-commits] [wmforecast] 03/11: wmforecast.c: Combine background color with icon to remove black border.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sun Sep 20 16:38:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch upstream
in repository wmforecast.

commit 1bf4bdb039c8bd9dd27c0166ab892907cfcebb85
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Sat Nov 1 20:45:58 2014 -0500

    wmforecast.c: Combine background color with icon to remove black border.
---
 wmforecast.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/wmforecast.c b/wmforecast.c
index 76242c6..9701d9a 100755
--- a/wmforecast.c
+++ b/wmforecast.c
@@ -187,7 +187,8 @@ void setConditions(Weather *weather,
 		   WMScreen *screen,
 		   const char *temp,
 		   const char *text,
-		   const char *code
+		   const char *code,
+		   const char *background
 	)
 {
 	RContext *context;
@@ -204,8 +205,14 @@ void setConditions(Weather *weather,
 	context = WMScreenRContext(screen);
 	filename = wstrconcat(wstrconcat(DATADIR"/",code),".png");
 	weather->icon = RLoadImage(context,filename,0);
-	if (!weather->icon)
+	if (!weather->icon) {
 		setError(weather, screen, wstrconcat(filename, " not found"));
+	} else {
+		RColor color;
+		color = WMGetRColorFromColor(
+			WMCreateNamedColor(screen, background, True));
+		RCombineImageWithColor(weather->icon,&color);
+	}
 }
 
 void setForecast(Forecast *forecast,
@@ -447,7 +454,8 @@ Weather *getWeather(WMScreen *screen, Preferences *prefs)
 						screen,
 						xmlGetProp(cur,"temp"),
 						xmlGetProp(cur,"text"),
-						xmlGetProp(cur,"code")
+						xmlGetProp(cur,"code"),
+						prefs->background
 						);
 				}
 				if ((!xmlStrcmp(cur->name, (const xmlChar *)"forecast"))) {
@@ -509,6 +517,12 @@ static void updateDockapp(void *data)
 		context = WMScreenRContext(screen);
 		weather->icon = RLoadImage(context,DATADIR"/na.png",0);
 		if (weather->icon) {
+			RColor color;
+
+			color = WMGetRColorFromColor(
+				WMCreateNamedColor(screen,
+						   prefs->background, True));
+			RCombineImageWithColor(weather->icon,&color);
 			icon = WMCreatePixmapFromRImage(screen,weather->icon,0);
 			WMSetLabelImage(dockapp->icon,icon);
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmforecast.git



More information about the Pkg-wmaker-commits mailing list