diff --git a/src/controls.js b/src/controls.js index 81a5d6e3..1e58baec 100644 --- a/src/controls.js +++ b/src/controls.js @@ -18,6 +18,8 @@ class ClapperControls extends Gtk.Box can_focus: false, }); + this.minFullViewWidth = 560; + this.currentPosition = 0; this.currentDuration = 0; this.isPositionDragging = false; @@ -473,7 +475,7 @@ class ClapperControls extends Gtk.Box _onPlayerResize(width, height) { - const isMobile = (width < 560); + const isMobile = (width < this.minFullViewWidth); if(this.isMobile === isMobile) return; diff --git a/src/revealers.js b/src/revealers.js index 1746be39..75d2f6d4 100644 --- a/src/revealers.js +++ b/src/revealers.js @@ -370,6 +370,18 @@ class ClapperButtonsRevealer extends Gtk.Revealer this.get_child().append(widget); } + revealInstantly(isReveal) + { + if(this.child_revealed === isReveal) + return; + + const initialDuration = this.transition_duration; + + this.transition_duration = 0; + this.reveal_child = isReveal; + this.transition_duration = initialDuration; + } + _setRotateClass(icon, isAdd) { const cssClass = 'halfrotate'; @@ -388,7 +400,8 @@ class ClapperButtonsRevealer extends Gtk.Revealer _onRevealChild(button) { - this._setRotateClass(button.child, true); + if(this.reveal_child !== this.child_revealed) + this._setRotateClass(button.child, true); } _onChildRevealed(button) diff --git a/src/widget.js b/src/widget.js index fbace202..6f1fe549 100644 --- a/src/widget.js +++ b/src/widget.js @@ -541,6 +541,12 @@ class ClapperWidget extends Gtk.Grid if(width === this.layoutWidth) return; + /* Launch without showing revealers transitions on mobile width */ + if(!this.layoutWidth && width < this.controls.minFullViewWidth) { + for(let revealer of this.controls.revealersArr) + revealer.revealInstantly(false); + } + this.layoutWidth = width; if(this.isFullscreenMode)