[gnome-sound-recorder/bilelmoussaoui/misc] recorder: disable edit mode on active row fixes #79




commit a4f86a2908e0c2bfb353ae2d94ed2c7b8737fac2
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Sun Aug 9 02:05:48 2020 +0200

    recorder: disable edit mode on active row
    fixes #79

 src/recordingsListBox.js | 4 ++--
 src/window.js            | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/recordingsListBox.js b/src/recordingsListBox.js
index 99db6ba2..f248858a 100644
--- a/src/recordingsListBox.js
+++ b/src/recordingsListBox.js
@@ -86,9 +86,9 @@ var RecordingsListBox = new GObject.registerClass(class RecordingsListBox extend
     }
 
     vfunc_row_activated(row) {
-        if (row.editMode && row.expanded || (this.activeRow && this.activeRow.editMode && 
this.activeRow.expanded)) {
+        if (row.editMode && row.expanded || this.activeRow && this.activeRow.editMode && 
this.activeRow.expanded)
             return;
-        }
+
         if (this.activeRow && this.activeRow !== row) {
             this.activeRow.expanded = false;
             this.isolateAt(this.activeRow.get_index(), false);
diff --git a/src/window.js b/src/window.js
index 17e56266..930f5712 100644
--- a/src/window.js
+++ b/src/window.js
@@ -83,6 +83,10 @@ var Window = GObject.registerClass({
     onRecorderStart() {
         this.player.stop();
 
+        const activeRow = this._recordingListBox.activeRow;
+        if (activeRow && activeRow.editMode)
+            activeRow.editMode = false;
+
         this._headerRevealer.reveal_child = false;
         this._mainStack.visible_child_name = 'recorder';
         this._playbackStack.visible_child_name = 'recorder-pause';


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]