diff --git a/app/ui/views/chat_list_view.py b/app/ui/views/chat_list_view.py index c9cd045..9ecf561 100644 --- a/app/ui/views/chat_list_view.py +++ b/app/ui/views/chat_list_view.py @@ -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) diff --git a/app/ui/widgets/chat_list_item_widget.py b/app/ui/widgets/chat_list_item_widget.py index bb3eb15..43d9a03 100644 --- a/app/ui/widgets/chat_list_item_widget.py +++ b/app/ui/widgets/chat_list_item_widget.py @@ -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"):