Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions demo/Views/ControlsView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public class ControlsView : DemoPage {
var scale_header = new Granite.HeaderLabel ("Scale");

var hscale = new Gtk.Scale.with_range (HORIZONTAL, 0, 1, 0.01) {
draw_value = true,
hexpand = true
};
hscale.adjustment.value = 0.5;
Expand Down
40 changes: 40 additions & 0 deletions lib/Styles/Gtk/Scale.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ scale {
min-width: $trough-width;
}

value {
@extend .small-label;
@extend .numeric;
}

&.dragging {
slider {
transform: scale(1.1);
Expand All @@ -55,6 +60,41 @@ scale {
slider {
margin: $slider-margin -1px;
}

value {
// Padding + text height + margin
$value-osd-height: (rem(6px) * 2) + 0.85rem + rem(6px);

&.bottom,
&.top {
@extend .osd;

opacity: 0;
transform: scale(0.9);
transition:
opacity duration("in-place") easing(),
transform duration("collapse") easing();
}

&.bottom {
margin-bottom: $value-osd-height * -1;
margin-top: rem(3px);
}

&.top {
margin-bottom: rem(3px);
margin-top: $value-osd-height * -1;
}
}

&.dragging value {
&.bottom,
&.top {
opacity: 1;
transform: scale(1);
transition: transform duration("expand") easing("ease-out-back");
}
}
}

&.vertical {
Expand Down
2 changes: 1 addition & 1 deletion lib/Styles/_label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

// Intended to match the Pango size of `<small>` and `size='smaller'`
.small-label {
font-size: 0.85em;
font-size: 0.85rem;
}

.error {
Expand Down