Skip to content

Add Setting for Changing Font in Settings Window #3470

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

Merged
merged 14 commits into from
Apr 23, 2025

Conversation

onesounds
Copy link
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.

This comment has been minimized.

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

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

This comment has been minimized.

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

This comment has been minimized.

@onesounds
Copy link
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.

This comment has been minimized.

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

@coderabbitai Review it please.

Copy link

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

Copy link

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.

Copy link
Contributor

coderabbitai bot commented Apr 19, 2025

📝 Walkthrough

Walkthrough

This change introduces a user-selectable font setting for the application's settings and related windows. A new SettingWindowFont property is added to the Settings class, and UI components such as settings, hotkey, shortcut, browser, and file manager windows are updated to bind their font family to this property. The about settings pane now includes a font selection ComboBox and reset functionality. Supporting infrastructure, including the Win32Helper.GetSystemDefaultFont method, is enhanced to better select system or Noto fonts based on culture. ViewModels and code-behind files are refactored to support these changes.

Changes

Files / Areas Change Summary
Flow.Launcher.Infrastructure/UserSettings/Settings.cs, Flow.Launcher.Infrastructure/Win32Helper.cs Added SettingWindowFont property to Settings and enhanced GetSystemDefaultFont to support Noto font selection and a useNoto parameter.
Flow.Launcher/CustomQueryHotkeySetting.xaml, Flow.Launcher/CustomShortcutSetting.xaml, Flow.Launcher/SelectBrowserWindow.xaml, Flow.Launcher/SelectFileManagerWindow.xaml, Flow.Launcher/SettingWindow.xaml Added two-way binding for FontFamily property to Settings.SettingWindowFont in each window's XAML, enabling dynamic font updates. Margin and padding attributes reformatted for consistency.
Flow.Launcher/CustomQueryHotkeySetting.xaml.cs, Flow.Launcher/CustomShortcutSetting.xaml.cs, Flow.Launcher/ViewModel/SettingWindowViewModel.cs Refactored to use a public Settings property instead of private fields, and added dependency injection for Settings where needed.
Flow.Launcher/SelectBrowserWindow.xaml.cs, Flow.Launcher/SelectFileManagerWindow.xaml.cs Refactored to use [INotifyPropertyChanged] attribute for property change notifications, removing explicit interface implementation and event declarations.
Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs, Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml Added SettingWindowFont property and reset command to the About settings pane ViewModel and UI. Introduced a ComboBox for font selection and a reset button, grouped in an "Advanced" expandable card. Added a CollectionViewSource for sorted font families.
Flow.Launcher/Languages/en.xaml Added a new string resource for "Setting Window Font" to support localization in the UI.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SettingsPaneAboutViewModel
    participant Settings
    participant Win32Helper
    participant UI_Window

    User->>UI_Window: Opens Settings/About
    UI_Window->>Settings: Get SettingWindowFont
    UI_Window->>SettingsPaneAboutViewModel: Bind SettingWindowFont
    User->>UI_Window: Selects new font in ComboBox
    UI_Window->>SettingsPaneAboutViewModel: Update SettingWindowFont
    SettingsPaneAboutViewModel->>Settings: Set SettingWindowFont
    Settings->>UI_Window: Notify property changed
    UI_Window->>UI_Window: Font updates dynamically

    User->>UI_Window: Clicks Reset Font
    UI_Window->>SettingsPaneAboutViewModel: ResetSettingWindowFontCommand
    SettingsPaneAboutViewModel->>Win32Helper: GetSystemDefaultFont(false)
    Win32Helper-->>SettingsPaneAboutViewModel: Return system font
    SettingsPaneAboutViewModel->>Settings: Set SettingWindowFont to default
    Settings->>UI_Window: Notify property changed
    UI_Window->>UI_Window: Font resets to default
Loading

Assessment against linked issues

Objective Addressed Explanation
Make the font of the user interface changeable (#2526)
Add a font selection UI and allow resetting to system default (#2526)
Bind font setting to relevant windows for dynamic update (#2526)
Use system or Noto fonts appropriately for different languages (#2526)

Possibly related PRs

  • #3458: Modifies default font handling and selection logic in the Settings class, closely related to this PR's addition of a user-selectable font property.
  • #3248: Refactors the CustomQueryHotkeySetting class's handling of the Settings property, which is also refactored in this PR.

Suggested labels

enhancement, kind/ui

Suggested reviewers

  • onesounds

Poem

In windows wide, a font anew,
Now you can choose the style you view!
From Noto's grace to Segoe's flair,
The settings pane lets you compare.
With a click or two, the font will change—
For every bunny, a wider range!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3509c3 and f4f8e9a.

📒 Files selected for processing (3)
  • Flow.Launcher/CustomQueryHotkeySetting.xaml.cs (3 hunks)
  • Flow.Launcher/CustomShortcutSetting.xaml.cs (1 hunks)
  • Flow.Launcher/ViewModel/SettingWindowViewModel.cs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Flow.Launcher/CustomShortcutSetting.xaml.cs
🚧 Files skipped from review as they are similar to previous changes (2)
  • Flow.Launcher/ViewModel/SettingWindowViewModel.cs
  • Flow.Launcher/CustomQueryHotkeySetting.xaml.cs
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml.cs (1)

35-50: Translate Korean comment to English for consistency.

The event handler implementation is correct and effectively updates both the model and UI immediately. However, there's a comment in Korean that should be translated to English for consistency.

-                // 설정 창 글꼴 즉시 업데이트
+                // Immediately update settings window font
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f9e8139 and 942b290.

📒 Files selected for processing (16)
  • Flow.Launcher.Infrastructure/UserSettings/Settings.cs (2 hunks)
  • Flow.Launcher.Infrastructure/Win32Helper.cs (1 hunks)
  • Flow.Launcher/CustomQueryHotkeySetting.xaml (1 hunks)
  • Flow.Launcher/CustomQueryHotkeySetting.xaml.cs (2 hunks)
  • Flow.Launcher/CustomShortcutSetting.xaml.cs (2 hunks)
  • Flow.Launcher/Languages/en.xaml (1 hunks)
  • Flow.Launcher/SelectBrowserWindow.xaml (11 hunks)
  • Flow.Launcher/SelectBrowserWindow.xaml.cs (1 hunks)
  • Flow.Launcher/SelectFileManagerWindow.xaml (1 hunks)
  • Flow.Launcher/SelectFileManagerWindow.xaml.cs (1 hunks)
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs (1 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml (2 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml.cs (2 hunks)
  • Flow.Launcher/SettingWindow.xaml (1 hunks)
  • Flow.Launcher/SettingWindow.xaml.cs (1 hunks)
  • Flow.Launcher/ViewModel/SettingWindowViewModel.cs (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (6)
Flow.Launcher/CustomQueryHotkeySetting.xaml.cs (3)
Flow.Launcher/SelectBrowserWindow.xaml.cs (1)
  • OnPropertyChanged (30-33)
Flow.Launcher/SelectFileManagerWindow.xaml.cs (1)
  • OnPropertyChanged (32-35)
Flow.Launcher/CustomShortcutSetting.xaml.cs (1)
  • OnPropertyChanged (34-37)
Flow.Launcher/SelectFileManagerWindow.xaml.cs (3)
Flow.Launcher/SelectBrowserWindow.xaml.cs (1)
  • OnPropertyChanged (30-33)
Flow.Launcher/CustomQueryHotkeySetting.xaml.cs (1)
  • OnPropertyChanged (32-35)
Flow.Launcher/CustomShortcutSetting.xaml.cs (1)
  • OnPropertyChanged (34-37)
Flow.Launcher/ViewModel/SettingWindowViewModel.cs (1)
Flow.Launcher.Infrastructure/UserSettings/Settings.cs (1)
  • Settings (15-438)
Flow.Launcher/SelectBrowserWindow.xaml.cs (3)
Flow.Launcher/SelectFileManagerWindow.xaml.cs (1)
  • OnPropertyChanged (32-35)
Flow.Launcher/CustomQueryHotkeySetting.xaml.cs (1)
  • OnPropertyChanged (32-35)
Flow.Launcher/CustomShortcutSetting.xaml.cs (1)
  • OnPropertyChanged (34-37)
Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml.cs (2)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs (2)
  • SettingsPaneAboutViewModel (16-291)
  • SettingsPaneAboutViewModel (78-83)
Flow.Launcher/SettingWindow.xaml.cs (2)
  • SettingWindow (17-205)
  • SettingWindow (22-30)
Flow.Launcher/CustomShortcutSetting.xaml.cs (3)
Flow.Launcher/SelectBrowserWindow.xaml.cs (1)
  • OnPropertyChanged (30-33)
Flow.Launcher/SelectFileManagerWindow.xaml.cs (1)
  • OnPropertyChanged (32-35)
Flow.Launcher/CustomQueryHotkeySetting.xaml.cs (1)
  • OnPropertyChanged (32-35)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (25)
Flow.Launcher/Languages/en.xaml (1)

359-359: Good addition of the new setting string resource.

The new localization string for "Setting Window Font" has been correctly added to the English language resource dictionary, ensuring the UI has proper text for this new feature.

Flow.Launcher.Infrastructure/Win32Helper.cs (2)

631-640: Well-documented enhancement to the font selection logic.

The method signature update with the optional useNoto parameter is well-documented with XML comments and provides a good default value. This enhancement allows for culture-sensitive font selection.


644-658: Good implementation of culture-aware font selection logic.

The implementation correctly checks for Noto fonts matching the current culture by first trying the full language name, then falling back to the language prefix. It also verifies that the font is actually installed on the system before returning it.

Flow.Launcher/SettingWindow.xaml.cs (1)

6-6: Necessary import for font-related functionality.

Adding the System.Windows.Media namespace is required to access the FontFamily class and other font-related functionality needed for the new font setting.

Flow.Launcher/SelectFileManagerWindow.xaml (2)

13-13: Good implementation of two-way font binding.

The FontFamily property is correctly bound to the SettingWindowFont property with two-way binding, ensuring that font changes will be properly reflected in this window.


1-264:

✅ Verification successful

Verify consistent font binding across all relevant windows.

Make sure that similar FontFamily bindings have been added to all other windows that should reflect the font setting (like CustomQueryHotkeySetting.xaml, SelectBrowserWindow.xaml, etc.).


🏁 Script executed:

#!/bin/bash
# Check for FontFamily bindings in all XAML files
echo "Checking for FontFamily bindings in XAML files..."
grep -r "FontFamily=\"{Binding SettingWindowFont" --include="*.xaml" . || echo "No FontFamily bindings found"

# Check for SettingWindowFont property implementation in code-behind files
echo -e "\nChecking for SettingWindowFont property in code-behind files..."
grep -r "SettingWindowFont" --include="*.cs" . | grep -v "Win32Helper.cs" || echo "No SettingWindowFont properties found"

Length of output: 4444


Consistent FontFamily Bindings Verified

All relevant XAML windows now include the same FontFamily binding:

  • CustomQueryHotkeySetting.xaml
  • SelectBrowserWindow.xaml
  • SelectFileManagerWindow.xaml
  • SettingWindow.xaml

No missing or inconsistent FontFamily="{Binding SettingWindowFont…}" entries remain.

Flow.Launcher/CustomQueryHotkeySetting.xaml (1)

7-7: Good font binding implementation.

The addition of FontFamily binding to SettingWindowFont enables dynamic font customization for this window, consistent with the application's new font customization feature.

Flow.Launcher/SettingWindow.xaml (1)

16-16: Good font binding implementation.

The addition of FontFamily binding to SettingWindowFont enables dynamic font customization for the settings window, consistent with the application's new font customization feature.

Flow.Launcher/SelectBrowserWindow.xaml (2)

13-13: Good font binding implementation.

The addition of FontFamily binding to SettingWindowFont enables dynamic font customization for the browser selection window, consistent with the application's new font customization feature.


58-59: Consistent margin formatting improvement.

The margin format has been standardized from comma-separated to space-separated values throughout the XAML, which improves consistency and readability.

Also applies to: 62-62, 77-77, 88-88, 100-101, 104-105, 112-113, 133-134, 151-152, 163-164, 180-182, 188-189, 191-192, 195-196, 201-202, 209-210, 216-217, 219-220, 241-242, 246-247, 252-253

Flow.Launcher.Infrastructure/UserSettings/Settings.cs (1)

99-99: Good implementation of setting window font property.

The SettingWindowFont property is correctly initialized with the system default font using the specialized version of GetSystemDefaultFont that can prefer Noto fonts based on culture when the false parameter is passed.

One thing to note is that this property is using a different initialization approach (passing false to GetSystemDefaultFont) compared to other font properties like QueryBoxFont, ResultFont, and ResultSubFont, which don't pass any parameters. This is intentional based on the PR description to provide better font support for localization and accessibility needs.

Flow.Launcher/SelectBrowserWindow.xaml.cs (2)

18-29: LGTM! Property implementation with change notification.

The SettingWindowFont property implementation correctly wraps the Settings.SettingWindowFont with proper change notification logic.


30-33: Well-implemented helper method for property change notifications.

This helper method properly encapsulates the property change notification logic, following the same pattern used in other window classes.

Flow.Launcher/SelectFileManagerWindow.xaml.cs (2)

20-31: LGTM! Property implementation with change notification.

The SettingWindowFont property implementation correctly wraps the Settings.SettingWindowFont with proper change notification logic, consistent with the implementation in other window classes.


32-35: Well-implemented helper method for property change notifications.

This helper method properly encapsulates the property change notification logic, following the same pattern used in other window classes.

Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs (2)

272-283: LGTM! Property correctly implements change notification.

The SettingWindowFont property implementation correctly wraps the _settings.SettingWindowFont with proper change notification.


285-290: Reset command now correctly uses the property setter.

The implementation now properly uses the SettingWindowFont property setter rather than directly modifying _settings.SettingWindowFont, ensuring that property change notifications are triggered.

Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml.cs (1)

1-3: LGTM! Required using directives.

These using directives are necessary for the new font selection functionality.

Flow.Launcher/CustomQueryHotkeySetting.xaml.cs (2)

17-35: Clean implementation of INotifyPropertyChanged interface

The implementation of the INotifyPropertyChanged interface is correct and follows standard patterns. The property change notification is properly triggered only when the value actually changes.


19-30: Effectively wraps Settings property with change notification

The SettingWindowFont property correctly wraps the _settings.SettingWindowFont field, ensuring that property change notifications are dispatched when needed. This implementation properly supports the data binding mechanism required for dynamic font updates.

Flow.Launcher/CustomShortcutSetting.xaml.cs (1)

34-37: Correct implementation of OnPropertyChanged method

The OnPropertyChanged method is implemented correctly with a null-conditional operator to prevent NullReferenceException.

Flow.Launcher/ViewModel/SettingWindowViewModel.cs (1)

49-60: Properly implemented SettingWindowFont property with change notification

The SettingWindowFont property correctly wraps the _settings.SettingWindowFont with property change notification.

Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml (3)

15-19: Well-structured resource setup for system fonts

The CollectionViewSource is an appropriate approach for binding to system fonts.


135-168: Effectively organizes settings with the new ExCard

The UI organization groups related advanced settings together, which is more maintainable. The font selection control provides both a reset button and a dropdown, giving users appropriate options.

One suggestion: Consider adding a tooltip to the Reset button explaining that it will revert to the system default font, as users might not understand exactly what "Reset" means in this context.

-<Button Command="{Binding ResetSettingWindowFontCommand}" Content="Reset" />
+<Button Command="{Binding ResetSettingWindowFontCommand}" Content="Reset" ToolTip="Restore to system default font" />

155-165:

✅ Verification successful

Verify font change handling in ComboBox selection

Make sure the SettingWindowFontComboBox_SelectionChanged event handler is implemented in the code-behind file to properly handle font changes. This event handler is crucial for applying font changes immediately.

Run the following script to verify the event handler implementation:


🏁 Script executed:

#!/bin/bash
# Check if the SelectionChanged event handler is implemented

echo "Searching for SettingWindowFontComboBox_SelectionChanged implementation..."
rg -A 5 "SettingWindowFontComboBox_SelectionChanged" --type csharp

Length of output: 875


SelectionChanged event handler is present and wired correctly
The SettingWindowFontComboBox_SelectionChanged method is implemented in SettingsPaneAbout.xaml.cs and updates the view model when a new font is selected. No further action is needed.

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

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

This comment has been minimized.

This comment has been minimized.

@onesounds
Copy link
Contributor Author

@coderabbitai Review it.

Copy link
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!

This comment has been minimized.

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

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

Copy link

@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.
2 participants