[gnome-sound-recorder/bilelmoussaoui/misc: 1/4] notifications: design cleanup




commit 5f110a083e2bbde688a4e8969cc0f7f456bb6921
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Sun Aug 16 15:35:48 2020 +0200

    notifications: design cleanup

 data/ui/window.ui | 6 +++++-
 src/window.js     | 5 +++--
 2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/window.ui b/data/ui/window.ui
index 23f283a..4e3c373 100644
--- a/data/ui/window.ui
+++ b/data/ui/window.ui
@@ -381,7 +381,10 @@
                     <child>
                       <object class="GtkLabel" id="notificationMessage">
                         <property name="visible">True</property>
+                        <property name="xalign">0.0</property>
                         <property name="can_focus">False</property>
+                        <property name="wrap">True</property>
+                        <property name="ellipsize">end</property>
                       </object>
                     </child>
                     <child>
@@ -394,11 +397,12 @@
                       </object>
                     </child>
                     <child>
-                      <object class="GtkButton" id="notificationCancelBtn">
+                      <object class="GtkButton" id="notificationCloseBtn">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
                         <property name="margin_start">8</property>
+                        <property name="tooltip_text" translatable="yes">Close</property>
                         <property name="relief">none</property>
                         <child>
                           <object class="GtkImage">
diff --git a/src/window.js b/src/window.js
index 154837b..a7281b9 100644
--- a/src/window.js
+++ b/src/window.js
@@ -34,7 +34,7 @@ var WindowState = {
 
 var Window = GObject.registerClass({
     Template: 'resource:///org/gnome/SoundRecorder/ui/window.ui',
-    InternalChildren: ['recorderTime', 'mainStack', 'recorderBox', 'emptyIcon', 'playbackStack', 
'headerRevealer', 'notificationRevealer', 'notificationMessage', 'notificationUndoBtn', 
'notificationCancelBtn', 'column'],
+    InternalChildren: ['recorderTime', 'mainStack', 'recorderBox', 'emptyIcon', 'playbackStack', 
'headerRevealer', 'notificationRevealer', 'notificationMessage', 'notificationUndoBtn', 
'notificationCloseBtn', 'column'],
 }, class Window extends Handy.ApplicationWindow {
 
     _init(params) {
@@ -84,7 +84,7 @@ var Window = GObject.registerClass({
             );
         });
 
-        this._notificationCancelBtn.connect('clicked', _ => {
+        this._notificationCloseBtn.connect('clicked', _ => {
             this._notificationRevealer.reveal_child = false;
             if (this.deleteSignalId && this.deleteSignalId > 0) {
                 GLib.source_remove(this.deleteSignalId);
@@ -144,6 +144,7 @@ var Window = GObject.registerClass({
 
     notify(message, callback, cancelCallback) {
         this._notificationMessage.label = message;
+        this._notificationMessage.tooltip_text = message;
         this._notificationRevealer.reveal_child = true;
         this.deleteSignalId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 3, () => {
             callback();


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