From fe05985b142850cc9a092e63ee6ee235c6d3a460 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Oct 2025 00:20:21 +0300 Subject: [PATCH] chat patch --- app/ui/views/chat_list_view.py | 28 +++++++++++++++++++++++++ app/ui/widgets/chat_list_item_widget.py | 9 +++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/app/ui/views/chat_list_view.py b/app/ui/views/chat_list_view.py index 5d5fda2..ce760d0 100644 --- a/app/ui/views/chat_list_view.py +++ b/app/ui/views/chat_list_view.py @@ -25,6 +25,9 @@ class ChatListView(QWidget): self.chat_list = QListWidget() self.chat_list.setSpacing(2) + # Ensure no default row backgrounds + self.chat_list.setAlternatingRowColors(False) + self.chat_list.setAutoFillBackground(False) # Disable selection to avoid persistent click highlight self.chat_list.setSelectionMode(QAbstractItemView.NoSelection) self.chat_list.itemClicked.connect(self.on_chat_item_clicked) @@ -72,6 +75,31 @@ class ChatListView(QWidget): height: 0px; }} """) + # Force transparent backgrounds behind text/items + existing_styles = self.chat_list.styleSheet() + self.chat_list.setStyleSheet(existing_styles + f""" + QListWidget::item {{ + background-color: transparent; + }} + QListWidget::item:hover {{ + background-color: transparent; + }} + QListWidget::item:selected {{ + background-color: transparent; + }} + QListView::item {{ + background-color: transparent; + }} + QListView::item:hover {{ + background-color: transparent; + }} + QListView::item:selected {{ + background-color: transparent; + }} + QListWidget QLabel {{ + background-color: transparent; + }} + """) # Обновляем существующие элементы for i in range(self.chat_list.count()): item = self.chat_list.item(i) diff --git a/app/ui/widgets/chat_list_item_widget.py b/app/ui/widgets/chat_list_item_widget.py index e39e354..0200f78 100644 --- a/app/ui/widgets/chat_list_item_widget.py +++ b/app/ui/widgets/chat_list_item_widget.py @@ -6,6 +6,9 @@ from app.core.theme import theme_manager class ChatListItemWidget(QWidget): def __init__(self, companion_name, last_message, timestamp, avatar_path=None, unread_count=0): super().__init__() + # Ensure fully transparent background for the item widget + self.setAutoFillBackground(False) + self.setStyleSheet("background-color: transparent;") self.init_ui(companion_name, last_message, timestamp, avatar_path, unread_count) self.update_theme() @@ -53,9 +56,9 @@ class ChatListItemWidget(QWidget): """Обновляет стили виджета в соответствии с текущей темой.""" palette = theme_manager.get_current_palette() - self.name_label.setStyleSheet(f"font-weight: bold; font-size: 11pt; color: {palette['text']};") - self.last_message_label.setStyleSheet(f"font-size: 9pt; color: {palette['text_secondary']};") - self.timestamp_label.setStyleSheet(f"font-size: 8pt; color: {palette['text_secondary']};") + self.name_label.setStyleSheet(f"font-weight: bold; font-size: 11pt; color: {palette['text']}; background-color: transparent;") + self.last_message_label.setStyleSheet(f"font-size: 9pt; color: {palette['text_secondary']}; background-color: transparent;") + self.timestamp_label.setStyleSheet(f"font-size: 8pt; color: {palette['text_secondary']}; background-color: transparent;") unread_bg = palette['accent'] unread_text = "#ffffff"