qml/RoomDrawer: Add & fix separators
A separator has been added to the drawer view's left side, and the position of the NavigationTabBar has been set so it correctly draws the separator at the top and not the bottom.
This commit is contained in:
committed by
Tobias Fella
parent
607db82db0
commit
5a03ce4e95
@@ -81,83 +81,93 @@ Kirigami.OverlayDrawer {
|
|||||||
id: loader
|
id: loader
|
||||||
active: root.drawerOpen
|
active: root.drawerOpen
|
||||||
|
|
||||||
sourceComponent: ColumnLayout {
|
sourceComponent: RowLayout {
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
Component.onCompleted: infoAction.toggle()
|
Kirigami.Separator {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
|
||||||
QQC2.ToolBar {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
spacing: 0
|
||||||
|
|
||||||
Layout.preferredHeight: pageStack.globalToolBar.preferredHeight
|
Component.onCompleted: infoAction.toggle()
|
||||||
|
|
||||||
contentItem: RowLayout {
|
QQC2.ToolBar {
|
||||||
Kirigami.Heading {
|
Layout.fillWidth: true
|
||||||
Layout.fillWidth: true
|
|
||||||
text: drawerItemLoader.item ? drawerItemLoader.item.title : ""
|
|
||||||
}
|
|
||||||
|
|
||||||
QQC2.ToolButton {
|
Layout.preferredHeight: pageStack.globalToolBar.preferredHeight
|
||||||
id: settingsButton
|
|
||||||
|
|
||||||
display: QQC2.AbstractButton.IconOnly
|
contentItem: RowLayout {
|
||||||
text: i18nc("@action:button", "Room settings")
|
Kirigami.Heading {
|
||||||
icon.name: 'settings-configure-symbolic'
|
Layout.fillWidth: true
|
||||||
|
text: drawerItemLoader.item ? drawerItemLoader.item.title : ""
|
||||||
|
}
|
||||||
|
|
||||||
QQC2.ToolTip.text: text
|
QQC2.ToolButton {
|
||||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
id: settingsButton
|
||||||
QQC2.ToolTip.visible: hovered
|
|
||||||
|
|
||||||
onClicked: {
|
display: QQC2.AbstractButton.IconOnly
|
||||||
RoomSettingsView.openRoomSettings(root.room, RoomSettingsView.Room);
|
text: i18nc("@action:button", "Room settings")
|
||||||
|
icon.name: 'settings-configure-symbolic'
|
||||||
|
|
||||||
|
QQC2.ToolTip.text: text
|
||||||
|
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
|
QQC2.ToolTip.visible: hovered
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
RoomSettingsView.openRoomSettings(root.room, RoomSettingsView.Room);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: drawerItemLoader
|
id: drawerItemLoader
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
sourceComponent: roomInformation
|
sourceComponent: roomInformation
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: roomInformation
|
|
||||||
RoomInformation {
|
|
||||||
room: root.room
|
|
||||||
connection: root.connection
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: roomMedia
|
id: roomInformation
|
||||||
RoomMedia {
|
RoomInformation {
|
||||||
currentRoom: root.room
|
room: root.room
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Kirigami.NavigationTabBar {
|
|
||||||
id: navigationBar
|
|
||||||
Layout.fillWidth: true
|
|
||||||
visible: !root.room.isSpace
|
|
||||||
Kirigami.Theme.colorSet: Kirigami.Theme.Window
|
|
||||||
Kirigami.Theme.inherit: false
|
|
||||||
|
|
||||||
actions: [
|
|
||||||
Kirigami.Action {
|
|
||||||
id: infoAction
|
|
||||||
text: i18n("Information")
|
|
||||||
icon.name: "documentinfo"
|
|
||||||
onTriggered: drawerItemLoader.sourceComponent = roomInformation
|
|
||||||
},
|
|
||||||
Kirigami.Action {
|
|
||||||
text: i18n("Media")
|
|
||||||
icon.name: "mail-attachment-symbollic"
|
|
||||||
onTriggered: drawerItemLoader.sourceComponent = roomMedia
|
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: roomMedia
|
||||||
|
RoomMedia {
|
||||||
|
currentRoom: root.room
|
||||||
|
connection: root.connection
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Kirigami.NavigationTabBar {
|
||||||
|
id: navigationBar
|
||||||
|
Layout.fillWidth: true
|
||||||
|
visible: !root.room.isSpace
|
||||||
|
Kirigami.Theme.colorSet: Kirigami.Theme.Window
|
||||||
|
Kirigami.Theme.inherit: false
|
||||||
|
|
||||||
|
position: QQC2.ToolBar.Footer
|
||||||
|
|
||||||
|
actions: [
|
||||||
|
Kirigami.Action {
|
||||||
|
id: infoAction
|
||||||
|
text: i18n("Information")
|
||||||
|
icon.name: "documentinfo"
|
||||||
|
onTriggered: drawerItemLoader.sourceComponent = roomInformation
|
||||||
|
},
|
||||||
|
Kirigami.Action {
|
||||||
|
text: i18n("Media")
|
||||||
|
icon.name: "mail-attachment-symbollic"
|
||||||
|
onTriggered: drawerItemLoader.sourceComponent = roomMedia
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user