Compare commits
1 Commits
work/runne
...
work/tfell
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1a36de9a2 |
@@ -46,6 +46,11 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actions.main: Kirigami.Action {
|
||||||
|
text: i18n("New room")
|
||||||
|
icon.name: "list-add"
|
||||||
|
}
|
||||||
|
|
||||||
function goToNextRoom() {
|
function goToNextRoom() {
|
||||||
do {
|
do {
|
||||||
listView.incrementCurrentIndex();
|
listView.incrementCurrentIndex();
|
||||||
@@ -70,8 +75,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component {
|
Component {
|
||||||
id: searchField
|
id: searchField
|
||||||
Kirigami.SearchField {
|
Kirigami.SearchField {
|
||||||
Layout.topMargin: Kirigami.Units.smallSpacing
|
Layout.margins: Kirigami.Units.smallSpacing
|
||||||
Layout.bottomMargin: Kirigami.Units.smallSpacing
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onTextChanged: sortFilterRoomListModel.filterText = text
|
onTextChanged: sortFilterRoomListModel.filterText = text
|
||||||
@@ -271,6 +275,7 @@ Kirigami.ScrollablePage {
|
|||||||
id: configButton
|
id: configButton
|
||||||
visible: roomListItem.hovered || Kirigami.Settings.isMobile
|
visible: roomListItem.hovered || Kirigami.Settings.isMobile
|
||||||
Accessible.name: i18n("Configure room")
|
Accessible.name: i18n("Configure room")
|
||||||
|
flat: true
|
||||||
|
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
id: optionAction
|
id: optionAction
|
||||||
|
|||||||
136
qml/main.qml
136
qml/main.qml
@@ -6,7 +6,7 @@ import QtQuick 2.15
|
|||||||
import QtQuick.Controls 2.15 as QQC2
|
import QtQuick.Controls 2.15 as QQC2
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
|
|
||||||
import org.kde.kirigami 2.15 as Kirigami
|
import org.kde.kirigami 2.19 as Kirigami
|
||||||
|
|
||||||
import org.kde.neochat 1.0
|
import org.kde.neochat 1.0
|
||||||
import NeoChat.Component 1.0
|
import NeoChat.Component 1.0
|
||||||
@@ -224,56 +224,6 @@ Kirigami.ApplicationWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
globalDrawer: Kirigami.GlobalDrawer {
|
|
||||||
property bool hasLayer
|
|
||||||
contentItem.implicitWidth: columnWidth
|
|
||||||
isMenu: true
|
|
||||||
actions: [
|
|
||||||
Kirigami.Action {
|
|
||||||
text: i18n("Explore rooms")
|
|
||||||
icon.name: "compass"
|
|
||||||
onTriggered: pushReplaceLayer("qrc:/imports/NeoChat/Page/JoinRoomPage.qml", {"connection": Controller.activeConnection})
|
|
||||||
enabled: pageStack.layers.currentItem.title !== i18n("Explore Rooms") && Controller.accountCount > 0
|
|
||||||
},
|
|
||||||
Kirigami.Action {
|
|
||||||
text: i18n("Start a Chat")
|
|
||||||
icon.name: "irc-join-channel"
|
|
||||||
onTriggered: pushReplaceLayer("qrc:/imports/NeoChat/Page/StartChatPage.qml", {"connection": Controller.activeConnection})
|
|
||||||
enabled: pageStack.layers.currentItem.title !== i18n("Start a Chat") && Controller.accountCount > 0
|
|
||||||
},
|
|
||||||
Kirigami.Action {
|
|
||||||
text: i18n("Create a Room")
|
|
||||||
icon.name: "irc-join-channel"
|
|
||||||
onTriggered: {
|
|
||||||
let dialog = createRoomDialog.createObject(root.overlay);
|
|
||||||
dialog.open();
|
|
||||||
}
|
|
||||||
shortcut: StandardKey.New
|
|
||||||
enabled: pageStack.layers.currentItem.title !== i18n("Start a Chat") && Controller.accountCount > 0
|
|
||||||
},
|
|
||||||
Kirigami.Action {
|
|
||||||
text: i18n("Settings")
|
|
||||||
icon.name: "settings-configure"
|
|
||||||
onTriggered: pushReplaceLayer("qrc:/imports/NeoChat/Page/SettingsPage.qml")
|
|
||||||
enabled: pageStack.layers.currentItem.title !== i18n("Settings")
|
|
||||||
shortcut: StandardKey.Preferences
|
|
||||||
},
|
|
||||||
Kirigami.Action {
|
|
||||||
text: i18n("Logout")
|
|
||||||
icon.name: "list-remove-user"
|
|
||||||
enabled: Controller.accountCount > 0
|
|
||||||
onTriggered: Controller.logout(Controller.activeConnection, true)
|
|
||||||
},
|
|
||||||
Kirigami.Action {
|
|
||||||
text: i18n("Quit")
|
|
||||||
icon.name: "gtk-quit"
|
|
||||||
shortcut: StandardKey.Quit
|
|
||||||
onTriggered: Qt.quit()
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: Controller.setBlur(pageStack, Config.blur && !Config.compactLayout);
|
Component.onCompleted: Controller.setBlur(pageStack, Config.blur && !Config.compactLayout);
|
||||||
Connections {
|
Connections {
|
||||||
target: Config
|
target: Config
|
||||||
@@ -292,23 +242,6 @@ Kirigami.ApplicationWindow {
|
|||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: Config.blur && !Config.compactLayout ? Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 1 - Config.transparency) : "transparent"
|
color: Config.blur && !Config.compactLayout ? Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 1 - Config.transparency) : "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
|
||||||
id: roomListComponent
|
|
||||||
RoomListPage {
|
|
||||||
id: roomList
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: root.roomPage
|
|
||||||
function onSwitchRoomUp() {
|
|
||||||
roomList.goToNextRoom();
|
|
||||||
}
|
|
||||||
function onSwitchRoomDown() {
|
|
||||||
roomList.goToPreviousRoom();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: Controller
|
target: Controller
|
||||||
@@ -421,7 +354,7 @@ Kirigami.ApplicationWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property Item hoverLinkIndicator: QQC2.Control {
|
property Item hoverLinkIndicator: QQC2.Control {
|
||||||
parent: overlay.parent
|
parent: overlay.parent
|
||||||
property alias text: linkText.text
|
property alias text: linkText.text
|
||||||
opacity: text.length > 0 ? 1 : 0
|
opacity: text.length > 0 ? 1 : 0
|
||||||
|
|
||||||
@@ -436,4 +369,69 @@ Kirigami.ApplicationWindow {
|
|||||||
color: Kirigami.Theme.backgroundColor
|
color: Kirigami.Theme.backgroundColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: settingsPageComponent
|
||||||
|
SettingsPage {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: roomListComponent
|
||||||
|
RoomListPage {
|
||||||
|
id: roomList
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: root.roomPage
|
||||||
|
function onSwitchRoomUp() {
|
||||||
|
roomList.goToNextRoom();
|
||||||
|
}
|
||||||
|
function onSwitchRoomDown() {
|
||||||
|
roomList.goToPreviousRoom();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
footer: Kirigami.NavigationTabBar {
|
||||||
|
actions: [
|
||||||
|
Kirigami.Action {
|
||||||
|
icon.name: "globe"
|
||||||
|
text: "Spaces"
|
||||||
|
checked: fooPage.visble
|
||||||
|
onTriggered: {
|
||||||
|
console.warn("foo")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Kirigami.Action {
|
||||||
|
icon.name: "dialog-messages"
|
||||||
|
text: "Rooms"
|
||||||
|
checked: fooPage.visble
|
||||||
|
onTriggered: {
|
||||||
|
while (pageStack.depth > 0) {
|
||||||
|
pageStack.pop();
|
||||||
|
}
|
||||||
|
pageStack.push(roomListComponent);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Kirigami.Action {
|
||||||
|
icon.name: "document-open-recent-symbolic"
|
||||||
|
text: "Recent"
|
||||||
|
checked: fooPage.visble
|
||||||
|
onTriggered: {
|
||||||
|
console.warn("foo")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Kirigami.Action {
|
||||||
|
icon.name: "settings-configure"
|
||||||
|
text: "Settings"
|
||||||
|
checked: fooPage.visble
|
||||||
|
onTriggered: {
|
||||||
|
while (pageStack.depth > 0) {
|
||||||
|
pageStack.pop();
|
||||||
|
}
|
||||||
|
pageStack.push(settingsPageComponent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user