chat patch
This commit is contained in:
		
							parent
							
								
									cbbd531484
								
							
						
					
					
						commit
						a2f583e969
					
				@ -178,6 +178,14 @@ class ChatListView(QWidget):
 | 
			
		||||
                is_read = bool(chat.last_message.is_viewed)
 | 
			
		||||
 | 
			
		||||
            item_widget = ChatListItemWidget(companion_name, last_msg, timestamp, unread_count=unread_count, is_outgoing=is_outgoing, is_read=is_read)
 | 
			
		||||
            # Tooltip with full date/time on hover
 | 
			
		||||
            try:
 | 
			
		||||
                if chat.last_message and getattr(chat.last_message, 'created_at', None):
 | 
			
		||||
                    item_widget.set_timestamp_tooltip(chat.last_message.created_at.strftime('%d.%m.%Y %H:%M:%S'))
 | 
			
		||||
                else:
 | 
			
		||||
                    item_widget.set_timestamp_tooltip("")
 | 
			
		||||
            except Exception:
 | 
			
		||||
                pass
 | 
			
		||||
            
 | 
			
		||||
            # Создаем элемент списка и устанавливаем для него наш виджет
 | 
			
		||||
            list_item = QListWidgetItem(self.chat_list)
 | 
			
		||||
 | 
			
		||||
@ -120,6 +120,13 @@ class ChatListItemWidget(QWidget):
 | 
			
		||||
        self._update_unread_badge_shape()
 | 
			
		||||
        self.unread_label.setVisible(self.unread_label.text() != "")
 | 
			
		||||
 | 
			
		||||
    def set_timestamp_tooltip(self, tooltip_text: str):
 | 
			
		||||
        try:
 | 
			
		||||
            self.timestamp_label.setToolTip(tooltip_text or "")
 | 
			
		||||
        except Exception:
 | 
			
		||||
            # Be defensive if label not yet created
 | 
			
		||||
            pass
 | 
			
		||||
 | 
			
		||||
    def _update_unread_badge_shape(self):
 | 
			
		||||
        text = self.unread_label.text()
 | 
			
		||||
        if not hasattr(self, "_unread_base_style"):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user