Spaces are now bold

This commit is contained in:
Nicolas Werner 2023-11-01 21:44:21 +01:00
parent 8b39b65d43
commit bd1cadb6bb
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
5 changed files with 8 additions and 0 deletions

View file

@ -237,6 +237,7 @@ Control {
Label { Label {
color: model.index == popup.currentIndex ? palette.highlightedText : palette.text color: model.index == popup.currentIndex ? palette.highlightedText : palette.text
font.italic: model.isTombstoned font.italic: model.isTombstoned
font.bold: model.isSpace
font.pixelSize: popup.avatarHeight * 0.5 font.pixelSize: popup.avatarHeight * 0.5
text: model.roomName text: model.roomName
textFormat: Text.RichText textFormat: Text.RichText
@ -261,6 +262,7 @@ Control {
Label { Label {
color: model.index == popup.currentIndex ? palette.highlightedText : palette.text color: model.index == popup.currentIndex ? palette.highlightedText : palette.text
font.italic: model.isTombstoned font.italic: model.isTombstoned
font.bold: model.isSpace
text: model.roomName text: model.roomName
textFormat: Text.RichText textFormat: Text.RichText
} }

View file

@ -2866,6 +2866,7 @@ Cache::roomNamesAndAliases()
.alias = std::move(alias), .alias = std::move(alias),
.recent_activity = info.approximate_last_modification_ts, .recent_activity = info.approximate_last_modification_ts,
.is_tombstoned = info.is_tombstoned, .is_tombstoned = info.is_tombstoned,
.is_space = info.is_space,
}); });
} catch (std::exception &e) { } catch (std::exception &e) {
nhlog::db()->warn("Failed to add room {} to result: {}", room_id, e.what()); nhlog::db()->warn("Failed to add room {} to result: {}", room_id, e.what());

View file

@ -110,6 +110,7 @@ struct RoomNameAlias
std::string id, name, alias; std::string id, name, alias;
std::uint64_t recent_activity; std::uint64_t recent_activity;
bool is_tombstoned; bool is_tombstoned;
bool is_space;
}; };
//! Basic information per member. //! Basic information per member.

View file

@ -36,6 +36,7 @@ RoomsModel::roleNames() const
{Roles::RoomID, "roomid"}, {Roles::RoomID, "roomid"},
{Roles::RoomName, "roomName"}, {Roles::RoomName, "roomName"},
{Roles::IsTombstoned, "isTombstoned"}, {Roles::IsTombstoned, "isTombstoned"},
{Roles::IsSpace, "isSpace"},
}; };
} }
@ -69,6 +70,8 @@ RoomsModel::data(const QModelIndex &index, int role) const
return QString::fromStdString(rooms[index.row()].id).toHtmlEscaped(); return QString::fromStdString(rooms[index.row()].id).toHtmlEscaped();
case Roles::IsTombstoned: case Roles::IsTombstoned:
return rooms[index.row()].is_tombstoned; return rooms[index.row()].is_tombstoned;
case Roles::IsSpace:
return rooms[index.row()].is_space;
} }
} }
return {}; return {};

View file

@ -19,6 +19,7 @@ public:
RoomID, RoomID,
RoomName, RoomName,
IsTombstoned, IsTombstoned,
IsSpace,
}; };
RoomsModel(bool showOnlyRoomWithAliases = false, QObject *parent = nullptr); RoomsModel(bool showOnlyRoomWithAliases = false, QObject *parent = nullptr);