module Themes (myTheme, myButtonedTheme, Theme (..)) where
import XMonad.Layout.Decoration(Theme(..), Decoration, DefaultShrinker)
import XMonad.Layout.ImageButtonDecoration
import XMonad.Util.Image

import qualified Colors as C

myButtonedTheme = defaultThemeWithImageButtons {
    fontName = "xft:RobotoCondensed:size=11"
  , decoHeight = 20
  , activeColor = C.backgroundColor
  , inactiveColor = C.backgroundColor
  , urgentColor = C.backgroundColor
  , activeBorderColor = C.backgroundColor
  , inactiveBorderColor = C.backgroundColor
  , urgentBorderColor = C.backgroundColor
  , activeTextColor = C.focusedColor
  , inactiveTextColor = C.normalColor
  , urgentTextColor = C.urgentColor
  , windowTitleIcons = [ (menuButton, CenterLeft 3)
                       , (closeButton, CenterRight 3)
                       , (maxiButton, CenterRight 18)
                       , (miniButton, CenterRight 33) ]
  }

myTheme = myButtonedTheme {
    windowTitleAddons = []
  , windowTitleIcons  = []
  }

-- The images in a 0-1 scale to make
-- it easier to visualize

convertToBool' :: [Int] -> [Bool]
convertToBool' = map (\x -> x == 1)

convertToBool :: [[Int]] -> [[Bool]]
convertToBool = map convertToBool'

menuButton' :: [[Int]]
menuButton' = [[1,1,1,1,1,1,1,1,1,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,1,1,1,1,1,1,1,1,1],
               [1,1,1,1,1,1,1,1,1,1],
               [1,1,1,1,1,1,1,1,1,1],
               [1,1,1,1,1,1,1,1,1,1],
               [1,1,1,1,1,1,1,1,1,1],
               [1,1,1,1,1,1,1,1,1,1]]

menuButton :: [[Bool]]
menuButton = convertToBool menuButton'

miniButton' :: [[Int]]
miniButton' = [[0,0,0,0,0,0,0,0,0,0],
               [0,0,0,0,0,0,0,0,0,0],
               [0,0,0,0,0,0,0,0,0,0],
               [0,0,0,0,0,0,0,0,0,0],
               [0,0,0,0,0,0,0,0,0,0],
               [0,0,0,0,0,0,0,0,0,0],
               [0,0,0,0,0,0,0,0,0,0],
               [0,0,0,0,0,0,0,0,0,0],
               [0,0,0,0,0,0,0,0,0,0],
               [1,1,1,1,1,1,1,1,1,1]]

miniButton :: [[Bool]]
miniButton = convertToBool miniButton'

maxiButton' :: [[Int]]
maxiButton' = [[1,1,1,1,1,1,1,1,1,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,0,0,0,0,0,0,0,0,1],
               [1,1,1,1,1,1,1,1,1,1]]

maxiButton :: [[Bool]]
maxiButton = convertToBool maxiButton'

closeButton' :: [[Int]]
closeButton' = [[1,0,0,0,0,0,0,0,0,1],
                [0,1,0,0,0,0,0,0,1,0],
                [0,0,1,0,0,0,0,1,0,0],
                [0,0,0,1,0,0,1,0,0,0],
                [0,0,0,0,1,1,0,0,0,0],
                [0,0,0,0,1,1,0,0,0,0],
                [0,0,0,1,0,0,1,0,0,0],
                [0,0,1,0,0,0,0,1,0,0],
                [0,1,0,0,0,0,0,0,1,0],
                [1,0,0,0,0,0,0,0,0,1]]


closeButton :: [[Bool]]
closeButton = convertToBool closeButton'
