SwitchButton: Little enhancements in the drawing routine.

[GB.FORM]
* NEW: SwitchButton: Little enhancements in the drawing routine.
This commit is contained in:
Benoît Minisini 2023-03-17 16:14:43 +01:00
parent c5ef568a03
commit e550a4e76e

View file

@ -77,7 +77,7 @@ Public Sub DrawingArea_Draw()
iCol = Color.Merge(Color.Merge(Color.TextForeground, Color.SelectedBackground, $fValue), Color.Background) iCol = Color.Merge(Color.Merge(Color.TextForeground, Color.SelectedBackground, $fValue), Color.Background)
iCol = Color.SetHSV(iCol, Color[Color.SelectedBackground].Hue) iCol = Color.SetHSV(iCol, Color[Color.SelectedBackground].Hue)
If iFlag And Style.Disabled Then iCol = Color.Desaturate(iCol) If iFlag And Style.Disabled Then iCol = Color.Merge(Color.Background, Color.Desaturate(iCol))
DS = Desktop.Scale DS = Desktop.Scale
Paint.Rectangle(DS, (Paint.H - DS) / 2, Paint.W - DS * 2, DS, DS) Paint.Rectangle(DS, (Paint.H - DS) / 2, Paint.W - DS * 2, DS, DS)
@ -92,7 +92,7 @@ Public Sub DrawingArea_Draw()
Paint.Fill() Paint.Fill()
iCol = Color.Merge(Color.ButtonBackground, Color.SelectedBackground, $fValue) iCol = Color.Merge(Color.ButtonBackground, Color.SelectedBackground, $fValue)
If iFlag And Style.Disabled Then iCol = Color.Desaturate(iCol) If iFlag And Style.Disabled Then iCol = Color.Merge(Color.Background, Color.Desaturate(iCol))
F = Max(1, DS \ 4) F = Max(1, DS \ 4)
Paint.Ellipse(X + F, Y + F, DS * 3 - F * 2, DS * 3 - F * 2) Paint.Ellipse(X + F, Y + F, DS * 3 - F * 2, DS * 3 - F * 2)