mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Flicker free dimming hotkey fix https://github.com/seerge/g-helper/issues/3152
This commit is contained in:
@@ -367,7 +367,7 @@ namespace GHelper.Display
|
|||||||
public static int SetBrightness(int brightness = -1, int delta = 0)
|
public static int SetBrightness(int brightness = -1, int delta = 0)
|
||||||
{
|
{
|
||||||
if (!AppConfig.IsOLED()) return -1;
|
if (!AppConfig.IsOLED()) return -1;
|
||||||
if (brightness < 0) GetBrightness();
|
if (brightness < 0) brightness = GetBrightness();
|
||||||
|
|
||||||
_brightness = Math.Max(0, Math.Min(100, brightness + delta));
|
_brightness = Math.Max(0, Math.Min(100, brightness + delta));
|
||||||
AppConfig.Set(IsOnBattery() ? "brightness_battery" : "brightness", _brightness);
|
AppConfig.Set(IsOnBattery() ? "brightness_battery" : "brightness", _brightness);
|
||||||
|
|||||||
Reference in New Issue
Block a user