From 188abc6add9afcafd96f7e965fed008f82b93d46 Mon Sep 17 00:00:00 2001 From: PMunch Date: Mon, 20 May 2024 11:27:54 +0200 Subject: [PATCH] Fix name and default --- src/nimdowpkg/config/configloader.nim | 12 +++++++----- src/nimdowpkg/statusbar.nim | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/nimdowpkg/config/configloader.nim b/src/nimdowpkg/config/configloader.nim index cdf6e16..fc31ef5 100644 --- a/src/nimdowpkg/config/configloader.nim +++ b/src/nimdowpkg/config/configloader.nim @@ -45,7 +45,7 @@ type fonts*: seq[string] showIndicator*: bool # Hex values - fgColor*, bgColor*, selectionColor*, urgentColor*, hasTagsColor*: int + fgColor*, bgColor*, selectionColor*, urgentColor*, hasWindowsColor: int transparency*: uint8 ScratchpadSettings* = object width*: int @@ -209,7 +209,7 @@ proc populateDefaultMonitorSettings(this: Config, display: PDisplay) = bgColor: 0x1c1b19, selectionColor: 0x519f50, urgentColor: 0xef2f27, - hasTagsColor: 0xfce8c3 + hasWindowsColor: 0xfce8c3 ) this.defaultMonitorSettings.layoutSettings = LayoutSettings( @@ -408,9 +408,11 @@ proc populateBarSettings*(this: Config, barSettings: var BarSettings, settingsTa if barTransparency.kind == TomlValueKind.Int: barSettings.transparency = clamp(barTransparency.intVal, 0, 255).uint8 - let hasTagsColor = this.loadHexValue(settingsTable, "barHasTagsColor") - if hasTagsColor != -1: - barSettings.hasTagsColor = hasTagsColor + let hasWindowsColor= this.loadHexValue(settingsTable, "barHasWindowsColor") + if hasWindowsColor!= -1: + barSettings.hasWindowsColor= hasWindowsColor + else: + barSettings.hasWindowsColor = fgColor if settingsTable.hasKey("barShowIndicator"): let showIndicator = settingsTable["barShowIndicator"] diff --git a/src/nimdowpkg/statusbar.nim b/src/nimdowpkg/statusbar.nim index 3143ffa..5627f70 100644 --- a/src/nimdowpkg/statusbar.nim +++ b/src/nimdowpkg/statusbar.nim @@ -46,7 +46,7 @@ type visual: PVisual depth: int colormap: Colormap - fgColor*, bgColor*, selectionColor*, urgentColor*, hasTagsColor*: XftColor + fgColor*, bgColor*, selectionColor*, urgentColor*, hasWindowsColor*: XftColor area*: Area systrayWidth: int clickables: seq[tuple[start: int, stop: int, characters: seq[int]]] @@ -269,7 +269,7 @@ proc freeAllColors(this: StatusBar) = this.freeColor(this.bgColor.unsafeAddr) this.freeColor(this.selectionColor.unsafeAddr) this.freeColor(this.urgentColor.unsafeAddr) - this.freeColor(this.hasTagsColor.unsafeAddr) + this.freeColor(this.hasWindowsColor.unsafeAddr) proc toRGB(hex: int): RGB = return ( @@ -293,7 +293,7 @@ proc configureColors(this: StatusBar) = this.configureColor(this.settings.bgColor, this.bgColor, this.settings.transparency) this.configureColor(this.settings.selectionColor, this.selectionColor) this.configureColor(this.settings.urgentColor, this.urgentColor) - this.configureColor(this.settings.hasTagsColor, this.hasTagsColor) + this.configureColor(this.settings.hasWindowsColor, this.hasWindowsColor) proc configureFont(this: StatusBar, fontString: string): PXftFont = result = XftFontOpenXlfd(this.display, this.screen, fontString) @@ -754,7 +754,7 @@ proc renderTags(this: var StatusBar): int = if this.selectedTags.contains(tagID): fgColor = this.selectionColor elif not tagIsEmpty: - fgColor = this.hasTagsColor + fgColor = this.hasWindowsColor let text = tagSettings.displayString let stringLength = this.forEachCharacter(text, textXPos, fgColor)