mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Make elapsed popover separator creation more universal
This commit is contained in:
@@ -231,4 +231,30 @@ class ClapperElapsedPopoverButton extends LabelPopoverButton
|
|||||||
this.scrolledWindow.max_content_height = (isFullscreen)
|
this.scrolledWindow.max_content_height = (isFullscreen)
|
||||||
? 190 : 150;
|
? 190 : 150;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addSeparator(text)
|
||||||
|
{
|
||||||
|
const box = new Gtk.Box({
|
||||||
|
orientation: Gtk.Orientation.HORIZONTAL,
|
||||||
|
hexpand: true,
|
||||||
|
});
|
||||||
|
const label = new Gtk.Label({
|
||||||
|
label: text,
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
box.append(leftSeparator);
|
||||||
|
box.append(label);
|
||||||
|
box.append(rightSeparator);
|
||||||
|
this.popoverBox.append(box);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
24
src/controls.js
vendored
24
src/controls.js
vendored
@@ -319,29 +319,7 @@ class ClapperControls extends Gtk.Box
|
|||||||
elapsedRevealer.set_reveal_child(true);
|
elapsedRevealer.set_reveal_child(true);
|
||||||
this.revealersArr.push(elapsedRevealer);
|
this.revealersArr.push(elapsedRevealer);
|
||||||
|
|
||||||
const speedSeparatorBox = new Gtk.Box({
|
this.elapsedButton.addSeparator('Speed');
|
||||||
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({
|
const speedScale = new Gtk.Scale({
|
||||||
orientation: Gtk.Orientation.HORIZONTAL,
|
orientation: Gtk.Orientation.HORIZONTAL,
|
||||||
value_pos: Gtk.PositionType.BOTTOM,
|
value_pos: Gtk.PositionType.BOTTOM,
|
||||||
|
Reference in New Issue
Block a user