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 import MetaBrush.Render.Util ( withRGBA ) -------------------------------------------------------------------------------- -- | 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 -- | Restore down window icon. 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 -- | Maximise window icon. 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 -- | Close window icon. 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