2017-08-29 05:02:56 +00:00
|
|
|
import QtQuick 2.4
|
2017-08-29 14:28:33 +00:00
|
|
|
import QtQuick.Controls 2.1
|
|
|
|
import QtQuick.Controls.Material 2.1
|
2017-08-29 05:02:56 +00:00
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
|
|
|
|
ApplicationWindow {
|
|
|
|
id: mainWindow
|
|
|
|
visible: true
|
|
|
|
Material.theme: Material.Dark
|
|
|
|
Material.accent: Material.Purple
|
|
|
|
|
|
|
|
// flags: Qt.FramelessWindowHint
|
|
|
|
minimumWidth: 800
|
2019-05-06 18:21:22 +00:00
|
|
|
minimumHeight: 450
|
2017-08-29 05:02:56 +00:00
|
|
|
|
|
|
|
Item {
|
2019-05-02 08:37:04 +00:00
|
|
|
MessagePopup {
|
|
|
|
id: messagePopup
|
2019-05-06 18:21:22 +00:00
|
|
|
width: mainWindow.width * 0.8
|
|
|
|
// height: mainWindow.height * 0.8
|
2017-08-29 05:02:56 +00:00
|
|
|
x: mainWindow.width / 2 - width / 2
|
2019-05-05 16:21:38 +00:00
|
|
|
y: mainWindow.height / 2 - height / 2 - mainWindow.header.height
|
|
|
|
}
|
|
|
|
|
|
|
|
ConversationPopup {
|
|
|
|
id: conversationPopup
|
|
|
|
width: mainWindow.width * 0.8
|
|
|
|
height: mainWindow.height * 0.8
|
|
|
|
x: mainWindow.width / 2 - width / 2
|
|
|
|
y: mainWindow.height / 2 - height / 2 - mainWindow.header.height
|
2017-08-29 05:02:56 +00:00
|
|
|
}
|
|
|
|
|
2019-05-06 18:16:20 +00:00
|
|
|
AccountPopup {
|
|
|
|
id: accountPopup
|
|
|
|
width: mainWindow.width * 0.8
|
|
|
|
height: mainWindow.height * 0.8
|
|
|
|
x: mainWindow.width / 2 - width / 2
|
|
|
|
y: mainWindow.height / 2 - height / 2 - mainWindow.header.height
|
|
|
|
}
|
|
|
|
|
2017-08-29 05:02:56 +00:00
|
|
|
AboutDialog {
|
|
|
|
id: aboutDialog
|
|
|
|
x: (mainWindow.width - width) / 2
|
|
|
|
y: mainWindow.height / 6
|
|
|
|
width: Math.min(mainWindow.width, mainWindow.height) / 3 * 2
|
|
|
|
}
|
|
|
|
|
2019-05-05 11:41:07 +00:00
|
|
|
ConnectDialog {
|
|
|
|
id: connectDialog
|
|
|
|
x: mainWindow.width / 2 - width / 2
|
2019-05-05 16:21:38 +00:00
|
|
|
y: mainWindow.height / 2 - height / 2 - mainWindow.header.height
|
2019-05-05 11:41:07 +00:00
|
|
|
width: 340
|
|
|
|
height: 340
|
|
|
|
}
|
|
|
|
|
2017-08-29 05:02:56 +00:00
|
|
|
SettingsDialog {
|
|
|
|
id: settingsDialog
|
|
|
|
x: (mainWindow.width - width) / 2
|
|
|
|
y: mainWindow.height / 6
|
|
|
|
width: Math.min(mainWindow.width, mainWindow.height) / 3 * 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
header: ToolBar {
|
|
|
|
/* MouseArea {
|
|
|
|
anchors.fill: parent;
|
|
|
|
property variant clickPos: "1,1"
|
|
|
|
|
|
|
|
onPressed: {
|
|
|
|
clickPos = Qt.point(mouse.x,mouse.y)
|
|
|
|
}
|
|
|
|
|
|
|
|
onPositionChanged: {
|
|
|
|
var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y)
|
|
|
|
mainWindow.x += delta.x;
|
|
|
|
mainWindow.y += delta.y;
|
|
|
|
}
|
|
|
|
} */
|
2017-08-31 18:54:29 +00:00
|
|
|
|
2017-08-29 05:02:56 +00:00
|
|
|
RowLayout {
|
|
|
|
spacing: 20
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
ToolButton {
|
|
|
|
id: drawerButton
|
|
|
|
contentItem: Image {
|
|
|
|
fillMode: Image.Pad
|
|
|
|
horizontalAlignment: Image.AlignHCenter
|
|
|
|
verticalAlignment: Image.AlignVCenter
|
|
|
|
source: "images/drawer.png"
|
|
|
|
}
|
|
|
|
onClicked: {
|
|
|
|
drawer.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
spacing: 8
|
|
|
|
Layout.topMargin: 4
|
|
|
|
Layout.bottomMargin: 4
|
|
|
|
|
|
|
|
ImageButton {
|
|
|
|
opacity: 1.0
|
|
|
|
rounded: true
|
|
|
|
horizontalAlignment: Image.AlignHCenter
|
|
|
|
verticalAlignment: Image.AlignVCenter
|
|
|
|
source: accountBridge.avatar
|
|
|
|
sourceSize.height: 32
|
2017-08-31 18:54:57 +00:00
|
|
|
onClicked: function() {
|
2019-05-02 08:37:29 +00:00
|
|
|
Qt.openUrlExternally(accountBridge.profileURL)
|
2017-08-31 18:54:57 +00:00
|
|
|
}
|
2017-08-29 05:02:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: titleLabel
|
|
|
|
text: accountBridge.username
|
|
|
|
font.pixelSize: 16
|
|
|
|
elide: Label.ElideRight
|
|
|
|
horizontalAlignment: Image.AlignHCenter
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-05 12:59:38 +00:00
|
|
|
ToolButton {
|
|
|
|
id: postButton
|
|
|
|
anchors.right: menuButton.left
|
|
|
|
contentItem: Image {
|
|
|
|
fillMode: Image.Pad
|
|
|
|
horizontalAlignment: Image.AlignHCenter
|
|
|
|
verticalAlignment: Image.AlignVCenter
|
|
|
|
source: "images/post.png"
|
|
|
|
}
|
|
|
|
onClicked: {
|
|
|
|
messagePopup.messageid = 0
|
|
|
|
messagePopup.open()
|
|
|
|
}
|
|
|
|
}
|
2017-08-29 05:02:56 +00:00
|
|
|
ToolButton {
|
|
|
|
id: menuButton
|
2019-05-05 13:17:46 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2017-08-29 05:02:56 +00:00
|
|
|
contentItem: Image {
|
|
|
|
fillMode: Image.Pad
|
|
|
|
horizontalAlignment: Image.AlignHCenter
|
|
|
|
verticalAlignment: Image.AlignVCenter
|
|
|
|
source: "images/menu.png"
|
|
|
|
}
|
|
|
|
onClicked: optionsMenu.open()
|
|
|
|
|
|
|
|
Menu {
|
|
|
|
id: optionsMenu
|
|
|
|
x: parent.width - width
|
|
|
|
transformOrigin: Menu.TopRight
|
|
|
|
|
|
|
|
MenuItem {
|
2017-08-31 18:55:29 +00:00
|
|
|
text: qsTr("Settings")
|
2017-08-29 05:02:56 +00:00
|
|
|
onTriggered: settingsDialog.open()
|
|
|
|
}
|
|
|
|
MenuItem {
|
2017-08-31 18:55:29 +00:00
|
|
|
text: qsTr("About")
|
2017-08-29 05:02:56 +00:00
|
|
|
onTriggered: aboutDialog.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Drawer {
|
|
|
|
id: drawer
|
|
|
|
width: mainWindow.width / 3
|
|
|
|
height: mainWindow.height
|
|
|
|
dragMargin: 0
|
|
|
|
|
2019-05-05 12:57:56 +00:00
|
|
|
ColumnLayout {
|
2017-08-29 05:02:56 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
|
2019-05-06 18:16:20 +00:00
|
|
|
AccountSummary {
|
|
|
|
profile: accountBridge
|
|
|
|
}
|
2019-05-05 12:57:56 +00:00
|
|
|
ToolSeparator {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
orientation: Qt.Horizontal
|
2017-08-29 05:02:56 +00:00
|
|
|
}
|
|
|
|
|
2019-05-05 12:57:56 +00:00
|
|
|
ListView {
|
|
|
|
id: listView
|
|
|
|
currentIndex: -1
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
delegate: ItemDelegate {
|
|
|
|
width: parent.width
|
|
|
|
text: model.title
|
|
|
|
highlighted: ListView.isCurrentItem
|
|
|
|
onClicked: {
|
|
|
|
listView.currentIndex = -1
|
|
|
|
drawer.close()
|
|
|
|
switch (model.sid) {
|
|
|
|
case 0:
|
|
|
|
connectDialog.open()
|
|
|
|
break
|
|
|
|
case 1:
|
|
|
|
messagePopup.messageid = 0
|
|
|
|
messagePopup.open()
|
|
|
|
break
|
|
|
|
case 2:
|
|
|
|
Qt.quit()
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
model: ListModel {
|
|
|
|
ListElement {
|
|
|
|
title: qsTr("Connect")
|
|
|
|
property int sid: 0
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
title: qsTr("New Post")
|
|
|
|
property int sid: 1
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
title: qsTr("Exit")
|
|
|
|
property int sid: 2
|
|
|
|
}
|
2017-08-29 05:02:56 +00:00
|
|
|
}
|
2019-05-05 12:57:56 +00:00
|
|
|
ScrollIndicator.vertical: ScrollIndicator {
|
2017-08-29 05:02:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
id: maingrid
|
|
|
|
columns: 2
|
|
|
|
rows: 1
|
|
|
|
anchors.fill: parent
|
2017-08-30 12:48:06 +00:00
|
|
|
anchors.margins: 0
|
|
|
|
columnSpacing: 0
|
|
|
|
rowSpacing: 0
|
2017-08-29 05:02:56 +00:00
|
|
|
|
2019-05-02 08:37:04 +00:00
|
|
|
MessagePane {
|
2017-08-29 05:02:56 +00:00
|
|
|
Layout.row: 0
|
|
|
|
Layout.column: 0
|
|
|
|
|
|
|
|
name: qsTr("Messages")
|
|
|
|
messageModel: accountBridge.messages
|
|
|
|
}
|
|
|
|
|
2019-05-02 08:37:04 +00:00
|
|
|
MessagePane {
|
2017-08-29 05:02:56 +00:00
|
|
|
Layout.row: 0
|
|
|
|
Layout.column: 1
|
|
|
|
|
|
|
|
name: qsTr("Notifications")
|
|
|
|
messageModel: accountBridge.notifications
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|