From a4936c35b6f788df63da7adb1aaa15c50d648654 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 16 Jul 2011 03:08:55 +0200 Subject: Always use biggest icon --- lib/Phi/Widgets/Taskbar.hs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/Phi') diff --git a/lib/Phi/Widgets/Taskbar.hs b/lib/Phi/Widgets/Taskbar.hs index 3f3b3c2..4f85e71 100644 --- a/lib/Phi/Widgets/Taskbar.hs +++ b/lib/Phi/Widgets/Taskbar.hs @@ -212,13 +212,9 @@ renderText style x y w h text = do showLayout layout bestIcon :: Int -> [(Int, Surface)] -> Maybe Surface -bestIcon h icons = findBest $ sortBy compareIcons icons +bestIcon h icons = fmap snd . listToMaybe $ sortBy compareIcons icons where compareIcons = flip (compare `on` fst) - - findBest (a1:a2:ax) = if (fst a2) < h then Just $ snd a1 else findBest (a2:ax) - findBest [a] = Just $ snd a - findBest [] = Nothing windowOnDesktop :: Int -> WindowState -> Bool -- cgit v1.2.3