Cleanup buttons
Mostly removing the usage of the action property, since there's no point in using it. Also add some translation contexts and some other minor cleanup
This commit is contained in:
committed by
Tobias Fella
parent
9b763daf52
commit
45b02ae34e
@@ -56,14 +56,12 @@ RowLayout {
|
||||
Accessible.onPressAction: menuButton.action.trigger()
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
checkable: true
|
||||
action: QQC2.Action {
|
||||
text: i18nc("@action:button", "Show Menu")
|
||||
icon.name: "application-menu-symbolic"
|
||||
onTriggered: {
|
||||
const item = menu.createObject(menuButton);
|
||||
item.closed.connect(menuButton.toggle);
|
||||
item.open();
|
||||
}
|
||||
text: i18nc("@action:button", "Show Menu")
|
||||
icon.name: "application-menu-symbolic"
|
||||
onClicked: {
|
||||
const item = menu.createObject(menuButton);
|
||||
item.closed.connect(menuButton.toggle);
|
||||
item.open();
|
||||
}
|
||||
|
||||
QQC2.ToolTip.visible: hovered
|
||||
@@ -87,13 +85,15 @@ RowLayout {
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Create a Room")
|
||||
icon.name: "system-users-symbolic"
|
||||
action: QQC2.Action {
|
||||
onTriggered: {
|
||||
Qt.createComponent('org.kde.neochat', 'CreateRoomDialog').createObject(root, {
|
||||
connection: root.connection
|
||||
}).open();
|
||||
}
|
||||
|
||||
Kirigami.Action {
|
||||
shortcut: StandardKey.New
|
||||
onTriggered: {
|
||||
Qt.createComponent('org.kde.neochat', 'CreateRoomDialog').createObject(root, {
|
||||
connection: root.connection
|
||||
}).open();
|
||||
}
|
||||
onTriggered: parent.trigger()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -138,32 +138,33 @@ Kirigami.NavigationTabBar {
|
||||
ColumnLayout {
|
||||
spacing: 0
|
||||
Delegates.RoundedItemDelegate {
|
||||
id: createRoomButton
|
||||
Layout.fillWidth: true
|
||||
action: Kirigami.Action {
|
||||
text: i18n("Create a Room")
|
||||
icon.name: "system-users-symbolic"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'CreateRoomPage'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Create a Room")
|
||||
});
|
||||
explorePopup.close();
|
||||
}
|
||||
text: i18nc("@action:button", "Create a Room")
|
||||
icon.name: "system-users-symbolic"
|
||||
onClicked: {
|
||||
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'CreateRoomPage'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Create a Room")
|
||||
});
|
||||
explorePopup.close();
|
||||
}
|
||||
|
||||
Kirigami.Action {
|
||||
shortcut: StandardKey.New
|
||||
onTriggered: createRoomButton.clicked()
|
||||
}
|
||||
}
|
||||
Delegates.RoundedItemDelegate {
|
||||
Layout.fillWidth: true
|
||||
action: Kirigami.Action {
|
||||
text: i18n("Create a Space")
|
||||
icon.name: "list-add"
|
||||
onTriggered: {
|
||||
Qt.createComponent('org.kde.neochat', 'CreateSpaceDialog').createObject(root, {
|
||||
connection: root.connection
|
||||
}).open();
|
||||
explorePopup.close();
|
||||
}
|
||||
text: i18nc("@action:button", "Create a Space")
|
||||
icon.name: "list-add"
|
||||
onClicked: {
|
||||
Qt.createComponent('org.kde.neochat', 'CreateSpaceDialog').createObject(root, {
|
||||
connection: root.connection
|
||||
}).open();
|
||||
explorePopup.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,13 +91,9 @@ RowLayout {
|
||||
}
|
||||
QQC2.ToolButton {
|
||||
display: QQC2.Button.IconOnly
|
||||
action: Kirigami.Action {
|
||||
text: i18nc("@action:button", "Open Settings")
|
||||
icon.name: "settings-configure-symbolic"
|
||||
onTriggered: {
|
||||
NeoChatSettingsView.open();
|
||||
}
|
||||
}
|
||||
text: i18nc("@action:button", "Open Settings")
|
||||
icon.name: "settings-configure-symbolic"
|
||||
onClicked: NeoChatSettingsView.open()
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
QQC2.ToolTip.visible: hovered
|
||||
|
||||
Reference in New Issue
Block a user