mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-21 18:50:47 +03:00
Spaces are now bold
This commit is contained in:
parent
8b39b65d43
commit
bd1cadb6bb
5 changed files with 8 additions and 0 deletions
|
@ -237,6 +237,7 @@ Control {
|
|||
Label {
|
||||
color: model.index == popup.currentIndex ? palette.highlightedText : palette.text
|
||||
font.italic: model.isTombstoned
|
||||
font.bold: model.isSpace
|
||||
font.pixelSize: popup.avatarHeight * 0.5
|
||||
text: model.roomName
|
||||
textFormat: Text.RichText
|
||||
|
@ -261,6 +262,7 @@ Control {
|
|||
Label {
|
||||
color: model.index == popup.currentIndex ? palette.highlightedText : palette.text
|
||||
font.italic: model.isTombstoned
|
||||
font.bold: model.isSpace
|
||||
text: model.roomName
|
||||
textFormat: Text.RichText
|
||||
}
|
||||
|
|
|
@ -2866,6 +2866,7 @@ Cache::roomNamesAndAliases()
|
|||
.alias = std::move(alias),
|
||||
.recent_activity = info.approximate_last_modification_ts,
|
||||
.is_tombstoned = info.is_tombstoned,
|
||||
.is_space = info.is_space,
|
||||
});
|
||||
} catch (std::exception &e) {
|
||||
nhlog::db()->warn("Failed to add room {} to result: {}", room_id, e.what());
|
||||
|
|
|
@ -110,6 +110,7 @@ struct RoomNameAlias
|
|||
std::string id, name, alias;
|
||||
std::uint64_t recent_activity;
|
||||
bool is_tombstoned;
|
||||
bool is_space;
|
||||
};
|
||||
|
||||
//! Basic information per member.
|
||||
|
|
|
@ -36,6 +36,7 @@ RoomsModel::roleNames() const
|
|||
{Roles::RoomID, "roomid"},
|
||||
{Roles::RoomName, "roomName"},
|
||||
{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();
|
||||
case Roles::IsTombstoned:
|
||||
return rooms[index.row()].is_tombstoned;
|
||||
case Roles::IsSpace:
|
||||
return rooms[index.row()].is_space;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
|
|
|
@ -19,6 +19,7 @@ public:
|
|||
RoomID,
|
||||
RoomName,
|
||||
IsTombstoned,
|
||||
IsSpace,
|
||||
};
|
||||
|
||||
RoomsModel(bool showOnlyRoomWithAliases = false, QObject *parent = nullptr);
|
||||
|
|
Loading…
Reference in a new issue