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.
This commit is contained in:
parent
6add140a1f
commit
bad0bc87ab
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="16"
|
||||
height="16"
|
||||
version="1.1"
|
||||
id="svg10"
|
||||
sodipodi:docname="input-tablet-missing-symbolic.svg"
|
||||
inkscape:version="0.92.4 (unknown)">
|
||||
<metadata
|
||||
id="metadata16">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs14" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1016"
|
||||
id="namedview12"
|
||||
showgrid="false"
|
||||
inkscape:zoom="29.5"
|
||||
inkscape:cx="15.281847"
|
||||
inkscape:cy="7.8893951"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg10" />
|
||||
<g
|
||||
color="#000"
|
||||
font-weight="400"
|
||||
font-family="sans-serif"
|
||||
white-space="normal"
|
||||
fill="#2e3436"
|
||||
id="g8"
|
||||
style="fill:#474747;fill-opacity:1;opacity:0.35">
|
||||
<path
|
||||
d="M12.403 4.15L7.45 9.102 7 11l1.87-.39 5-5c.549-.593.63-1.11.13-1.61s-1.17-.278-1.597.15z"
|
||||
style="line-height:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;isolation:auto;mix-blend-mode:normal;marker:none;fill:#474747;fill-opacity:1"
|
||||
clip-rule="evenodd"
|
||||
overflow="visible"
|
||||
fill-rule="evenodd"
|
||||
image-rendering="optimizeQuality"
|
||||
shape-rendering="geometricPrecision"
|
||||
text-rendering="geometricPrecision"
|
||||
id="path2" />
|
||||
<path
|
||||
d="M2.191 6L.263 15h15.473L14 6.897 12.316 8.58l.946 4.42H2.738l1.07-5h3.33l1.999-2zm9.776 0l-2 2h.1l2-2z"
|
||||
style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal;fill:#474747;fill-opacity:1"
|
||||
overflow="visible"
|
||||
fill-rule="evenodd"
|
||||
id="path4" />
|
||||
<path
|
||||
d="M8 0v1.5a.506.506 0 0 1-.147.356.484.484 0 0 1-.345.144H4.496a1.498 1.498 0 0 0-1.297 2.248c.266.463.761.752 1.295.752h3.01c.18 0 .34.092.43.248A.506.506 0 0 1 8 5.5V6h1v-.5A1.498 1.498 0 0 0 7.504 4h-3.01a.491.491 0 0 1-.428-.248.507.507 0 0 1 0-.504.488.488 0 0 1 .43-.248h3.012c.396 0 .777-.16 1.056-.441C8.844 2.277 9 1.897 9 1.5V0z"
|
||||
style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal;fill:#474747;fill-opacity:1"
|
||||
overflow="visible"
|
||||
id="path6" />
|
||||
</g>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4581"
|
||||
overflow="visible"
|
||||
style="color:#bebebe;overflow:visible;fill:#474747;marker:none"
|
||||
d="m 11,11 h 1.375 L 13.5,12.094 14.594,11 H 16 v 1.469 L 14.906,13.531 16,14.594 V 16 H 14.562 L 13.5,14.937 12.437,16 H 11 V 14.594 L 12.063,13.531 11,12.47 Z" />
|
||||
</svg>
|
After Width: | Height: | Size: 4.0 KiB |
|
@ -7,5 +7,6 @@
|
|||
<file preprocess="xml-stripblanks">ui/MainWindow.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/SetupPerspective.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/ErrorPerspective.ui</file>
|
||||
<file preprocess="xml-stripblanks">input-tablet-missing-symbolic.svg</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
|
|
@ -11,15 +11,20 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="show_close_button">True</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image_missing_tablet">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">10</property>
|
||||
<property name="resource">/org/freedesktop/Tuhi/input-tablet-missing-symbolic.svg</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="spinner_sync">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">10</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="title">
|
||||
<placeholder/>
|
||||
|
@ -39,6 +44,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue