[PR #245] [MERGED] Fix non-standard volume/brightness scales not working properly #1076

Closed
opened 2026-05-05 07:04:04 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MonitorControl/MonitorControl/pull/245
Author: @victorchabbert
Created: 6/22/2020
Status: Merged
Merged: 9/20/2020
Merged by: @JoniVR

Base: masterHead: master


📝 Commits (1)

📊 Changes

6 files changed (+78 additions, -30 deletions)

View changed files

📝 MonitorControl.xcodeproj/project.pbxproj (+4 -0)
📝 MonitorControl/Info.plist (+1 -1)
📝 MonitorControl/Model/Display.swift (+22 -8)
📝 MonitorControl/Model/ExternalDisplay.swift (+25 -20)
MonitorControl/Support/OSDUtils.swift (+25 -0)
📝 MonitorControlHelper/Info.plist (+1 -1)

📄 Description

Previously, calcNewValue assumed your display's maxValue was a 100.
This caused the OSD to block after certain values (see #201).
It also tried to find the "prettiest" monitor value to display during
normal increments.

This PR refactors the calcNewValue function to focus on finding the next value based on the monitor's value scale.
Behaviour:

  • Get the corresponding chiclet value based on the monitor value.
  • Calculate the distance between the nearest whole chiclet and the chiclet
    from the monitor value
  • Depending on the direction (up or down) and if the distance is between
    a set threshold, we jump to the next chiclet skipping the nearest.
    Otherwise, we go to the nearest chiclet.

calcNewValue no longer tries to find the "prettiest" value as we round the chiclets during normal increments and use the chiclet scale (x/16).

QA

Screen Recording 2020-06-22 at 21 19 00

closes #201


🔄 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/245 **Author:** [@victorchabbert](https://github.com/victorchabbert) **Created:** 6/22/2020 **Status:** ✅ Merged **Merged:** 9/20/2020 **Merged by:** [@JoniVR](https://github.com/JoniVR) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`6f3196a`](https://github.com/MonitorControl/MonitorControl/commit/6f3196a0218f9a3d9e685b40be78ba327ba04a12) Refactor calcNewValue ### 📊 Changes **6 files changed** (+78 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `MonitorControl.xcodeproj/project.pbxproj` (+4 -0) 📝 `MonitorControl/Info.plist` (+1 -1) 📝 `MonitorControl/Model/Display.swift` (+22 -8) 📝 `MonitorControl/Model/ExternalDisplay.swift` (+25 -20) ➕ `MonitorControl/Support/OSDUtils.swift` (+25 -0) 📝 `MonitorControlHelper/Info.plist` (+1 -1) </details> ### 📄 Description Previously, calcNewValue assumed your display's maxValue was a 100. This caused the OSD to block after certain values (see #201). It also tried to find the "prettiest" monitor value to display during normal increments. This PR refactors the calcNewValue function to focus on finding the next value based on the monitor's value scale. Behaviour: - Get the corresponding chiclet value based on the monitor value. - Calculate the distance between the nearest whole chiclet and the chiclet from the monitor value - Depending on the direction (up or down) and if the distance is between a set threshold, we jump to the next chiclet skipping the nearest. Otherwise, we go to the nearest chiclet. calcNewValue no longer tries to find the "prettiest" value as we round the chiclets during normal increments and use the chiclet scale (x/16). ### QA ![Screen Recording 2020-06-22 at 21 19 00](https://user-images.githubusercontent.com/10966568/85331518-94c28b00-b4d6-11ea-8b0b-e15575e5fedf.gif) closes #201 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 07:04:04 -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#1076
No description provided.