@@ -13,14 +13,12 @@ module GUI.EventsView (
1313 ) where
1414
1515import GHC.RTS.Events
16- import Debug.Trace
1716
1817import Graphics.UI.Gtk hiding (rectangle )
1918import Graphics.Rendering.Cairo
20- import qualified GUI.GtkExtras as GtkExt
19+ import GUI.ViewerColours
2120
2221import Control.Monad
23- import Control.Monad.Reader
2422import Data.Array
2523import Data.Monoid
2624import Data.IORef
@@ -68,8 +66,6 @@ eventsViewNew builder EventsViewActions{..} = do
6866 vScrollbar <- getWidget castToVScrollbar (" eventsVScroll" :: T. Text )
6967 adj <- get vScrollbar rangeAdjustment
7068
71- -- make the background white
72- widgetModifyBg drawArea StateNormal (Color 0xffff 0xffff 0xffff )
7369 widgetSetCanFocus drawArea True
7470 -- TODO: needs to be reset on each style change ^^
7571
@@ -306,8 +302,7 @@ drawEvents EventsView{drawArea, adj}
306302 sequence_
307303 [ do when (inside || selected) $
308304 renderWithDrawWindow win $ do
309- -- TODO: figure out how I can grab the correct color from GTK's style
310- setSourceRGBA 0.2 1 1 0.2
305+ setSourceRGBAForStyle styleGetBackground style state1
311306 rectangle 0 y (fromIntegral width) lineHeight
312307 fill
313308
@@ -316,6 +311,7 @@ drawEvents EventsView{drawArea, adj}
316311 layoutSetAlignment layout AlignRight
317312 layoutSetWidth layout (Just (fromIntegral timeWidth))
318313 renderWithDrawWindow win $ do
314+ setForegroundColor style state2
319315 moveTo 0 y
320316 showLayout layout
321317
@@ -324,6 +320,7 @@ drawEvents EventsView{drawArea, adj}
324320 layoutSetAlignment layout AlignLeft
325321 layoutSetWidth layout (Just (fromIntegral descrWidth))
326322 renderWithDrawWindow win $ do
323+ setForegroundColor style state2
327324 moveTo (fromIntegral $ timeWidth + columnGap) y
328325 showLayout layout
329326
@@ -333,7 +330,7 @@ drawEvents EventsView{drawArea, adj}
333330 inside = maybe False (\ (s, e) -> s <= n && n <= e) mrange
334331 selected = cursorPos == n
335332 (state1, state2)
336- | inside = (StatePrelight , StatePrelight )
333+ | inside = (StateSelected , StateSelected )
337334 | selected = (state, state)
338335 | otherwise = (state, StateNormal )
339336 ]
@@ -349,6 +346,7 @@ drawEvents EventsView{drawArea, adj}
349346 Message msg -> TB. fromText msg
350347 UserMessage msg -> TB. fromText msg
351348 _ -> buildEventInfo spec
349+ setForegroundColor = setSourceRGBAForStyle styleGetForeground
352350
353351-------------------------------------------------------------------------------
354352
0 commit comments