Skip to content

Add Setting for Changing Font in Settings Window#3470

Merged
onesounds merged 14 commits intoFlow-Launcher:devfrom
onesounds:250412-SettingWindowFont
Apr 23, 2025
Merged

Add Setting for Changing Font in Settings Window#3470
onesounds merged 14 commits intoFlow-Launcher:devfrom
onesounds:250412-SettingWindowFont

Conversation

@onesounds
Copy link
Copy Markdown
Contributor

@onesounds onesounds commented Apr 17, 2025

What's the PR

Although changing the font of the Settings window is an uncommon requirement, it has been requested multiple times and can be necessary in specific use cases (e.g., accessibility or localization issues).

This PR adds an option to change the font used in the Settings window.
To avoid cluttering the main settings, this option is intentionally placed in a less prominent location.

Todo

  • Add strings
  • Apply changes immediately and update the combo box when the reset button is clicked
  • Check other popup windows

This PR continues from #3458.

@github-actions

This comment has been minimized.

@Jack251970 Jack251970 requested a review from Copilot April 19, 2025 03:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a configurable font setting specifically for the Settings window to address user requests for accessibility and localization improvements.

  • Added a new string property for SettingWindowFont in the ViewModel and the underlying Settings.
  • Implemented UI changes including a ComboBox selection handler and immediate font updates.
  • Added a reset command and a method for retrieving the system default font.

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Flow.Launcher/ViewModel/SettingWindowViewModel.cs Added SettingWindowFont property with change notification.
Flow.Launcher/SettingWindow.xaml.cs Imported Media namespace to support font updates.
Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml.cs Added a ComboBox selection handler to update the window's font immediately.
Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs Added SettingWindowFont property and a reset command for font settings.
Flow.Launcher.Infrastructure/UserSettings/Settings.cs Introduced SettingWindowFont with a default value from GetSystemDefaultFont.
Files not reviewed (2)
  • Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml: Language not supported
  • Flow.Launcher/SettingWindow.xaml: Language not supported

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Jack251970 Jack251970 requested a review from Copilot April 19, 2025 03:25
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an option to change the font used in the Settings window to support accessibility and localization needs. Key changes include:

  • Introducing a new SettingWindowFont property (with proper property change notifications) in multiple view models.
  • Updating the UI (via an event handler) to immediately reflect the font change.
  • Enhancing the helper method GetSystemDefaultFont to accept an optional parameter for using the Noto font.

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Flow.Launcher/ViewModel/SettingWindowViewModel.cs Added SettingWindowFont property with property change notification.
Flow.Launcher/SettingWindow.xaml.cs Added using directive for System.Windows.Media.
Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml.cs Introduced a ComboBox SelectionChanged handler to update the font.
Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs Added SettingWindowFont property and a reset command for the font.
Flow.Launcher/Infrastructure/Win32Helper.cs Modified GetSystemDefaultFont to accept a boolean parameter for Noto.
Flow.Launcher.Infrastructure/UserSettings/Settings.cs Added SettingWindowFont property with a default value from Win32Helper.
Files not reviewed (2)
  • Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml: Language not supported
  • Flow.Launcher/SettingWindow.xaml: Language not supported

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@onesounds
Copy link
Copy Markdown
Contributor Author

Font settings such as FontFamily are not applied to elements like ComboBox or Button. Since applying this setting for every individual window would require too much work, I’ve decided to skip this part.

@github-actions

This comment has been minimized.

@onesounds onesounds marked this pull request as ready for review April 19, 2025 06:43
@onesounds
Copy link
Copy Markdown
Contributor Author

@coderabbitai Review it please.

@gitstream-cm
Copy link
Copy Markdown

gitstream-cm bot commented Apr 19, 2025

🥷 Code experts: Jack251970, Yusyuriv

Jack251970, onesounds have most 👩‍💻 activity in the files.
Jack251970, onesounds have most 🧠 knowledge in the files.

See details

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Activity based on git-commit:

Jack251970 onesounds
APR 16 additions & 79 deletions 90 additions & 29 deletions
MAR 142 additions & 94 deletions 10 additions & 0 deletions
FEB 10 additions & 4 deletions
JAN 17 additions & 4 deletions
DEC 1 additions & 1 deletions
NOV

Knowledge based on git-blame:
onesounds: 23%
Jack251970: 18%

Flow.Launcher.Infrastructure/Win32Helper.cs

Activity based on git-commit:

Jack251970 onesounds
APR 180 additions & 23 deletions 4 additions & 0 deletions
MAR 581 additions & 226 deletions
FEB 13 additions & 16 deletions 22 additions & 0 deletions
JAN 0 additions & 138 deletions
DEC 243 additions & 4 deletions
NOV

Knowledge based on git-blame:
Jack251970: 94%

Flow.Launcher/CustomQueryHotkeySetting.xaml

Activity based on git-commit:

Jack251970 onesounds
APR
MAR 14 additions & 14 deletions
FEB 1 additions & 4 deletions
JAN
DEC
NOV

Knowledge based on git-blame:
onesounds: 51%
Jack251970: 9%

Flow.Launcher/CustomQueryHotkeySetting.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR 3 additions & 5 deletions
MAR
FEB 15 additions & 15 deletions
JAN 2 additions & 5 deletions
DEC
NOV 2 additions & 2 deletions

Knowledge based on git-blame:
Jack251970: 24%
onesounds: 14%

Flow.Launcher/CustomShortcutSetting.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR 4 additions & 6 deletions
MAR
FEB 8 additions & 9 deletions
JAN 2 additions & 2 deletions
DEC
NOV 3 additions & 2 deletions

Knowledge based on git-blame:
Jack251970: 7%

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

Jack251970 onesounds
APR 21 additions & 21 deletions 39 additions & 17 deletions
MAR 67 additions & 42 deletions 8 additions & 3 deletions
FEB 15 additions & 9 deletions
JAN 1 additions & 0 deletions
DEC
NOV

Knowledge based on git-blame:
onesounds: 43%
Jack251970: 10%

Flow.Launcher/SelectBrowserWindow.xaml

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB 1 additions & 4 deletions
JAN
DEC
NOV

Knowledge based on git-blame:
onesounds: 97%

Flow.Launcher/SelectBrowserWindow.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
onesounds: 38%

Flow.Launcher/SelectFileManagerWindow.xaml

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB 1 additions & 4 deletions
JAN
DEC
NOV

Knowledge based on git-blame:
onesounds: 95%

Flow.Launcher/SelectFileManagerWindow.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
onesounds: 33%

Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs

Activity based on git-commit:

Jack251970 onesounds
APR 134 additions & 30 deletions
MAR 27 additions & 2 deletions
FEB 7 additions & 8 deletions
JAN 2 additions & 2 deletions
DEC
NOV 2 additions & 3 deletions

Knowledge based on git-blame:
Jack251970: 55%
onesounds: 2%

Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml

Activity based on git-commit:

Jack251970 onesounds
APR 4 additions & 0 deletions
MAR 9 additions & 1 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
onesounds: 52%
Jack251970: 8%

Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR 6 additions & 4 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
onesounds: 29%
Jack251970: 19%

Flow.Launcher/SettingWindow.xaml

Activity based on git-commit:

Jack251970 onesounds
APR 1 additions & 1 deletions
MAR 3 additions & 0 deletions
FEB
JAN
DEC
NOV 1 additions & 0 deletions

Knowledge based on git-blame:
onesounds: 91%

Flow.Launcher/SettingWindow.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR 1 additions & 4 deletions
MAR 9 additions & 18 deletions
FEB
JAN 14 additions & 8 deletions
DEC
NOV 22 additions & 2 deletions

Knowledge based on git-blame:
Jack251970: 19%
onesounds: 12%

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB 2 additions & 3 deletions
JAN 19 additions & 38 deletions
DEC
NOV

Knowledge based on git-blame:
Jack251970: 11%
onesounds: 9%

To learn more about /:\ gitStream - Visit our Docs

@gitstream-cm
Copy link
Copy Markdown

gitstream-cm bot commented Apr 19, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

@Jack251970 Jack251970 requested a review from Copilot April 23, 2025 02:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a customizable font setting for the Settings window, enabling users to change the font for accessibility or localization reasons. Key changes include:

  • Adding a new SettingWindowFont property in various view models and windows.
  • Implementing a font reset command in the SettingsPaneAboutViewModel.
  • Initializing the default font via an update in Win32Helper and UserSettings.

Reviewed Changes

Copilot reviewed 10 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Flow.Launcher/ViewModel/SettingWindowViewModel.cs Introduces the SettingWindowFont property with INotifyPropertyChanged implementation.
Flow.Launcher/SettingWindow.xaml.cs Adds the necessary using directive for System.Windows.Media.
Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml.cs Implements font update on combo box selection to update the Settings window immediately.
Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs Adds the SettingWindowFont property and a reset command for changing the font.
Flow.Launcher/SelectFileManagerWindow.xaml.cs Adds a SettingWindowFont property implementation with property change notifications.
Flow.Launcher/SelectBrowserWindow.xaml.cs Introduces the SettingWindowFont property with its notification logic.
Flow.Launcher/CustomShortcutSetting.xaml.cs Adds a SettingWindowFont property, but the _settings field is declared without initialization.
Flow.Launcher/CustomQueryHotkeySetting.xaml.cs Adds a SettingWindowFont property and the corresponding property change notifications.
Flow.Launcher.Infrastructure/Win32Helper.cs Updates GetSystemDefaultFont to include an optional parameter with XML docs.
Flow.Launcher.Infrastructure/UserSettings/Settings.cs Adds a new SettingWindowFont property with a default value from Win32Helper.
Files not reviewed (6)
  • Flow.Launcher/CustomQueryHotkeySetting.xaml: Language not supported
  • Flow.Launcher/Languages/en.xaml: Language not supported
  • Flow.Launcher/SelectBrowserWindow.xaml: Language not supported
  • Flow.Launcher/SelectFileManagerWindow.xaml: Language not supported
  • Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml: Language not supported
  • Flow.Launcher/SettingWindow.xaml: Language not supported
Comments suppressed due to low confidence (1)

Flow.Launcher/CustomShortcutSetting.xaml.cs:38

  • The private readonly _settings field is declared but never initialized in the constructor. Consider assigning it from the provided view model (for example, _settings = vm.Settings) to ensure the SettingWindowFont property works as intended.
public CustomShortcutSetting(SettingsPaneHotkeyViewModel vm)

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@onesounds
Copy link
Copy Markdown
Contributor Author

@coderabbitai Review it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 23, 2025

Tip

For best results, initiate chat on the files or code changes.

@onesounds I've reviewed the PR that adds font customization for the Settings window, and I'm impressed with the implementation. The changes are well-structured and thoughtfully designed:

  • The font setting is appropriately placed in the "Advanced" section, keeping the main UI clean
  • The property is properly added to the Settings class with a sensible default value
  • Font family binding is consistently implemented across affected windows
  • The font selector UI is comprehensive with a complete list of system fonts and a reset button
  • Changes apply immediately when a font is selected, providing good user feedback
  • The enhanced GetSystemDefaultFont method with the useNoto parameter improves culture support

Regarding the limitation of font settings not applying to ComboBox or Button elements - this is a reasonable decision given the complexity it would add to style every individual control. The current approach delivers the key benefits while keeping the implementation scope manageable.

Overall, this is a solid implementation that effectively addresses the accessibility and localization needs mentioned in issue #2526. Great work!

(_/)
(^.^)
/> ✓


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@github-actions

This comment has been minimized.

@Jack251970 Jack251970 requested a review from Copilot April 23, 2025 04:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an option to change the font used in the Settings window to support accessibility and localization needs.

  • Introduces a new SettingWindowFont property and a reset command in the About settings view model.
  • Refactors several view models and settings classes to replace a private _settings field with a public Settings property.
  • Updates Win32Helper to support a Noto font lookup via a new method parameter.

Reviewed Changes

Copilot reviewed 8 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Flow.Launcher/ViewModel/SettingWindowViewModel.cs Exposes the settings instance publicly instead of a private field.
Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs Adds SettingWindowFont property and a reset command for font resetting.
Flow.Launcher/SelectFileManagerWindow.xaml.cs Updates the INotifyPropertyChanged implementation with toolkit attribute.
Flow.Launcher/SelectBrowserWindow.xaml.cs Similar update to INotifyPropertyChanged using the toolkit attribute.
Flow.Launcher/CustomShortcutSetting.xaml.cs Refines dependency injection and property initializations.
Flow.Launcher/CustomQueryHotkeySetting.xaml.cs Adjusts settings usage in updating custom hotkeys.
Flow.Launcher/Infrastructure/Win32Helper.cs Modifies GetSystemDefaultFont to include a useNoto parameter.
Flow.Launcher/Infrastructure/UserSettings/Settings.cs Adds the SettingWindowFont property with change notification.
Files not reviewed (7)
  • Flow.Launcher/CustomQueryHotkeySetting.xaml: Language not supported
  • Flow.Launcher/CustomShortcutSetting.xaml: Language not supported
  • Flow.Launcher/Languages/en.xaml: Language not supported
  • Flow.Launcher/SelectBrowserWindow.xaml: Language not supported
  • Flow.Launcher/SelectFileManagerWindow.xaml: Language not supported
  • Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml: Language not supported
  • Flow.Launcher/SettingWindow.xaml: Language not supported
Comments suppressed due to low confidence (1)

Flow.Launcher/CustomQueryHotkeySetting.xaml.cs:15

  • [nitpick] The flag 'update' is somewhat ambiguous. Consider renaming it to 'isUpdating' (or another descriptive name) to improve code clarity.
private bool update;

@github-actions
Copy link
Copy Markdown

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

❌ Errors Count
❌ forbidden-pattern 22
⚠️ non-alpha-in-dictionary 19

See ❌ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

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

Labels

enhancement New feature or request kind/ui related to UI, icons, themes, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Recommendation] font change for user interface layout.

3 participants