Skip to content

Commit

Permalink
UI|Home: Colorize game icons for a more consistent appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 31, 2016
1 parent 4aca181 commit 8a0f9c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Expand Up @@ -110,5 +110,9 @@ gamefilter {
#

home {
color icon.shadow { rgb $= label.shadow.rgb }
color icon.shadow { rgb $= label.shadow.rgb }
color icon.doom { rgb <1.0, 0.7, 0.2, 1.0> }
color icon.heretic { rgb <0.2, 0.7, 0.2, 1.0> }
color icon.hexen { rgb <1.0, 0.25, 0.1, 1.0> }
color icon.other { rgb <1.0, 1.0, 1.0, 1.0> }
}
12 changes: 8 additions & 4 deletions doomsday/apps/client/src/ui/home/gamepanelbuttonwidget.cpp
Expand Up @@ -169,10 +169,14 @@ DENG_GUI_PIMPL(GamePanelButtonWidget)
IdTech1Image img(title.isEmpty()? titlePic : title, playPal);

// Apply VGA aspect correction while downscaling 50%.
self.icon().setImage(img.toQImage().scaled(img.width()/2,
img.height()/2 * 1.2f,
Qt::IgnoreAspectRatio,
Qt::SmoothTransformation));
Image::Size const finalSize(img.width()/2, img.height()/2 * 1.2f);

String colorId = "home.icon." + (game().family().isEmpty()? "other" : game().family());

self.icon().setImage(Image(img.toQImage().scaled(finalSize.x, finalSize.y,
Qt::IgnoreAspectRatio,
Qt::SmoothTransformation))
.colorized(Vector4ub(style().colors().color(colorId), 255)));
}
catch(Error const &er)
{
Expand Down

0 comments on commit 8a0f9c3

Please sign in to comment.