add folder cache
This commit is contained in:
parent
03d86422b8
commit
f3ebe4f298
@ -1,4 +1,4 @@
|
|||||||
from PySide6.QtWidgets import QWidget, QListWidget, QVBoxLayout, QListWidgetItem
|
from PySide6.QtWidgets import QWidget, QListWidget, QVBoxLayout, QListWidgetItem, QAbstractItemView
|
||||||
from PySide6.QtCore import Qt, QSize, Signal
|
from PySide6.QtCore import Qt, QSize, Signal
|
||||||
from typing import List
|
from typing import List
|
||||||
from app.core.models.chat_models import PrivateChatListItem
|
from app.core.models.chat_models import PrivateChatListItem
|
||||||
@ -25,6 +25,8 @@ class ChatListView(QWidget):
|
|||||||
|
|
||||||
self.chat_list = QListWidget()
|
self.chat_list = QListWidget()
|
||||||
self.chat_list.setSpacing(2)
|
self.chat_list.setSpacing(2)
|
||||||
|
# Disable selection to avoid persistent click highlight
|
||||||
|
self.chat_list.setSelectionMode(QAbstractItemView.NoSelection)
|
||||||
self.chat_list.itemClicked.connect(self.on_chat_item_clicked)
|
self.chat_list.itemClicked.connect(self.on_chat_item_clicked)
|
||||||
layout.addWidget(self.chat_list)
|
layout.addWidget(self.chat_list)
|
||||||
|
|
||||||
@ -36,6 +38,8 @@ class ChatListView(QWidget):
|
|||||||
chat_id = self.chat_items_map.get(id(item))
|
chat_id = self.chat_items_map.get(id(item))
|
||||||
if chat_id:
|
if chat_id:
|
||||||
self.chat_selected.emit(chat_id)
|
self.chat_selected.emit(chat_id)
|
||||||
|
# Remove focus to avoid blue outline after selection
|
||||||
|
self.chat_list.clearFocus()
|
||||||
|
|
||||||
def update_theme(self):
|
def update_theme(self):
|
||||||
"""Обновляет стили в соответствии с темой."""
|
"""Обновляет стили в соответствии с темой."""
|
||||||
@ -53,9 +57,6 @@ class ChatListView(QWidget):
|
|||||||
QListWidget::item:hover {{
|
QListWidget::item:hover {{
|
||||||
background-color: {palette['hover']};
|
background-color: {palette['hover']};
|
||||||
}}
|
}}
|
||||||
QListWidget::item:selected {{
|
|
||||||
background-color: {palette['selected']};
|
|
||||||
}}
|
|
||||||
QScrollBar:vertical {{
|
QScrollBar:vertical {{
|
||||||
border: none;
|
border: none;
|
||||||
background: {palette['primary']};
|
background: {palette['primary']};
|
||||||
|
|||||||
BIN
cache/images/avatars/example.jpg
vendored
Normal file
BIN
cache/images/avatars/example.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
Reference in New Issue
Block a user