From 2b77810274dc3d806335a53f35c928ac5fbe3701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 22 Jan 2021 13:13:57 +0100 Subject: [PATCH] Add a custom separator above speed scale Let users know what this scale does by having a separator with a "speed" label --- css/styles.css | 3 +++ src/controls.js | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/css/styles.css b/css/styles.css index 4c1acb6f..e53f5558 100644 --- a/css/styles.css +++ b/css/styles.css @@ -5,6 +5,9 @@ scale marks { radio { margin-left: -2px; } +separator { + background: @insensitive_fg_color; +} .osd popover box { text-shadow: none; font-size: 21px; diff --git a/src/controls.js b/src/controls.js index c2292499..e47d2d2e 100644 --- a/src/controls.js +++ b/src/controls.js @@ -319,6 +319,29 @@ class ClapperControls extends Gtk.Box elapsedRevealer.set_reveal_child(true); this.revealersArr.push(elapsedRevealer); + const speedSeparatorBox = new Gtk.Box({ + orientation: Gtk.Orientation.HORIZONTAL, + hexpand: true, + }); + const speedLabel = new Gtk.Label({ + label: 'speed', + halign: Gtk.Align.CENTER, + }); + const leftSeparator = new Gtk.Separator({ + orientation: Gtk.Orientation.HORIZONTAL, + hexpand: true, + valign: Gtk.Align.CENTER, + }); + const rightSeparator = new Gtk.Separator({ + orientation: Gtk.Orientation.HORIZONTAL, + hexpand: true, + valign: Gtk.Align.CENTER, + }); + speedSeparatorBox.append(leftSeparator); + speedSeparatorBox.append(speedLabel); + speedSeparatorBox.append(rightSeparator); + this.elapsedButton.popoverBox.append(speedSeparatorBox); + const speedScale = new Gtk.Scale({ orientation: Gtk.Orientation.HORIZONTAL, value_pos: Gtk.PositionType.BOTTOM,