diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-08-21 05:38:37 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-08-21 05:38:37 +0200 |
commit | 028c4243a87e41e3b7e2c51eb752d4b089b30680 (patch) | |
tree | d401761df8a383b9dfdf3054a4d1365400879435 /lib/Phi/Widgets/AlphaBox.hs | |
parent | 15bccc001a5ff2e76d0890f85e300e9312cddd1b (diff) | |
download | phi-028c4243a87e41e3b7e2c51eb752d4b089b30680.tar phi-028c4243a87e41e3b7e2c51eb752d4b089b30680.zip |
Use CacheArrow for rendering
Extremely hacky at the moment, for now the caching isn't used at all...
Diffstat (limited to 'lib/Phi/Widgets/AlphaBox.hs')
-rw-r--r-- | lib/Phi/Widgets/AlphaBox.hs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Phi/Widgets/AlphaBox.hs b/lib/Phi/Widgets/AlphaBox.hs index dd4bfba..2db17f4 100644 --- a/lib/Phi/Widgets/AlphaBox.hs +++ b/lib/Phi/Widgets/AlphaBox.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE MultiParamTypeClasses #-} module Phi.Widgets.AlphaBox ( alphaBox ) where @@ -11,13 +11,12 @@ import Control.Monad import Graphics.Rendering.Cairo -data AlphaBoxState = AlphaBoxState ![WidgetState] deriving Show +data AlphaBoxState = AlphaBoxState ![WidgetState] deriving Eq -data AlphaBox = AlphaBox !Double ![Widget] deriving Show +data AlphaBox = AlphaBox !Double ![Widget] deriving (Show, Eq) -instance WidgetClass AlphaBox where - type WidgetData AlphaBox = AlphaBoxState +instance WidgetClass AlphaBox AlphaBoxState where initWidget (AlphaBox _ widgets) phi disp = liftM AlphaBoxState $ mapM (createWidgetState phi disp) widgets minSize (AlphaBox _ _) (AlphaBoxState widgetStates) height screen = @@ -27,10 +26,10 @@ instance WidgetClass AlphaBox where layout (AlphaBox _ _) (AlphaBoxState widgetStates) width height screen = AlphaBoxState $ layoutWidgets widgetStates 0 0 width height screen - render (AlphaBox alpha _) (AlphaBoxState widgetStates) w h screen = do + render (AlphaBox alpha _) (AlphaBoxState widgetStates) x y w h screen = do renderWithSimilarSurface ContentColorAlpha w h $ \surface -> do renderWith surface $ do - renderWidgets widgetStates screen + renderWidgets widgetStates screen x y setOperator OperatorDestIn setSourceRGBA 0 0 0 alpha |