summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-07-17 22:09:19 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-07-17 22:09:19 +0200
commitbb316caf3b404ba1c8a486bbf09a70293a519264 (patch)
tree48cf6f4742f030fadb7533601408f12231ccb824 /lib
parent4ffea6d426f830925bc930d5bb7ceac781e6c94d (diff)
downloadphi-bb316caf3b404ba1c8a486bbf09a70293a519264.tar
phi-bb316caf3b404ba1c8a486bbf09a70293a519264.zip
Correctly align non-square icons
Diffstat (limited to 'lib')
-rw-r--r--lib/Phi/Widgets/Taskbar.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Phi/Widgets/Taskbar.hs b/lib/Phi/Widgets/Taskbar.hs
index 23572bd..ab67846 100644
--- a/lib/Phi/Widgets/Taskbar.hs
+++ b/lib/Phi/Widgets/Taskbar.hs
@@ -237,6 +237,10 @@ instance WidgetClass Taskbar where
let scalef = (fromIntegral h')/(fromIntegral $ max imageW imageH)
+ case True of
+ _ | imageH < imageW -> translate 0 (fromIntegral (imageW-imageH)*scalef/2)
+ | otherwise -> translate (fromIntegral (imageH-imageW)*scalef/2) 0
+
renderWithSimilarSurface ContentColorAlpha h' h' $ \surface -> do
renderWith surface $ do
downscaled scalef icon