[gnome-sound-recorder/bilelmoussaoui/better-shortcuts: 6/11] recorder: properly grab focus on pause/resume
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder/bilelmoussaoui/better-shortcuts: 6/11] recorder: properly grab focus on pause/resume
- Date: Wed, 9 Sep 2020 18:17:28 +0000 (UTC)
commit d88169671ea687a398dd2623e1183b4c9e0393d3
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Wed Sep 9 15:39:52 2020 +0200
recorder: properly grab focus on pause/resume
data/ui/recorder.ui | 4 ++--
src/recorderWidget.js | 7 ++++++-
2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/recorder.ui b/data/ui/recorder.ui
index b70f994..fb109f6 100644
--- a/data/ui/recorder.ui
+++ b/data/ui/recorder.ui
@@ -61,7 +61,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkButton">
+ <object class="GtkButton" id="resumeBtn">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -85,7 +85,7 @@
</packing>
</child>
<child>
- <object class="GtkButton">
+ <object class="GtkButton" id="pauseBtn">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
diff --git a/src/recorderWidget.js b/src/recorderWidget.js
index a487c0f..fd771c4 100644
--- a/src/recorderWidget.js
+++ b/src/recorderWidget.js
@@ -11,7 +11,10 @@ var RecorderState = {
var RecorderWidget = GObject.registerClass({
Template: 'resource:///org/gnome/SoundRecorder/ui/recorder.ui',
- InternalChildren: ['recorderBox', 'playbackStack', 'recorderTime'],
+ InternalChildren: [
+ 'recorderBox', 'playbackStack', 'recorderTime',
+ 'pauseBtn', 'resumeBtn',
+ ],
Signals: {
'canceled': {},
'paused': {},
@@ -138,12 +141,14 @@ var RecorderWidget = GObject.registerClass({
case RecorderState.PAUSED:
this.actionsGroup.lookup('pause').set_enabled(false);
this.actionsGroup.lookup('resume').set_enabled(true);
+ this._resumeBtn.grab_focus();
break;
case RecorderState.RECORDING:
this.actionsGroup.lookup('start').set_enabled(false);
this.actionsGroup.lookup('stop').set_enabled(true);
this.actionsGroup.lookup('resume').set_enabled(false);
this.actionsGroup.lookup('pause').set_enabled(true);
+ this._pauseBtn.grab_focus();
break;
case RecorderState.STOPPED:
this.actionsGroup.lookup('start').set_enabled(true);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]