chat patch
This commit is contained in:
parent
20118199c8
commit
fe05985b14
@ -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)
|
||||
|
||||
@ -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"
|
||||
|
||||
Reference in New Issue
Block a user