Some minor adjustments

This commit is contained in:
Matthias Schiffer 2011-07-19 12:49:05 +02:00
parent 387613b2f0
commit bc9f8e1fbc
2 changed files with 5 additions and 6 deletions

View file

@ -61,7 +61,7 @@ instance WidgetClass Systray where
return $ SystrayState phi (head . getScreens $ dispvar) 0 lastReset [] return $ SystrayState phi (head . getScreens $ dispvar) 0 lastReset []
minSize _ (SystrayState _ systrayScreen _ _ icons) height screen = case True of minSize _ (SystrayState _ systrayScreen _ _ icons) height screen = case True of
_ | screen == systrayScreen -> (length icons)*height _ | screen == systrayScreen -> max 0 $ (length icons)*(height+2)-1
| otherwise -> 0 | otherwise -> 0
weight _ = 0 weight _ = 0
@ -72,7 +72,7 @@ instance WidgetClass Systray where
liftIO $ writeIORef lastResetRef reset liftIO $ writeIORef lastResetRef reset
Matrix _ _ _ _ dx dy <- getMatrix Matrix _ _ _ _ dx dy <- getMatrix
forM_ (zip [0..] icons) $ \(i, SystrayIconState midParent window) -> do forM_ (zip [0..] icons) $ \(i, SystrayIconState midParent window) -> do
let x = round dx + i*h let x = round dx + i*(h+2)
y = round dy y = round dy
sendMessage phi $ RenderIcon midParent window x y h h (lastReset /= reset) sendMessage phi $ RenderIcon midParent window x y h h (lastReset /= reset)
@ -115,16 +115,15 @@ systrayRunner phi dispvar = do
writeIORef errorWindowRef (ev_resourceid event:errorWindows) writeIORef errorWindowRef (ev_resourceid event:errorWindows)
(_, x', y', w', h', _, _) <- getGeometry disp midParent (_, x', y', w', h', _, _) <- getGeometry disp midParent
(_, _, _, w'', h'', _, _) <- getGeometry disp window
let resize = (fromIntegral x) /= x' || (fromIntegral y) /= y' || (fromIntegral w) /= w' || (fromIntegral h) /= h' let resize = (fromIntegral x) /= x' || (fromIntegral y) /= y' || (fromIntegral w) /= w' || (fromIntegral h) /= h'
|| (fromIntegral w) /= w'' || (fromIntegral h) /= h''
when resize $ do when resize $ do
moveResizeWindow disp midParent (fromIntegral x) (fromIntegral y) (fromIntegral w) (fromIntegral h) moveResizeWindow disp midParent (fromIntegral x) (fromIntegral y) (fromIntegral w) (fromIntegral h)
resizeWindow disp window (fromIntegral w) (fromIntegral h) resizeWindow disp window (fromIntegral w) (fromIntegral h)
sync disp False sync disp False
clearArea disp midParent 0 0 (fromIntegral w) (fromIntegral h) True
sync disp False
when (resize || reset) $ do when (resize || reset) $ do
clearArea disp window 0 0 (fromIntegral w) (fromIntegral h) True clearArea disp window 0 0 (fromIntegral w) (fromIntegral h) True
sync disp False sync disp False

View file

@ -12,7 +12,7 @@ import Phi.Widgets.Systray
main :: IO () main :: IO ()
main = do main = do
runPhi defaultXConfig defaultPanelConfig { panelPosition = Bottom } runPhi defaultXConfig defaultPanelConfig { panelPosition = Top }
[alphaBox 0.9 [theTaskbar, brightBorder [theSystray], brightBorder [theClock]]] [alphaBox 0.9 [theTaskbar, brightBorder [theSystray], brightBorder [theClock]]]
where where
normalTaskBorder = BorderConfig (BorderWidth (-1) (-3) (-1) 7) 1 (BorderWidth 0 5 0 5) (0.9, 0.9, 0.9, 0.8) (0.45, 0.45, 0.45, 0.8) 5 0 normalTaskBorder = BorderConfig (BorderWidth (-1) (-3) (-1) 7) 1 (BorderWidth 0 5 0 5) (0.9, 0.9, 0.9, 0.8) (0.45, 0.45, 0.45, 0.8) 5 0