summaryrefslogtreecommitdiff
path: root/Bustle.hs
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2010-10-28 22:17:39 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2010-10-28 22:23:22 +0100
commita79781cd381754699aaeb00cbc6ebe8cc88691b2 (patch)
tree01e6305f7ba23b5e25a916b262c225d80f922387 /Bustle.hs
parentee7311f8f12d3af9ef948dc04e585cc06405a64b (diff)
Translate diagram so it's all visible
\o/ But it doesn't look amazing yet...
Diffstat (limited to 'Bustle.hs')
-rw-r--r--Bustle.hs24
1 files changed, 18 insertions, 6 deletions
diff --git a/Bustle.hs b/Bustle.hs
index c0e4101..abe7520 100644
--- a/Bustle.hs
+++ b/Bustle.hs
@@ -214,16 +214,17 @@ loadLogWith getWindow session maybeSystem = do
Nothing -> return []
-- FIXME: pass the log file name into the renderer
- shapes <- toET (\e -> ("one of the logs", e)) $
- process (upgrade sessionMessages)
- (upgrade systemMessages)
+ (xTranslation, shapes) <-
+ toET (\e -> ("one of the logs", e)) $
+ process (upgrade sessionMessages)
+ (upgrade systemMessages)
windowInfo <- lift getWindow
let title = case maybeSystem of
Just system -> session ++ " and " ++ system
Nothing -> session
- lift $ displayLog windowInfo title shapes
+ lift $ displayLog windowInfo title xTranslation shapes
case ret of
Left (f, e) -> io $ displayError ("Could not read '" ++ f ++ "'") e
@@ -341,13 +342,15 @@ emptyWindow = do
incWindows
return windowInfo
-displayLog :: WindowInfo -> FilePath -> Diagram -> B ()
+displayLog :: WindowInfo -> FilePath -> Double -> Diagram -> B ()
displayLog (WindowInfo { wiWindow = window
, wiSave = saveItem
, wiLayout = layout
, wiNotebook = nb
})
- filename shapes = do
+ filename
+ xTranslation
+ shapes = do
let (width, height) = diagramDimensions shapes
details = (filename, shapes)
@@ -365,6 +368,15 @@ displayLog (WindowInfo { wiWindow = window
notebookSetCurrentPage nb 1
+ -- Shift to make the timestamp column visible
+ hadj <- layoutGetHAdjustment layout
+ (windowWidth, _) <- windowGetSize window
+ -- Roughly centre the timestamp-and-member column
+ adjustmentSetValue hadj
+ (xTranslation -
+ (fromIntegral windowWidth - timestampAndMemberWidth) / 2
+ )
+
return ()
update :: Layout -> Diagram -> Bool -> IO ()