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
|
|
|
|
|
|
|
|
-- gi-gdk
|
|
|
|
import qualified GI.Gdk as GDK
|
|
|
|
|
|
|
|
-- MetaBrush
|
2020-08-07 19:39:24 +00:00
|
|
|
import MetaBrush.Render.Util
|
|
|
|
( withRGBA )
|
2020-08-04 06:15:06 +00:00
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
2020-08-07 19:39:24 +00:00
|
|
|
-- | Minimise window icon.
|
|
|
|
drawMinimise :: GDK.RGBA -> Cairo.Render Bool
|
|
|
|
drawMinimise iconColour = do
|
|
|
|
|
|
|
|
withRGBA iconColour Cairo.setSourceRGBA
|
|
|
|
|
|
|
|
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 19:39:24 +00:00
|
|
|
drawRestoreDown :: GDK.RGBA -> Cairo.Render Bool
|
|
|
|
drawRestoreDown iconColour = do
|
|
|
|
|
|
|
|
withRGBA iconColour Cairo.setSourceRGBA
|
|
|
|
|
|
|
|
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 19:39:24 +00:00
|
|
|
drawMaximise :: GDK.RGBA -> Cairo.Render Bool
|
|
|
|
drawMaximise iconColour = do
|
|
|
|
|
|
|
|
withRGBA iconColour Cairo.setSourceRGBA
|
|
|
|
|
|
|
|
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 19:39:24 +00:00
|
|
|
drawClose :: GDK.RGBA -> Cairo.Render Bool
|
|
|
|
drawClose iconColour = do
|
|
|
|
|
|
|
|
Cairo.setLineWidth 2
|
|
|
|
withRGBA iconColour Cairo.setSourceRGBA
|
|
|
|
|
|
|
|
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
|