From 3cbfd1a57cb1c28edca631f8b5713f75950a231f Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Fri, 10 Sep 2021 19:28:27 +0200 Subject: [PATCH] Fix chapter popover parenting --- src/controls.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/controls.js b/src/controls.js index 575ee60e..9d2e930b 100644 --- a/src/controls.js +++ b/src/controls.js @@ -285,21 +285,22 @@ class ClapperControls extends Gtk.Box this.positionAdjustment.set_page_increment(0); this.positionAdjustment.set_step_increment(8); + const chapterLabel = new Gtk.Label(); + chapterLabel.add_css_class('chapterlabel'); + + this.chapterPopover = new Gtk.Popover({ + position: Gtk.PositionType.TOP, + autohide: false, + child: chapterLabel, + }); const box = new Gtk.Box({ - orientation: Gtk.Orientation.HORIZONTAL, + orientation: Gtk.Orientation.VERTICAL, hexpand: true, valign: Gtk.Align.CENTER, can_focus: false, }); - this.chapterPopover = new Gtk.Popover({ - position: Gtk.PositionType.TOP, - autohide: false, - }); - const chapterLabel = new Gtk.Label(); - chapterLabel.add_css_class('chapterlabel'); - this.chapterPopover.set_child(chapterLabel); - this.chapterPopover.set_parent(box); + box.append(this.chapterPopover); box.append(this.positionScale); this.append(box); } @@ -490,7 +491,5 @@ class ClapperControls extends Gtk.Box this.positionScale.disconnect(this.positionScaleValueSignal); this.positionScale.disconnect(this.positionScaleDragSignal); - - this.chapterPopover.unparent(); } });