Skip to content

Commit

Permalink
add padding when using ticks
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Mar 30, 2024
1 parent 605dd2b commit 53b559b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions haxe/ui/_module/styles/default/sliders.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
border-radius: $normal-border-radius;
}

.horizontal-slider.major-ticks, .horizontal-slider.minor-ticks {
padding-top: 6px;
padding-bottom: 6px;
}

.horizontal-slider:active .button {
border: 1px solid $accent-color;
}
Expand Down Expand Up @@ -64,6 +69,11 @@
initial-height: 150px;
}

.vertical-slider.major-ticks, .vertical-slider.minor-ticks {
padding-left: 6px;
padding-right: 6px;
}

.vertical-slider:active .button {
border: 1px solid $accent-color;
}
Expand Down
4 changes: 4 additions & 0 deletions haxe/ui/components/Slider.hx
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ private class MinorTicks extends DataBehaviour {
public override function validateData() {
if (_value != null && _value.isNull == false) {
var slider:Slider = cast(_component, Slider);
slider.addClass("minor-ticks");
var ticks = slider.findComponents("minor-tick", 1);
var v:Float = _value;
var m:Float = slider.max - slider.min;
Expand All @@ -325,6 +326,7 @@ private class MinorTicks extends DataBehaviour {
}
}
} else {
_component.removeClass("minor-ticks");
}
}
}
Expand All @@ -333,6 +335,7 @@ private class MajorTicks extends DataBehaviour {
public override function validateData() {
if (_value != null && _value.isNull == false) {
var slider:Slider = cast(_component, Slider);
slider.addClass("major-ticks");
var ticks = slider.findComponents("major-tick", 1);
var v:Float = _value;
var m:Float = slider.max - slider.min;
Expand All @@ -353,6 +356,7 @@ private class MajorTicks extends DataBehaviour {
}
}
} else {
_component.removeClass("major-ticks");
}
}
}
Expand Down

0 comments on commit 53b559b

Please sign in to comment.