mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +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 {
|
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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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());
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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 {};
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue