Simplify button drawing
This commit is contained in:
@@ -18,8 +18,7 @@ makeButton
|
||||
-> WdWd -- ^ Effect when pressed
|
||||
-> Button
|
||||
makeButton col eff = defaultButton
|
||||
{ _btPict = DefaultDrawButton col
|
||||
, _btEvent = ButtonPress BtInactive ButtonDoNothing click1S eff
|
||||
{ _btEvent = ButtonPress BtInactive ButtonDoNothing click1S eff col
|
||||
, _btState = BtOff
|
||||
}
|
||||
|
||||
@@ -37,13 +36,13 @@ drawSwitchWire col1 col2 bt
|
||||
)
|
||||
|
||||
makeSwitchSPic
|
||||
:: ButtonDraw
|
||||
:: Color
|
||||
-> Color
|
||||
-> WdWd -- ^ Switch on effect
|
||||
-> WdWd -- ^ Switch off effect
|
||||
-> Button
|
||||
makeSwitchSPic dswitch effOn effOff = defaultButton
|
||||
{ _btPict = dswitch
|
||||
, _btEvent = ButtonSimpleSwith effOn effOff
|
||||
makeSwitchSPic c1 c2 effOn effOff = defaultButton
|
||||
{ _btEvent = ButtonSimpleSwith effOn effOff c1 c2
|
||||
, _btState = BtOff
|
||||
}
|
||||
|
||||
@@ -53,4 +52,4 @@ makeSwitch
|
||||
-> WdWd -- ^ Switch on effect
|
||||
-> WdWd -- ^ Switch off effect
|
||||
-> Button
|
||||
makeSwitch col1 col2 = makeSwitchSPic (DefaultDrawSwitch col1 col2)
|
||||
makeSwitch col1 col2 = makeSwitchSPic col1 col2
|
||||
|
||||
Reference in New Issue
Block a user