1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 22:28:02 +01:00

wmaker: Scale image to make them fit in the preview panel

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
Christophe CURIS
2014-04-06 00:11:57 +02:00
committed by Carlos R. Mafra
parent 050cae3bd2
commit 36159c614f
4 changed files with 27 additions and 5 deletions

View File

@@ -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 = WMCreateScaledBlendedPixmapFromFile(WMWidgetScreen(panel->win), file, &color, 75, 75);
if (!pixmap) {
WMSetButtonEnabled(panel->okButton, False);
@@ -742,7 +743,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 = WMCreateScaledBlendedPixmapFromFile(wmscr, file, &color, width - 2, height - 2);
wfree(file);
if (!pixmap) {