summaryrefslogtreecommitdiff
path: root/config/config.go
diff options
context:
space:
mode:
authorChris Vittal <chris@vittal.dev>2020-10-27 14:56:44 -0400
committerReto Brunner <reto@labrat.space>2020-11-01 09:50:58 +0100
commitf9bba3d17d4ac8c12e01adccc06566a46546e995 (patch)
tree3d96a7e74f668739544ffe45b70cc96696dd4f99 /config/config.go
parent743683a0c19c75ba87d65b6d0c9be117d0224a3e (diff)
downloadaerc-f9bba3d17d4ac8c12e01adccc06566a46546e995.zip
Apply relevant msglist styles in order
Allow styles to be layered over a base style. The list of styles to apply is layered over the base style in order, such that if the layer does not differ from the base it is not used. The order that these styles are applied in is, from first to last: msglist_default msglist_unread msglist_read (exclusive with unread, so technically the same level) msglist_flagged msglist_deleted msglist_marked So, msglist_marked style dominates. This fixes an issue where the msglist_deleted style was not being applied.
Diffstat (limited to 'config/config.go')
-rw-r--r--config/config.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go
index 3ae26c1..bb83579 100644
--- a/config/config.go
+++ b/config/config.go
@@ -699,3 +699,12 @@ func (uiConfig UIConfig) GetStyle(so StyleObject) tcell.Style {
func (uiConfig UIConfig) GetStyleSelected(so StyleObject) tcell.Style {
return uiConfig.style.Selected(so)
}
+
+func (uiConfig UIConfig) GetComposedStyle(base StyleObject,
+ styles []StyleObject) tcell.Style {
+ return uiConfig.style.Compose(base, styles)
+}
+
+func (uiConfig UIConfig) GetComposedStyleSelected(base StyleObject, styles []StyleObject) tcell.Style {
+ return uiConfig.style.ComposeSelected(base, styles)
+}