Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
23bfc8f0 by wurstsalat at 2021-02-17T21:46:41+01:00
ChatList: Update time, improve close button
- - - - -
3 changed files:
- gajim/data/gui/chat_list_row.ui
- gajim/data/style/gajim.css
- gajim/gtk/chat_list.py
Changes:
=====================================
gajim/data/gui/chat_list_row.ui
=====================================
@@ -95,13 +95,11 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="timestamp_label">
- <property name="visible">True</property>
+ <object class="GtkLabel" id="unread_label">
<property name="can-focus">False</property>
- <property name="valign">end</property>
+ <property name="no-show-all">True</property>
<style>
- <class name="small-label"/>
- <class name="dim-label"/>
+ <class name="unread-counter"/>
</style>
</object>
<packing>
@@ -112,11 +110,13 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="unread_label">
+ <object class="GtkLabel" id="timestamp_label">
+ <property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="no-show-all">True</property>
+ <property name="valign">end</property>
<style>
- <class name="unread-counter"/>
+ <class name="small-label"/>
+ <class name="dim-label"/>
</style>
</object>
<packing>
@@ -204,8 +204,8 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
- <property name="tooltip-text" translatable="yes">Close</property>
<property name="valign">center</property>
+ <property name="margin-end">3</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -213,10 +213,6 @@
<property name="icon-name">window-close-symbolic</property>
</object>
</child>
- <style>
- <class name="revealer-close-button"/>
- <class name="flat"/>
- </style>
</object>
</child>
</object>
=====================================
gajim/data/style/gajim.css
=====================================
@@ -152,10 +152,11 @@
.chatlist-row:selected label:not(.unread-counter){
color: @theme_text_color;
}
+.chatlist-row button {
+ padding: 3px;
+}
.chatlist-row:selected button {
color: @theme_fg_color;
-}
-.chatlist-row:selected button:hover {
border-color: @insensitive_fg_color;
}
.chatlist-row:selected image {
@@ -164,10 +165,7 @@
.chatlist-row overlay > box {
padding: 6px;
}
-.revealer-close-button {
- padding: 0px;
- margin-right: 6px;
-}
+
.unread-counter {
background-color: rgb(22, 100, 169);
color: rgb(242, 242, 242);
=====================================
gajim/gtk/chat_list.py
=====================================
@@ -162,6 +162,7 @@ def _on_message_received(self, event):
row = self._chats.get((event.account, event.jid))
nick = self._get_nick_for_received_message(event)
row.set_last_message_text(nick, event.msgtxt)
+ row.set_timestamp(event.properties.timestamp)
self._add_unread(row, event.properties)
@@ -179,6 +180,7 @@ def _on_message_sent(self, event):
else:
nick = _('Me: ')
row.set_last_message_text(nick, msgtext)
+ row.set_timestamp(event.timestamp)
@staticmethod
def _get_nick_for_received_message(event):
@@ -358,6 +360,10 @@ def _on_state_flags_changed(self, _listboxrow, *args):
def _on_close_button_clicked(self, _button):
app.window.remove_chat(self.workspace_id, self.account, self.jid)
+ def set_timestamp(self, timestamp):
+ self._timestamp = timestamp
+ self.update_time()
+
def update_time(self):
if self._timestamp is not None:
self._ui.timestamp_label.set_text(
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/23bfc8f0ba5dd2a7869a29f75291f54ade396529
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/23bfc8f0ba5dd2a7869a29f75291f54ade396529
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits