Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bsneed
Copy link

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

@@ -77,7 +77,7 @@ msgstr "Globální nastavení"

#: 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
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
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

@@ -35,8 +35,13 @@
<default>0</default>
</key>

<key name="border-color" type="(dddd)">
Copy link
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

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