{-# LANGUAGE ImplicitParams #-}
module Graphics.UI.FLTK.Theme.Light.Misc
(
header
, darkHeader
)
where
import qualified Graphics.UI.FLTK.LowLevel.FLTKHS as LowLevel
import qualified Data.Text as T
import Graphics.UI.FLTK.LowLevel.Fl_Types
import Graphics.UI.FLTK.LowLevel.Fl_Enumerations
import Graphics.UI.FLTK.Theme.Light.Common
import Graphics.UI.FLTK.Theme.Light.Assets
drawBackground :: (?assets :: Assets) => Color -> FillSpec -> Alignments -> LowLevel.Ref LowLevel.Box -> IO ()
drawBackground c spec alignments b = do
r <- LowLevel.getRectangle b
fillRectangle (spec { fillBounds = r }) False
LowLevel.drawLabel b (Just (r,alignments))
header :: (?assets :: Assets) => Color -> Rectangle -> T.Text -> Alignments -> IO (LowLevel.Ref LowLevel.Box)
header c r l alignments =
let fillSpec =
FillSpec
{
fillBounds = r
, fillTopColor = c
, fillTopSelectionColor = c
, fillTopFillPercentage = 10
, fillBottomColor = darker c
, fillBottomSelectionColor = c
, fillBottomFillPercentage = 90
, fillCornerRadius = 0
, fillBorderColor = c
, fillBorderFocusColor = c
, fillBorderHovered = c
}
in do
b <- LowLevel.boxCustom r (Just l) (Just (drawBackground c fillSpec alignments)) Nothing
LowLevel.setLabel b l
return b
darkHeader :: (?assets :: Assets) => Rectangle -> T.Text -> Alignments -> IO (LowLevel.Ref LowLevel.Box)
darkHeader r l alignments = do
c <- commonDarkGreyColor
b <- header c r l alignments
LowLevel.setLabelfont b josefinSlabSemiBold
LowLevel.setLabelsize b commonLargeFontSize
LowLevel.setLabelcolor b whiteColor
return b