Repair room filter, performance improvements
Chnaging delegate heights is a terrible idea that leads to graphic bugs. Handle filtering (both room and accounts) and collapsing from a function that sets the JsonListModel source.
This commit is contained in:
@@ -84,7 +84,6 @@ class App:
|
||||
rl = self.run_in_loop # noqa
|
||||
ba = self.backend # noqa
|
||||
mo = self.backend.models # noqa
|
||||
smo = self.backend.sidepane_model # noqa
|
||||
cl = self.backend.clients
|
||||
tcl = lambda user: cl[f"@test_{user}:matrix.org"] # noqa
|
||||
|
||||
|
@@ -13,12 +13,17 @@ class Account(ModelItem):
|
||||
display_name: str = ""
|
||||
avatar_url: str = ""
|
||||
profile_updated: datetime = field(default_factory=datetime.now)
|
||||
filter_string: str = ""
|
||||
|
||||
def __lt__(self, other: "Account") -> bool:
|
||||
name = self.display_name or self.user_id[1:]
|
||||
other_name = other.display_name or other.user_id[1:]
|
||||
return name < other_name
|
||||
|
||||
# @property
|
||||
# def filter_string(self) -> str: # TODO: support serializing properties
|
||||
# return " ".join((self.user_id, self.display_name))
|
||||
|
||||
|
||||
@dataclass
|
||||
class Room(ModelItem):
|
||||
|
Reference in New Issue
Block a user