mirror of
https://github.com/fjvallarino/monomer.git
synced 2024-09-11 12:05:35 +03:00
Fix styling for button and dropdown
This commit is contained in:
parent
51362da960
commit
49bed0c564
2
.ghcid
2
.ghcid
@ -1,3 +1,3 @@
|
||||
--command "stack repl --main-is monomer:exe:tutorial"
|
||||
--command "stack repl --main-is monomer:exe:todo"
|
||||
--test ":main"
|
||||
--restart=package.yaml
|
||||
|
@ -29,13 +29,13 @@ buildUI wenv model = widgetTree where
|
||||
todoStatus = labelS (t ^. status)
|
||||
`style` [textSize 12, padding 4, paddingH 8, radius 12, bgColor todoBg, textColor todoFg]
|
||||
rowButton caption action = button caption action
|
||||
`style` [width 60, textColor gray, border 1 gray, bgColor transparent]
|
||||
`style` [width 65, textColor gray, border 1 gray, bgColor transparent]
|
||||
`hover` [bgColor editBgColor]
|
||||
`focus` [border 1 lightSkyBlue]
|
||||
todoRow = hstack [
|
||||
vstack [
|
||||
labelS (t ^. todoType) `style` [textSize 12, textColor darkGray],
|
||||
spacer,
|
||||
spacer_ [width 5],
|
||||
label (t ^. description) `style` [textThroughline_ todoDone]
|
||||
],
|
||||
filler,
|
||||
|
@ -269,12 +269,12 @@ makeDropdown widgetData items makeMain makeRow config state = widget where
|
||||
|
||||
createDropdown wenv node newState = newNode where
|
||||
selected = currentValue wenv
|
||||
themeStyle = collectTheme wenv L.dropdownStyle
|
||||
nodeStyle = _wnInfo node ^. L.style
|
||||
mainStyle = def
|
||||
& collectStyleField_ L.fgColor themeStyle
|
||||
& collectStyleField_ L.hlColor themeStyle
|
||||
& collectStyleField_ L.sndColor themeStyle
|
||||
& collectStyleField_ L.text themeStyle
|
||||
& collectStyleField_ L.fgColor nodeStyle
|
||||
& collectStyleField_ L.hlColor nodeStyle
|
||||
& collectStyleField_ L.sndColor nodeStyle
|
||||
& collectStyleField_ L.text nodeStyle
|
||||
mainNode = makeMain selected
|
||||
& L.info . L.style .~ mainStyle
|
||||
widgetId = node ^. L.info . L.widgetId
|
||||
|
@ -201,7 +201,8 @@ makeButton caption config = widget where
|
||||
|
||||
createChildNode wenv node = newNode where
|
||||
nodeStyle = node ^. L.info . L.style
|
||||
labelStyle = collectStyleField_ L.text nodeStyle def
|
||||
labelStyle = def
|
||||
& collectStyleField_ L.text nodeStyle
|
||||
& collectStyleField_ L.sizeReqW nodeStyle
|
||||
& collectStyleField_ L.sizeReqH nodeStyle
|
||||
labelNode = label_ caption [ignoreTheme, _btnLabelCfg config]
|
||||
@ -247,5 +248,7 @@ makeButton caption config = widget where
|
||||
newReqH = child ^. L.info . L.sizeReqH
|
||||
|
||||
resize wenv node viewport children = resized where
|
||||
style = getActiveStyle wenv node
|
||||
carea = removeOuterBounds style viewport
|
||||
assignedAreas = Seq.fromList [viewport]
|
||||
resized = (resultNode node, assignedAreas)
|
||||
|
Loading…
Reference in New Issue
Block a user