Skip to content

Add modal settings page to control brightness, visibility, and which buttons appear in the control window#68

Open
garrettcampbell3 wants to merge 5 commits into
shanselman:masterfrom
garrettcampbell3:dev/gcampbell/AddSettingsPage
Open

Add modal settings page to control brightness, visibility, and which buttons appear in the control window#68
garrettcampbell3 wants to merge 5 commits into
shanselman:masterfrom
garrettcampbell3:dev/gcampbell/AddSettingsPage

Conversation

@garrettcampbell3

@garrettcampbell3 garrettcampbell3 commented Jun 19, 2026

Copy link
Copy Markdown

Add Settings Window

Adds a new Settings window accessible via a gear button (⚙️) on the control bar. The settings window opens as a modal dialog and provides fine-grained controls that go beyond the toolbar buttons.

New Settings Window Features

  • Brightness — slider (20%–100%) for precise adjustment
  • Color Temperature — slider (cool ↔ warm) with visual labels
  • Exclude from Screen Capture — toggle to hide edge light from screenshots/Teams
  • Control Bar Buttons — choose which buttons appear in the floating control bar: - Brightness buttons
  • Color temperature buttons
  • Window control buttons (toggle, switch monitor, all monitors)

Changes

  • SettingsWindow.xaml / .xaml.cs — new resizable settings window with card-based Fluent UI
  • AppSettings.cs — added ShowBrightnessButtons, ShowColorTempButtons, ShowWindowControlButtons persisted settings
  • ControlWindow.xaml / .xaml.cs — gear button wired up; button visibility updates immediately when settings change
  • MainWindow.xaml.cs — added SetBrightness(), GetBrightness(), GetColorTemperature(), GetSettings() public APIs; refactored brightness methods to use SetBrightness

Screenshots

image

Control Window with various settings disabled/enabled

Without brightness

image

Without warmth

image

Without monitor control

image

Without any

image

Previously, only ExcludeFromCapture was saved to settings.json. Brightness,
color temperature, and on/off state reset to defaults on every app restart.

Changes:
- AppSettings: add IsLightOn, Brightness, and ColorTemperature properties
- MainWindow: read persisted values after loading settings in constructor
- MainWindow: save settings after every brightness, color temp, or toggle change
- Window_Loaded: apply persisted opacity, color temperature, and visibility

No breaking changes - existing settings.json files gain the new fields with
their default values (IsLightOn=true, Brightness=1.0, ColorTemperature=0.5).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@garrettcampbell3 garrettcampbell3 changed the title Add model settings page to control brightness, visibility, and which buttons appear in the control window Add modal settings page to control brightness, visibility, and which buttons appear in the control window Jun 19, 2026
@shanselman

Copy link
Copy Markdown
Owner

Thanks for this, Garrett — the settings window is a useful direction, and I like the idea of making brightness/color/exclude/buttons discoverable instead of only toolbar/hotkey driven.

I took a deep pass over this alongside the persistence work and I don't want to merge it as-is yet. Could you please rebase after the current settings-persistence changes land and tighten up the following items?

Required before merge

  1. Hide the toggle button when window controls are disabled

    The setting text says the window control group covers toggle/switch/all-monitor buttons, and the XAML names ToggleLightButton, but ApplyButtonVisibility() only hides SwitchMonitorButton and AllMonitorsButton.

    Suggested fix:

    ToggleLightButton.Visibility = windowCtrlVis;
    SwitchMonitorButton.Visibility = windowCtrlVis;
    AllMonitorsButton.Visibility = windowCtrlVis;
  2. Rebase onto the persistence implementation and use one persisted path for sliders

    Brightness/color/on-off state now persist, with clamping for bad settings values. After rebasing, make sure the settings sliders call the same persistence-aware methods used by hotkeys/buttons. In particular:

    • brightness slider changes should update the live UI and save the clamped value
    • color-temperature slider changes should update the live UI, all monitor windows, and save the clamped value
    • no path should write raw NaN, Infinity, or out-of-range values into settings
  3. Avoid exposing the mutable AppSettings object directly if possible

    GetSettings() => settings works, but it couples the settings dialog to the whole settings object. Prefer narrow APIs on MainWindow, for example:

    public bool ShowBrightnessButtons => settings.ShowBrightnessButtons;
    public void SetShowBrightnessButtons(bool value) { ... save ... }

    Same idea for color-temp buttons and window-control buttons. That keeps persistence, validation, and future side effects centralized.

  4. Clean up unrelated diff noise

    There is an accidental indentation change in MoveToNextMonitor() around double newLeft = .... Please revert that hunk so this PR stays focused on the settings UI.

  5. Fix the small settings copy typo

    Show monitor conrol buttons -> Show monitor control buttons.

Manual validation I would like before merge

Please include a short test note covering:

  • Release build succeeds on Windows.
  • Gear button opens the settings dialog modally and returns focus correctly when closed.
  • Brightness slider changes the light live and survives app restart.
  • Color-temperature slider changes the main window and all-monitor windows live, and survives app restart.
  • Exclude-from-capture checkbox stays in sync with the tray menu item.
  • Each control-bar button group can be hidden/shown, including the toggle button.
  • The settings gear and exit button remain reachable even if all optional groups are hidden.
  • Light/dark/system theme and high-DPI layout look reasonable.
  • Multi-monitor mode still works after changing brightness/color from the settings dialog.

This is close, but because it touches user-visible WPF behavior and overlaps with persisted settings, I want it rebased and manually smoke-tested rather than merging the current branch directly.

@garrettcampbell3 garrettcampbell3 force-pushed the dev/gcampbell/AddSettingsPage branch from cc99ed0 to 45511b4 Compare June 22, 2026 12:38
@garrettcampbell3

Copy link
Copy Markdown
Author

Please include a short test note covering:

Release build succeeds on Windows.
Gear button opens the settings dialog modally and returns focus correctly when closed.
Brightness slider changes the light live and survives app restart.
Color-temperature slider changes the main window and all-monitor windows live, and survives app restart.
Exclude-from-capture checkbox stays in sync with the tray menu item.
Each control-bar button group can be hidden/shown, including the toggle button.
The settings gear and exit button remain reachable even if all optional groups are hidden.
Light/dark/system theme and high-DPI layout look reasonable.
Multi-monitor mode still works after changing brightness/color from the settings dialog.

@shanselman I've updated and confirmed the manual validation before merge for all of the smoke testing on the local build. I have confirmed all of the above, except for the release build as I don't want to push a tag to kick off a release from a topic branch)

Thanks! Happy to make more changes and test more things as needed/requested.

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