mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Show userid in completer
This commit is contained in:
parent
c07c326141
commit
37df79f796
3 changed files with 9 additions and 0 deletions
|
@ -111,6 +111,11 @@ Popup {
|
||||||
color: model.index == popup.currentIndex ? colors.highlightedText : colors.text
|
color: model.index == popup.currentIndex ? colors.highlightedText : colors.text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: "(" + model.userid + ")"
|
||||||
|
color: model.index == popup.currentIndex ? colors.highlightedText : colors.buttonText
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ UsersModel::roleNames() const
|
||||||
{CompletionModel::SearchRole2, "searchRole2"},
|
{CompletionModel::SearchRole2, "searchRole2"},
|
||||||
{Roles::DisplayName, "displayName"},
|
{Roles::DisplayName, "displayName"},
|
||||||
{Roles::AvatarUrl, "avatarUrl"},
|
{Roles::AvatarUrl, "avatarUrl"},
|
||||||
|
{Roles::UserID, "userid"},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +45,8 @@ UsersModel::data(const QModelIndex &index, int role) const
|
||||||
case Roles::AvatarUrl:
|
case Roles::AvatarUrl:
|
||||||
return cache::avatarUrl(QString::fromStdString(room_id),
|
return cache::avatarUrl(QString::fromStdString(room_id),
|
||||||
QString::fromStdString(roomMembers_[index.row()]));
|
QString::fromStdString(roomMembers_[index.row()]));
|
||||||
|
case Roles::UserID:
|
||||||
|
return userids[index.row()];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
|
|
|
@ -9,6 +9,7 @@ public:
|
||||||
{
|
{
|
||||||
AvatarUrl = Qt::UserRole,
|
AvatarUrl = Qt::UserRole,
|
||||||
DisplayName,
|
DisplayName,
|
||||||
|
UserID,
|
||||||
};
|
};
|
||||||
|
|
||||||
UsersModel(const std::string &roomId, QObject *parent = nullptr);
|
UsersModel(const std::string &roomId, QObject *parent = nullptr);
|
||||||
|
|
Loading…
Reference in a new issue