mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Only show room pack button, when you can actually create one
This commit is contained in:
parent
a0699f5247
commit
d46e517e3a
4 changed files with 7 additions and 3 deletions
|
@ -192,8 +192,9 @@ Page {
|
|||
userProfile.show();
|
||||
}
|
||||
|
||||
function onShowImagePackSettings(packlist) {
|
||||
function onShowImagePackSettings(room, packlist) {
|
||||
var packSet = packSettingsComponent.createObject(timelineRoot, {
|
||||
"room": room,
|
||||
"packlist": packlist
|
||||
});
|
||||
packSet.show();
|
||||
|
|
|
@ -12,6 +12,7 @@ import im.nheko 1.0
|
|||
ApplicationWindow {
|
||||
id: win
|
||||
|
||||
property Room room
|
||||
property ImagePackListModel packlist
|
||||
property int avatarSize: Math.ceil(fontMetrics.lineSpacing * 2.3)
|
||||
property SingleImagePackModel currentPack: packlist.packAt(currentPackIndex)
|
||||
|
@ -85,6 +86,7 @@ ApplicationWindow {
|
|||
dialog.show();
|
||||
}
|
||||
width: packlistC.width
|
||||
visible: room.permissions.canChange(MtxEvent.ImagePackInRoom)
|
||||
text: qsTr("New room pack")
|
||||
}
|
||||
|
||||
|
|
|
@ -418,7 +418,8 @@ TimelineViewManager::openImageOverlay(QString mxcUrl, QString eventId)
|
|||
void
|
||||
TimelineViewManager::openImagePackSettings(QString roomid)
|
||||
{
|
||||
emit showImagePackSettings(new ImagePackListModel(roomid.toStdString(), this));
|
||||
auto room = rooms_->getRoomById(roomid).get();
|
||||
emit showImagePackSettings(room, new ImagePackListModel(roomid.toStdString(), this));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -91,7 +91,7 @@ signals:
|
|||
void openRoomSettingsDialog(RoomSettings *settings);
|
||||
void openInviteUsersDialog(InviteesModel *invitees);
|
||||
void openProfile(UserProfile *profile);
|
||||
void showImagePackSettings(ImagePackListModel *packlist);
|
||||
void showImagePackSettings(TimelineModel *room, ImagePackListModel *packlist);
|
||||
void openLeaveRoomDialog(QString roomid);
|
||||
|
||||
public slots:
|
||||
|
|
Loading…
Reference in a new issue