Skip to content

Added support for coloring unfocused windows different, part deux.#64

Open
bsneed wants to merge 4 commits intoflexagoon:mainfrom
bsneed:bsneed/unfocused
Open

Added support for coloring unfocused windows different, part deux.#64
bsneed wants to merge 4 commits intoflexagoon:mainfrom
bsneed:bsneed/unfocused

Conversation

@bsneed
Copy link
Copy Markdown

@bsneed 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.

Comment on lines +71 to +77
const focusedBorderColor = getPref('focused-border-color');
const unfocusedBorderColor = getPref('unfocused-border-color');

var borderColor = focusedBorderColor;
if (!focused) {
borderColor = unfocusedBorderColor;
}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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')

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elsewhere i'd do something like myColor = focused ? getPref('abc') : getPref('def')

You can do the same in JS

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)">
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@lordgreg
Copy link
Copy Markdown

lordgreg commented Nov 8, 2024

let me know if you need assistance with the PR. I would love to get the focus color setting :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants