Skip to content

Commit b4e10f5

Browse files
committed
wip
1 parent 5673ad0 commit b4e10f5

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

GUI/EventsView.hs

+13-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module GUI.EventsView (
1313
) where
1414

1515
import GHC.RTS.Events
16+
import Debug.Trace
1617

1718
import Graphics.UI.Gtk
1819
import qualified GUI.GtkExtras as GtkExt
@@ -278,16 +279,19 @@ drawEvents EventsView{drawArea, adj}
278279

279280
-- TODO: don't use Just here
280281
Just win <- widgetGetWindow drawArea
281-
style <- get drawArea widgetStyle
282-
focused <- get drawArea widgetIsFocus
282+
style <- widgetGetStyle drawArea
283+
focused <- widgetGetIsFocus drawArea
284+
traceM "got is focus"
283285
let state | focused = StateSelected
284286
| otherwise = StateActive
285287

286288
pangoCtx <- widgetGetPangoContext drawArea
287289
layout <- layoutEmpty pangoCtx
288290
layoutSetEllipsize layout EllipsizeEnd
289291

290-
clipRect@(Rectangle _ _ width _) <- widgetGetAllocation drawArea
292+
293+
(Rectangle _ _ width _) <- widgetGetAllocation drawArea
294+
let clipRect = Rectangle 0 0 0 0
291295

292296
let -- With average char width, timeWidth is enough for 24 hours of logs
293297
-- (way more than TS can handle, currently). Aligns nicely with
@@ -299,6 +303,7 @@ drawEvents EventsView{drawArea, adj}
299303
columnGap = 20
300304
descrWidth = width - timeWidth - columnGap
301305

306+
traceM "draw each"
302307
sequence_
303308
[ do when (inside || selected) $
304309
GtkExt.stylePaintFlatBox
@@ -307,18 +312,23 @@ drawEvents EventsView{drawArea, adj}
307312
clipRect
308313
drawArea ""
309314
0 (round y) width (round lineHeight)
315+
traceM "stylePaint"
310316

311317
-- The event time
312318
layoutSetText layout (showEventTime event)
319+
traceM "set text"
313320
layoutSetAlignment layout AlignRight
321+
traceM "set align"
314322
layoutSetWidth layout (Just (fromIntegral timeWidth))
323+
traceM "set width"
315324
GtkExt.stylePaintLayout
316325
style win
317326
state2 True
318327
clipRect
319328
drawArea ""
320329
0 (round y)
321330
layout
331+
traceM "paint layout"
322332

323333
-- The event description text
324334
layoutSetText layout (showEventDescr event)

GUI/Timeline.hs

+1-3
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,7 @@ timelineViewNew builder actions = do
293293
-- render either the whole height of the timeline, or the window, whichever
294294
-- is larger (this just ensure we fill the background if the timeline is
295295
-- smaller than the window).
296-
exposeRect@(Rectangle _ _ w h)<- widgetGetAllocation timelineDrawingArea
297-
Rectangle _ _ _ h <- widgetGetAllocation timelineDrawingArea
298-
traceShowM exposeRect
296+
(Rectangle _ _ w h)<- widgetGetAllocation timelineDrawingArea
299297
let params' = params { height = max (height params) h }
300298
selection <- readIORef selectionRef
301299
bookmarks <- readIORef bookmarkIORef

0 commit comments

Comments
 (0)