Daniel Brötzmann pushed to branch gtk4 at gajim / gajim


Commits:
3a636e24 by wurstsalat at 2024-10-05T18:33:11+02:00
improve chat list row widget behavior

- - - - -
2f88a425 by wurstsalat at 2024-10-05T18:33:30+02:00
fix displaying moderated messages

- - - - -


3 changed files:

- gajim/data/gui/chat_list_row.ui
- gajim/gtk/chat_list_row.py
- gajim/gtk/conversation/rows/message.py


Changes:

=====================================
gajim/data/gui/chat_list_row.ui
=====================================
@@ -36,6 +36,13 @@
                 <child>
                   <object class="GtkBox">
                     <property name="spacing">3</property>
+                    <property name="hexpand">1</property>
+                    <child>
+                      <object class="GtkImage" id="connection_icon">
+                        <property name="visible">0</property>
+                        <property name="icon_size">normal</property>
+                      </object>
+                    </child>
                     <child>
                       <object class="GtkImage" id="group_chat_indicator">
                         <property name="visible">0</property>
@@ -54,12 +61,6 @@
                         <property name="xalign">0</property>
                       </object>
                     </child>
-                    <child>
-                      <object class="GtkImage" id="connection_icon">
-                        <property name="visible">0</property>
-                        <property name="icon_size">normal</property>
-                      </object>
-                    </child>
                   </object>
                 </child>
                 <child>
@@ -93,6 +94,7 @@
             <child>
               <object class="GtkBox">
                 <property name="spacing">3</property>
+                <property name="hexpand">1</property>
                 <child>
                   <object class="GtkLabel" id="nick_label">
                     <property name="visible">0</property>
@@ -114,6 +116,7 @@
                 <child>
                   <object class="GtkLabel" id="message_label">
                     <property name="halign">start</property>
+                    <property name="hexpand">1</property>
                     <property name="ellipsize">end</property>
                     <property name="single-line-mode">1</property>
                     <property name="xalign">0</property>
@@ -138,9 +141,11 @@
           <object class="GtkRevealer" id="revealer">
             <property name="visible">1</property>
             <property name="halign">end</property>
-            <property name="transition-type">none</property>
+            <property name="transition-type">slide-right</property>
+            <property name="transition-duration">100</property>
             <property name="child">
               <object class="GtkButton" id="close_button">
+                <property name="visible">0</property>
                 <property name="focusable">1</property>
                 <property name="receives-default">1</property>
                 <property name="valign">center</property>


=====================================
gajim/gtk/chat_list_row.py
=====================================
@@ -444,8 +444,10 @@ def _on_state_flags_changed(self,
         state = self.get_state_flags()
         if (state & Gtk.StateFlags.PRELIGHT) != 0:
             self._ui.revealer.set_reveal_child(True)
+            self._ui.close_button.show()
         else:
             self._ui.revealer.set_reveal_child(False)
+            self._ui.close_button.hide()
 
     def _on_destroy(self, _row: ChatListRow) -> None:
         app.settings.disconnect_signals(self)


=====================================
gajim/gtk/conversation/rows/message.py
=====================================
@@ -473,7 +473,8 @@ def set_moderated(self, text: str) -> None:
         self.text = text
 
         if isinstance(self._message_widget, PreviewWidget):
-            self._message_widget.destroy()
+            self._bottom_box.remove(self._message_widget)
+
             self._message_widget = MessageWidget(self._account)
             self._bottom_box.append(self._message_widget)
             self._set_text_direction(text)
@@ -509,8 +510,6 @@ def set_merged(self, merged: bool) -> None:
             self._meta_box.hide()
         else:
             self.get_style_context().remove_class('merged')
-            # TODO GTK4
-            # self._meta_box.set_no_show_all(False)
             self._meta_box.show()
 
         self._avatar_box.set_merged(merged)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/d73ad078116f2adbf6944f716a3dd459a9f862b8...2f88a425af5d9e23a67ab92817998efa283744bb

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/d73ad078116f2adbf6944f716a3dd459a9f862b8...2f88a425af5d9e23a67ab92817998efa283744bb
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- commits@gajim.org
To unsubscribe send an email to commits-le...@gajim.org

Reply via email to