From 7a87ba6f2e3e864fb1c487c097e2cf17bfca2df6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 29 Aug 2011 15:10:55 +0200 Subject: Get rid of layout function --- lib/Phi/Border.hs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'lib/Phi/Border.hs') diff --git a/lib/Phi/Border.hs b/lib/Phi/Border.hs index 4b32dd3..ca5e515 100644 --- a/lib/Phi/Border.hs +++ b/lib/Phi/Border.hs @@ -79,17 +79,6 @@ instance Eq s => Widget (Border w s c) s (BorderCache w s c) where weight (Border config _) = borderWeight config - layout (Border config w) s width height screen = case True of - _ | width' > 0 -> layout w s width' height' screen - | otherwise -> s - where - m = margin config - bw = borderWidth config - p = padding config - - width' = width - borderH m - 2*bw - borderH p - height' = height - borderV m - 2*bw - borderV p - render (Border config w) s x y width height screen = case () of _ | (width > borderH m - 2*bw - borderH p) -> do border <- liftIO $ createImageSurface FormatARGB32 width height @@ -104,7 +93,7 @@ instance Eq s => Widget (Border w s c) s (BorderCache w s c) where let surfaces' = (True, 0, Nothing):(map (\(updated, SurfaceSlice x surf) -> (updated, x+dx, Just surf)) surfaces)++[(True, width-rightWidth, Nothing)] surfacesWidths = zipWith (\(updated, x, surf) (_, x', _) -> (updated, x, x'-x, surf)) surfaces' (tail surfaces' ++ [(False, width, Nothing)]) forM surfacesWidths $ \(updated, x, surfWidth, surf) -> do - surf' <- liftIO $ createImageSurface FormatARGB32 surfWidth height + surf' <- liftIO $ createImageSurface FormatARGB32 surfWidth height renderWith surf' $ do setOperator OperatorClear paint -- cgit v1.2.3