recorder: properly grab focus on pause/resume
Bilal Elmoussaoui
3 years ago
60 | 60 |
<property name="visible">True</property>
|
61 | 61 |
<property name="can_focus">False</property>
|
62 | 62 |
<child>
|
63 | |
<object class="GtkButton">
|
|
63 |
<object class="GtkButton" id="resumeBtn">
|
64 | 64 |
<property name="visible">True</property>
|
65 | 65 |
<property name="can_focus">True</property>
|
66 | 66 |
<property name="receives_default">True</property>
|
|
84 | 84 |
</packing>
|
85 | 85 |
</child>
|
86 | 86 |
<child>
|
87 | |
<object class="GtkButton">
|
|
87 |
<object class="GtkButton" id="pauseBtn">
|
88 | 88 |
<property name="visible">True</property>
|
89 | 89 |
<property name="can_focus">True</property>
|
90 | 90 |
<property name="receives_default">True</property>
|
10 | 10 |
|
11 | 11 |
var RecorderWidget = GObject.registerClass({
|
12 | 12 |
Template: 'resource:///org/gnome/SoundRecorder/ui/recorder.ui',
|
13 | |
InternalChildren: ['recorderBox', 'playbackStack', 'recorderTime'],
|
|
13 |
InternalChildren: [
|
|
14 |
'recorderBox', 'playbackStack', 'recorderTime',
|
|
15 |
'pauseBtn', 'resumeBtn',
|
|
16 |
],
|
14 | 17 |
Signals: {
|
15 | 18 |
'canceled': {},
|
16 | 19 |
'paused': {},
|
|
137 | 140 |
case RecorderState.PAUSED:
|
138 | 141 |
this.actionsGroup.lookup('pause').set_enabled(false);
|
139 | 142 |
this.actionsGroup.lookup('resume').set_enabled(true);
|
|
143 |
this._resumeBtn.grab_focus();
|
140 | 144 |
break;
|
141 | 145 |
case RecorderState.RECORDING:
|
142 | 146 |
this.actionsGroup.lookup('start').set_enabled(false);
|
143 | 147 |
this.actionsGroup.lookup('stop').set_enabled(true);
|
144 | 148 |
this.actionsGroup.lookup('resume').set_enabled(false);
|
145 | 149 |
this.actionsGroup.lookup('pause').set_enabled(true);
|
|
150 |
this._pauseBtn.grab_focus();
|
146 | 151 |
break;
|
147 | 152 |
case RecorderState.STOPPED:
|
148 | 153 |
this.actionsGroup.lookup('start').set_enabled(true);
|