[PR #1860] feat: Add numerical input and arrow key support for sliders #1296

Open
opened 2026-05-05 07:10:27 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MonitorControl/MonitorControl/pull/1860
Author: @karanshah229
Created: 4/18/2026
Status: 🔄 Open

Base: mainHead: main


📝 Commits (3)

  • 26a1900 feat: Add numerical input and arrow key support for sliders
  • 824c66a Merge branch 'MonitorControl:main' into main
  • d645915 fix: Review comments I

📊 Changes

1 file changed (+72 additions, -5 deletions)

View changed files

📝 MonitorControl/Support/SliderHandler.swift (+72 -5)

📄 Description

Description

This PR addresses user feedback regarding the difficulty of hitting exact values (e.g., exactly 43% or 87%) through the menu bar sliders via mouse drag.

Changes proposed in this pull request:

  • Editable Values: The percentage labels located to the right of the menu bar sliders are now selectable NSTextField elements.
  • Native Visual Feedback: Clicking the percentage value transitions it into an isBezeled = true .roundedBezel style so the user clearly understands they can type.
  • Arrow Key Support: Overridden control(_:textView:doCommandBy:) to capture continuous Up/Down arrow inputs when the field is actively focused.
  • Modifiers & Clamping:
    • Standard arrow presses increment/decrement by 1%.
    • Holding Shift increments/decrements by 10%.
    • Bounds are clamped between 0% and 100%.
  • Live Syncing: Interactions via arrow keys trigger instantaneous syncs via self.valueChanged(slider:), resulting in fluid DDC brightness/volume ramps without needing to press Enter.
  • Fail-safe Parsing: Non-numeric or invalid string inputs gracefully fall back to the currently configured monitor state without layout breaks.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MonitorControl/MonitorControl/pull/1860 **Author:** [@karanshah229](https://github.com/karanshah229) **Created:** 4/18/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`26a1900`](https://github.com/MonitorControl/MonitorControl/commit/26a1900d7e7a9e0b737c5a1f64ffde84e4809016) feat: Add numerical input and arrow key support for sliders - [`824c66a`](https://github.com/MonitorControl/MonitorControl/commit/824c66a34c3b0dd9d5fbb72db284333e0ec3a8f5) Merge branch 'MonitorControl:main' into main - [`d645915`](https://github.com/MonitorControl/MonitorControl/commit/d6459158aab092e5d31da68b019e9447ec321201) fix: Review comments I ### 📊 Changes **1 file changed** (+72 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `MonitorControl/Support/SliderHandler.swift` (+72 -5) </details> ### 📄 Description ### Description This PR addresses user feedback regarding the difficulty of hitting exact values (e.g., exactly 43% or 87%) through the menu bar sliders via mouse drag. ### Changes proposed in this pull request: - **Editable Values**: The percentage labels located to the right of the menu bar sliders are now selectable `NSTextField` elements. - **Native Visual Feedback**: Clicking the percentage value transitions it into an `isBezeled = true` `.roundedBezel` style so the user clearly understands they can type. - **Arrow Key Support**: Overridden `control(_:textView:doCommandBy:)` to capture continuous `Up/Down` arrow inputs when the field is actively focused. - **Modifiers & Clamping**: - Standard arrow presses increment/decrement by `1%`. - Holding `Shift` increments/decrements by `10%`. - Bounds are clamped between `0%` and `100%`. - **Live Syncing**: Interactions via arrow keys trigger instantaneous syncs via `self.valueChanged(slider:)`, resulting in fluid DDC brightness/volume ramps without needing to press Enter. - **Fail-safe Parsing**: Non-numeric or invalid string inputs gracefully fall back to the currently configured monitor state without layout breaks. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror added the
pull-request
label 2026-05-05 07:10:27 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/MonitorControl#1296
No description provided.