metabrush/src/app/MetaBrush/Asset/WindowIcons.hs

108 lines
2.6 KiB
Haskell
Raw Normal View History

2020-08-07 22:41:08 +00:00
{-# LANGUAGE NamedFieldPuns #-}
2020-08-04 06:15:06 +00:00
module MetaBrush.Asset.WindowIcons
( drawMinimise, drawRestoreDown, drawMaximise, drawClose )
where
-- gi-cairo-render
import qualified GI.Cairo.Render as Cairo
-- MetaBrush
2020-08-07 22:41:08 +00:00
import MetaBrush.Asset.Colours
( ColourRecord(..), Colours )
2020-09-01 19:56:59 +00:00
import MetaBrush.Util
2020-08-07 19:39:24 +00:00
( withRGBA )
2020-08-04 06:15:06 +00:00
--------------------------------------------------------------------------------
2020-08-07 19:39:24 +00:00
-- | Minimise window icon.
2020-08-07 22:41:08 +00:00
drawMinimise :: Colours -> Cairo.Render Bool
drawMinimise ( Colours { plain } ) = do
2020-08-07 19:39:24 +00:00
2020-08-07 22:41:08 +00:00
withRGBA plain Cairo.setSourceRGBA
2020-08-07 19:39:24 +00:00
Cairo.newPath
Cairo.moveTo 6.144531 12.914063
Cairo.lineTo 6.144531 16.675781
Cairo.lineTo 17.855469 16.675781
Cairo.lineTo 17.855469 12.914063
Cairo.closePath
Cairo.fillPreserve
pure True
2020-08-04 06:15:06 +00:00
-- | Restore down window icon.
2020-08-07 22:41:08 +00:00
drawRestoreDown :: Colours -> Cairo.Render Bool
drawRestoreDown ( Colours { plain } ) = do
2020-08-07 19:39:24 +00:00
2020-08-07 22:41:08 +00:00
withRGBA plain Cairo.setSourceRGBA
2020-08-07 19:39:24 +00:00
Cairo.newPath
Cairo.moveTo 8.453125 4.179688
Cairo.lineTo 8.453125 9.230469
Cairo.lineTo 4.941406 9.230469
Cairo.lineTo 4.941406 19.105469
Cairo.lineTo 15.8125 19.105469
Cairo.lineTo 15.8125 14.761719
Cairo.lineTo 19.324219 14.761719
Cairo.lineTo 19.324219 4.179688
Cairo.closePath
Cairo.moveTo 9.988281 7.261719
Cairo.lineTo 17.773438 7.261719
Cairo.lineTo 17.773438 13.238281
Cairo.lineTo 15.8125 13.238281
Cairo.lineTo 15.8125 9.230469
Cairo.lineTo 9.988281 9.230469
Cairo.closePath
Cairo.moveTo 6.476563 12.316406
Cairo.lineTo 14.261719 12.316406
Cairo.lineTo 14.261719 17.597656
Cairo.lineTo 6.476563 17.597656
Cairo.closePath
Cairo.fillPreserve
pure True
2020-08-04 06:15:06 +00:00
-- | Maximise window icon.
2020-08-07 22:41:08 +00:00
drawMaximise :: Colours -> Cairo.Render Bool
drawMaximise ( Colours { plain } ) = do
2020-08-07 19:39:24 +00:00
2020-08-07 22:41:08 +00:00
withRGBA plain Cairo.setSourceRGBA
2020-08-07 19:39:24 +00:00
Cairo.newPath
Cairo.moveTo 5.386719 5.449219
Cairo.lineTo 5.386719 18.550781
Cairo.lineTo 18.613281 18.550781
Cairo.lineTo 18.613281 5.449219
Cairo.closePath
Cairo.moveTo 6.921875 9.128906
Cairo.lineTo 17.078125 9.128906
Cairo.lineTo 17.078125 17.023438
Cairo.lineTo 6.921875 17.023438
Cairo.closePath
Cairo.fillPreserve
pure True
2020-08-04 06:15:06 +00:00
-- | Close window icon.
2020-08-07 22:41:08 +00:00
drawClose :: Colours -> Cairo.Render Bool
drawClose ( Colours { plain } ) = do
2020-08-07 19:39:24 +00:00
Cairo.setLineWidth 2
2020-08-07 22:41:08 +00:00
withRGBA plain Cairo.setSourceRGBA
2020-08-07 19:39:24 +00:00
Cairo.setLineCap Cairo.LineCapRound
Cairo.setLineJoin Cairo.LineJoinMiter
Cairo.newPath
Cairo.moveTo 6.132813 6.238281
Cairo.lineTo 17.867188 17.761719
Cairo.strokePreserve
Cairo.newPath
Cairo.moveTo 6.132813 17.761719
Cairo.lineTo 17.867188 6.23828
Cairo.strokePreserve
pure True