Daniel Brötzmann pushed to branch master at gajim / gajim
Commits: 35b9ee28 by wurstsalat at 2023-05-06T21:21:59+02:00 imprv: ChatList: Show indicator if group chat is not connected
- - - - -
6 changed files:
- gajim/data/gui/chat_list_row.ui - + gajim/data/icons/hicolor/scalable/devices/feather-refresh-cw-symbolic.svg - + gajim/data/icons/hicolor/scalable/devices/feather-zap-symbolic.svg - gajim/data/style/gajim.css - gajim/gtk/builder.pyi - gajim/gtk/chat_list_row.py
Changes:
===================================== gajim/data/gui/chat_list_row.ui ===================================== @@ -92,12 +92,10 @@ </packing> </child> <child> - <object class="GtkSpinner" id="spinner"> + <object class="GtkImage" id="connection_icon"> <property name="can-focus">False</property> <property name="no-show-all">True</property> - <property name="tooltip-text" translatable="yes">Joining Group Chat…</property> - <property name="opacity">0.60</property> - <property name="active">True</property> + <property name="icon_size">1</property> </object> <packing> <property name="expand">False</property>
===================================== gajim/data/icons/hicolor/scalable/devices/feather-refresh-cw-symbolic.svg ===================================== @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + width="24" + height="24" + viewBox="0 0 24 24" + fill="none" + stroke="currentColor" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" + class="feather feather-refresh-cw" + version="1.1" + id="svg8" + sodipodi:docname="feather-refresh-cw-symbolic-a.svg" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg%22%3E + <defs + id="defs12" /> + <sodipodi:namedview + id="namedview10" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:showpageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + showgrid="false" + inkscape:zoom="33.791667" + inkscape:cx="11.644883" + inkscape:cy="12.014797" + inkscape:window-width="1920" + inkscape:window-height="998" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg8" /> + <path + style="color:#000000;fill:#000000;stroke-width:0;stroke-dasharray:none" + d="m 23,3 a 1,1 0 0 0 -1,1 v 5 h -5 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 6 a 1.0001,1.0001 0 0 0 1,-1 V 4 A 1,1 0 0 0 23,3 Z" + id="polyline2" /> + <path + style="color:#000000;fill:#000000;stroke-width:0;stroke-dasharray:none" + d="m 1,13 a 1.0001,1.0001 0 0 0 -1,1 v 6 a 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 V 15 H 7 A 1,1 0 0 0 8,14 1,1 0 0 0 7,13 Z" + id="polyline4" /> + <path + style="color:#000000;fill:#000000;stroke-width:0;stroke-dasharray:none" + d="M 12.216797,2.0234375 C 8.1357426,1.9556272 4.0915312,4.3561355 2.5664063,8.6660156 A 1,1 0 0 0 3.1757813,9.9433594 1,1 0 0 0 4.453125,9.3339844 C 6.4293215,3.7494125 13.464552,2.1577647 17.652344,6.3476562 a 1.0001,1.0001 0 0 0 0.02344,0.021484 l 4.638672,4.3593754 a 1,1 0 0 0 1.414063,-0.04297 1,1 0 0 0 -0.04297,-1.4140626 L 19.066406,4.9335937 C 17.127255,2.9934704 14.665429,2.0641237 12.216797,2.0234375 Z M 0.96875,13 a 1,1 0 0 0 -0.69726562,0.314453 1,1 0 0 0 0.0429687,1.414063 l 4.61914057,4.33789 c 5.1710703,5.173663 14.0598003,3.163387 16.5000003,-3.732422 a 1,1 0 0 0 -0.609375,-1.277343 1,1 0 0 0 -1.277344,0.609375 c -1.976196,5.584571 -9.011427,7.176219 -13.1992188,2.986328 a 1.0001,1.0001 0 0 0 -0.023437,-0.02148 L 1.6855469,13.271484 A 1,1 0 0 0 0.96875,13 Z" + id="path6" /> +</svg>
===================================== gajim/data/icons/hicolor/scalable/devices/feather-zap-symbolic.svg ===================================== @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + width="24" + height="24" + viewBox="0 0 24 24" + fill="none" + stroke="currentColor" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" + class="feather feather-zap" + version="1.1" + id="svg4" + sodipodi:docname="feather-zap-symbolic.svg" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg%22%3E + <defs + id="defs8" /> + <sodipodi:namedview + id="namedview6" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:showpageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + showgrid="false" + inkscape:zoom="33.791667" + inkscape:cx="12.014797" + inkscape:cy="12.014797" + inkscape:window-width="1920" + inkscape:window-height="998" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg4" /> + <path + style="color:#000000;fill:#000000;stroke-width:0;stroke-dasharray:none" + d="m 12.980469,1 a 1.0001,1.0001 0 0 0 -0.748047,0.359375 l -10.0000001,12 A 1.0001,1.0001 0 0 0 3,15 h 7.867188 l -0.859375,6.875 a 1.0001,1.0001 0 0 0 1.759765,0.765625 l 10,-12 A 1.0001,1.0001 0 0 0 21,9 H 13.132813 L 13.992188,2.125 A 1.0001,1.0001 0 0 0 12.980469,1 Z M 11.583984,5.2597656 11.007813,9.875 A 1.0001,1.0001 0 0 0 12,11 h 6.865234 L 12.416016,18.740234 12.992188,14.125 A 1.0001,1.0001 0 0 0 12,13 H 5.1347656 Z" + id="polygon2" /> +</svg>
===================================== gajim/data/style/gajim.css ===================================== @@ -130,6 +130,15 @@ .pulse-transform { animation-timing-function: ease-in-out; animation-iteration-count: infinite; } +@keyframes spin { + to { -gtk-icon-transform: rotate(1turn); } +} +.spin { + animation-name: spin; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; +}
/* General purpose classes ================================================= */ .dialog-margin > box { margin: 18px;}
===================================== gajim/gtk/builder.pyi ===================================== @@ -218,7 +218,7 @@ class ChatListRowBuilder(Builder): avatar_image: Gtk.Image group_chat_indicator: Gtk.Image name_label: Gtk.Label - spinner: Gtk.Spinner + connection_icon: Gtk.Image chatstate_image: Gtk.Image mute_image: Gtk.Image timestamp_label: Gtk.Label
===================================== gajim/gtk/chat_list_row.py ===================================== @@ -546,8 +546,26 @@ def _on_muc_state_changed(self, *args: Any) -> None: self._update_joined_state()
def _update_joined_state(self) -> None: - self._ui.spinner.set_visible( - self.contact.is_joining and self._client.state.is_available) + self._ui.connection_icon.get_style_context().remove_class('spin') + self._ui.connection_icon.get_style_context().remove_class( + 'warning-color') + + if self.contact.is_joining: + self._ui.connection_icon.set_from_icon_name( + 'feather-refresh-cw-symbolic', Gtk.IconSize.MENU) + self._ui.connection_icon.get_style_context().add_class('spin') + self._ui.connection_icon.set_tooltip_text(_('Joining Group Chat…')) + self._ui.connection_icon.show() + elif (self.contact.is_not_joined or + not self._client.state.is_available): + self._ui.connection_icon.set_from_icon_name( + 'feather-zap-symbolic', Gtk.IconSize.MENU) + self._ui.connection_icon.get_style_context().add_class( + 'warning-color') + self._ui.connection_icon.set_tooltip_text(_('Not connected')) + self._ui.connection_icon.show() + else: + self._ui.connection_icon.hide()
def _on_muc_user_update(self, _contact: GroupchatParticipant,
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/35b9ee28e3de8f1d52abe64db988e21d2...