From bad0bc87ab4774b4a24103ddced9d7990951b39a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 18 Jul 2019 19:34:19 +1000 Subject: [PATCH] Add a 'missing tablet' icon to be displayed instead of the spinner On startup and before we connected to a tablet, let's display a missing tablet icon. Taken from the tablet icon, combined with the X from one of the network icons in the Adwaita theme. Once we get a sync notification, we just hide that one and done. --- .../data/input-tablet-missing-symbolic.svg | 86 +++++++++++++++++++ tuhigui/data/tuhi.gresource.xml | 1 + tuhigui/data/ui/MainWindow.ui | 12 ++- tuhigui/window.py | 2 + 4 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 tuhigui/data/input-tablet-missing-symbolic.svg diff --git a/tuhigui/data/input-tablet-missing-symbolic.svg b/tuhigui/data/input-tablet-missing-symbolic.svg new file mode 100644 index 0000000..ed6c4d0 --- /dev/null +++ b/tuhigui/data/input-tablet-missing-symbolic.svg @@ -0,0 +1,86 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tuhigui/data/tuhi.gresource.xml b/tuhigui/data/tuhi.gresource.xml index c1493a5..1cfc799 100644 --- a/tuhigui/data/tuhi.gresource.xml +++ b/tuhigui/data/tuhi.gresource.xml @@ -7,5 +7,6 @@ ui/MainWindow.ui ui/SetupPerspective.ui ui/ErrorPerspective.ui + input-tablet-missing-symbolic.svg diff --git a/tuhigui/data/ui/MainWindow.ui b/tuhigui/data/ui/MainWindow.ui index 1dd52ee..83af346 100644 --- a/tuhigui/data/ui/MainWindow.ui +++ b/tuhigui/data/ui/MainWindow.ui @@ -11,15 +11,20 @@ True False True + + + True + False + 10 + /org/freedesktop/Tuhi/input-tablet-missing-symbolic.svg + + True False 10 - - 1 - @@ -39,6 +44,7 @@ end + 1 diff --git a/tuhigui/window.py b/tuhigui/window.py index 3f318d2..24d022b 100644 --- a/tuhigui/window.py +++ b/tuhigui/window.py @@ -126,6 +126,7 @@ class MainWindow(Gtk.ApplicationWindow): menubutton1 = Gtk.Template.Child() spinner_sync = Gtk.Template.Child() image_battery = Gtk.Template.Child() + image_missing_tablet = Gtk.Template.Child() def __init__(self, **kwargs): super().__init__(**kwargs) @@ -201,6 +202,7 @@ class MainWindow(Gtk.ApplicationWindow): self.image_battery.set_tooltip_text(f'{device.battery_percent}%') def _on_sync_state(self, device, pspec): + self.image_missing_tablet.set_visible(False) if device.sync_state: self.spinner_sync.start() else: