diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-07-17 22:09:19 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-07-17 22:09:19 +0200 |
commit | bb316caf3b404ba1c8a486bbf09a70293a519264 (patch) | |
tree | 48cf6f4742f030fadb7533601408f12231ccb824 /lib/Phi | |
parent | 4ffea6d426f830925bc930d5bb7ceac781e6c94d (diff) | |
download | phi-bb316caf3b404ba1c8a486bbf09a70293a519264.tar phi-bb316caf3b404ba1c8a486bbf09a70293a519264.zip |
Correctly align non-square icons
Diffstat (limited to 'lib/Phi')
-rw-r--r-- | lib/Phi/Widgets/Taskbar.hs | 4 |
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 |