Small cleanups: reuse Util.clamp in OSD; PanelSlider hover via _hot
OSD reimplemented clamp() inline when Util already has one. PanelSlider's knob-scale binding read `mouseArea.containsMouse` directly instead of going through a `_hot` like the other interactive controls (TextField, NumberField, Dropdown). Mirror them so future style work has a single property to override.
This commit is contained in:
@@ -28,6 +28,7 @@ Item {
|
||||
|
||||
readonly property real range: Math.max(0.0001, maximum - minimum)
|
||||
readonly property real progress: Math.max(0, Math.min(1, (liveValue - minimum) / range))
|
||||
readonly property bool _hot: mouseArea.containsMouse || root.dragging
|
||||
|
||||
Rectangle {
|
||||
id: track
|
||||
@@ -64,7 +65,7 @@ Item {
|
||||
border.width: Math.max(1, Style.space(2))
|
||||
anchors.verticalCenter: track.verticalCenter
|
||||
x: Math.max(0, Math.min(track.width - width, track.width * root.progress - width / 2))
|
||||
scale: mouseArea.containsMouse || root.dragging ? 1.15 : 1.0
|
||||
scale: root._hot ? 1.15 : 1.0
|
||||
|
||||
Behavior on x {
|
||||
enabled: !root.dragging
|
||||
|
||||
Reference in New Issue
Block a user