Spaces are now bold

pull/1614/head
Nicolas Werner 1 year ago
parent 8b39b65d43
commit bd1cadb6bb
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 2
      resources/qml/Completer.qml
  2. 1
      src/Cache.cpp
  3. 1
      src/CacheStructs.h
  4. 3
      src/RoomsModel.cpp
  5. 1
      src/RoomsModel.h

@ -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…
Cancel
Save