[gnome-sound-recorder] hide headerbar on recording
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder] hide headerbar on recording
- Date: Thu, 11 Jun 2020 19:22:58 +0000 (UTC)
commit 19e5461be6115e746f51d50f76ca3d722745cd37
Author: Kavan Mevada <kavanmevada gmail com>
Date: Mon Jun 1 15:51:33 2020 +0530
hide headerbar on recording
data/ui/window.ui | 321 ++++++++++++++++++++++++++++--------------------------
src/mainWindow.js | 4 +-
2 files changed, 170 insertions(+), 155 deletions(-)
---
diff --git a/data/ui/window.ui b/data/ui/window.ui
index 6187030..155388e 100644
--- a/data/ui/window.ui
+++ b/data/ui/window.ui
@@ -17,81 +17,88 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
- <object class="HdyHeaderBar">
+ <object class="GtkRevealer" id="headerRevealer">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="show_close_button">True</property>
- <style>
- <class name="titlebar" />
- </style>
+ <property name="reveal_child">True</property>
<child>
- <object class="GtkButton" id="recordStartButton">
+ <object class="HdyHeaderBar">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="valign">center</property>
- <property name="always_show_image">True</property>
- <signal name="clicked" handler="onRecorderStart" swapped="no"/>
+ <property name="can_focus">False</property>
+ <property name="show_close_button">True</property>
+ <style>
+ <class name="titlebar" />
+ </style>
<child>
- <object class="GtkBox">
+ <object class="GtkButton" id="recordStartButton">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">4</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="valign">center</property>
+ <property name="always_show_image">True</property>
+ <signal name="clicked" handler="onRecorderStart" swapped="no"/>
<child>
- <object class="GtkImage">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="icon_name">media-record-symbolic</property>
+ <property name="spacing">4</property>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">media-record-symbolic</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_end">4</property>
+ <property name="label" translatable="yes">Record</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
+ <style>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuButton" id="appMenuButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="valign">center</property>
+ <property name="menu_model">primaryMenu</property>
<child>
- <object class="GtkLabel">
+ <object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="margin_end">4</property>
- <property name="label" translatable="yes">Record</property>
+ <property name="icon_name">open-menu-symbolic</property>
+ <property name="icon_size">1</property>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
+ <style>
+ <class name="image-button"/>
+ </style>
</object>
+ <packing>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
</child>
- <style>
- <class name="suggested-action"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkMenuButton" id="appMenuButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="valign">center</property>
- <property name="menu_model">primaryMenu</property>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">open-menu-symbolic</property>
- <property name="icon_size">1</property>
- </object>
- </child>
- <style>
- <class name="image-button"/>
- </style>
</object>
- <packing>
- <property name="pack_type">end</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
<packing>
@@ -146,150 +153,156 @@
</packing>
</child>
<child>
- <object class="GtkBox">
+ <object class="HdyWindowHandle">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="margin_left">8</property>
- <property name="margin_right">8</property>
- <property name="margin_top">24</property>
- <property name="margin_bottom">24</property>
- <property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="margin_top">8</property>
- <property name="spacing">18</property>
- <property name="width_request">150</property>
+ <property name="margin_left">8</property>
+ <property name="margin_right">8</property>
+ <property name="margin_top">24</property>
+ <property name="margin_bottom">24</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkStack" id="playbackStack">
+ <object class="GtkBox" id="recordGrid">
+ <property name="height_request">230</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">start</property>
<property name="valign">center</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkButton" id="playButton">
- <property name="name">playButton</property>
+ <object class="GtkLabel" id="recordTimeLabel">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="halign">center</property>
- <property name="always_show_image">True</property>
- <signal name="clicked" handler="onRecorderResume" swapped="no"/>
+ <property name="can_focus">False</property>
+ <property name="margin_top">18</property>
+ <style>
+ <class name="dim-label"/>
+ <class name="recording-time-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="margin_top">8</property>
+ <property name="spacing">18</property>
+ <child>
+ <object class="GtkStack" id="playbackStack">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="valign">center</property>
<child>
- <object class="GtkImage" id="playIcon">
+ <object class="GtkButton" id="playButton">
+ <property name="name">playButton</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">media-playback-start-symbolic</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">center</property>
+ <property name="always_show_image">True</property>
+ <signal name="clicked" handler="onRecorderResume" swapped="no"/>
+ <child>
+ <object class="GtkImage" id="playIcon">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">media-playback-start-symbolic</property>
+ </object>
+ </child>
+ <style>
+ <class name="pill-button"/>
+ </style>
</object>
+ <packing>
+ <property name="name">recorder-start</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="pauseButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">center</property>
+ <property name="always_show_image">True</property>
+ <signal name="clicked" handler="onRecorderPause" swapped="no"/>
+ <child>
+ <object class="GtkImage" id="pauseIcon">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">media-playback-pause-symbolic</property>
+ </object>
+ </child>
+ <style>
+ <class name="pill-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="name">recorder-pause</property>
+ <property name="position">1</property>
+ </packing>
</child>
- <style>
- <class name="pill-button"/>
- </style>
</object>
<packing>
- <property name="name">recorder-start</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="pauseButton">
+ <object class="GtkButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">center</property>
- <property name="always_show_image">True</property>
- <signal name="clicked" handler="onRecorderPause" swapped="no"/>
+ <property name="valign">center</property>
+ <signal name="clicked" handler="onRecorderStop" swapped="no"/>
<child>
- <object class="GtkImage" id="pauseIcon">
+ <object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="icon_name">media-playback-pause-symbolic</property>
+ <property name="icon_name">media-playback-stop-symbolic</property>
+ <property name="icon_size">3</property>
</object>
</child>
<style>
<class name="pill-button"/>
+ <class name="destructive-action"/>
+ <class name="large-button"/>
</style>
</object>
<packing>
- <property name="name">recorder-pause</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <signal name="clicked" handler="onRecorderStop" swapped="no"/>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">media-playback-stop-symbolic</property>
- <property name="icon_size">3</property>
- </object>
- </child>
- <style>
- <class name="pill-button"/>
- <class name="destructive-action"/>
- <class name="large-button"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="recordGrid">
- <property name="height_request">230</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">center</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel" id="recordTimeLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_top">18</property>
- <style>
- <class name="dim-label"/>
- <class name="recording-time-label"/>
- </style>
- </object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</child>
</object>
<packing>
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 5dcf389..bc79244 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -32,7 +32,7 @@ const WaveForm = imports.waveform.WaveForm;
var MainWindow = GObject.registerClass({
Template: 'resource:///org/gnome/SoundRecorder/ui/window.ui',
- InternalChildren: ['recordTimeLabel', 'mainStack', 'recordGrid', 'listBox', 'emptyIcon',
'playbackStack'],
+ InternalChildren: ['recordTimeLabel', 'mainStack', 'recordGrid', 'listBox', 'emptyIcon',
'playbackStack', 'headerRevealer'],
}, class MainWindow extends Handy.ApplicationWindow {
_init(params) {
@@ -97,6 +97,7 @@ var MainWindow = GObject.registerClass({
this.player.stop();
this._mainStack.set_visible_child_name('recorderView');
this._recorder.start();
+ this._headerRevealer.reveal_child = false;
this._playbackStack.set_visible_child_name('recorder-pause');
}
@@ -104,6 +105,7 @@ var MainWindow = GObject.registerClass({
onRecorderStop() {
const recording = this._recorder.stop();
this._recordingList.insert(0, recording);
+ this._headerRevealer.reveal_child = true;
this.waveform.endDrawing();
this._playbackStack.set_visible_child_name('recorder-start');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]