Added support for coloring unfocused windows different, part deux.#64
Added support for coloring unfocused windows different, part deux.#64bsneed wants to merge 4 commits intoflexagoon:mainfrom
Conversation
bsneed
commented
Nov 4, 2024
- Added config entries for Focused / Unfocused colors.
- Added specific callouts in the reset settings section.
- Fixed wording/typos.
- Refactored "border" to "focused_border".
- Refactored uniform to accept focus flag to pick correct setting.
src/effect/rounded_corners_effect.ts
Outdated
| const focusedBorderColor = getPref('focused-border-color'); | ||
| const unfocusedBorderColor = getPref('unfocused-border-color'); | ||
|
|
||
| var borderColor = focusedBorderColor; | ||
| if (!focused) { | ||
| borderColor = unfocusedBorderColor; | ||
| } |
There was a problem hiding this comment.
@flexagoon what's a good way to rework this to just get the right color? js isn't my forte. Elsewhere i'd do something like myColor = focused ? getPref('abc') : getPref('def')
There was a problem hiding this comment.
Elsewhere i'd do something like
myColor = focused ? getPref('abc') : getPref('def')
You can do the same in JS
There was a problem hiding this comment.
Well shit, who knew ... that was easy enough.
| #: src/preferences/pages/general.ui:74 src/preferences/pages/general.ui:82 | ||
| #, fuzzy | ||
| msgid "Unfocused border color" | ||
| msgstr "Barva okraje" |
There was a problem hiding this comment.
Why is this the same as the string for the focused border color? This applies to other potfiles as well
| #: src/preferences/pages/general.ui:27 | ||
| #, fuzzy | ||
| msgid "These settings will have effect on all windows" | ||
| msgid "These settings will have an effect on all windows" |
There was a problem hiding this comment.
Did you manually fix this typo? It's probably out of scope for this PR
| <key name="border-color" type="(dddd)"> | ||
| <summary>Border color for rounded corners window</summary> | ||
| <key name="focused-border-color" type="(dddd)"> | ||
| <summary>Border color for focused rounded corners window</summary> |
There was a problem hiding this comment.
I think you should re-use the existing border-color pref and use it for both border colors by default, and then have a separate focused-border-color pref that acts as an override if it's set to a non-null value
| <default>0</default> | ||
| </key> | ||
|
|
||
| <key name="border-color" type="(dddd)"> |
There was a problem hiding this comment.
If you're changing prefs schema, you should update the schema version in utils/settings.ts, and if you remove some keys you have to reset them in that same file (it has a function for that)
|
let me know if you need assistance with the PR. I would love to get the focus color setting :) |