diff --git a/resources/qml/PrivacyScreen.qml b/resources/qml/PrivacyScreen.qml
index e6286bc6..6ad2a557 100644
--- a/resources/qml/PrivacyScreen.qml
+++ b/resources/qml/PrivacyScreen.qml
@@ -5,6 +5,7 @@
import QtGraphicalEffects 1.0
import QtQuick 2.12
+import QtQuick.Window 2.2
import im.nheko 1.0
Item {
@@ -15,7 +16,7 @@ Item {
Connections {
function onFocusChanged() {
- if (TimelineManager.isWindowFocused) {
+ if (MainWindow.active) {
screenSaverTimer.stop();
screenSaver.state = "Invisible";
} else {
@@ -25,14 +26,14 @@ Item {
}
}
- target: TimelineManager
+ target: MainWindow
}
Timer {
id: screenSaverTimer
interval: screenTimeout * 1000
- running: true
+ running: !MainWindow.active
onTriggered: {
screenSaver.state = "Visible";
}
diff --git a/resources/qml/Root.qml b/resources/qml/Root.qml
index e4b164e4..004169e1 100644
--- a/resources/qml/Root.qml
+++ b/resources/qml/Root.qml
@@ -17,10 +17,12 @@ import QtQuick.Window 2.15
import im.nheko 1.0
import im.nheko.EmojiModel 1.0
-Page {
+Pane {
id: timelineRoot
palette: Nheko.colors
+ background: null
+ padding: 0
FontMetrics {
id: fontMetrics
@@ -157,7 +159,6 @@ Page {
sequence: "Ctrl+K"
onActivated: {
var quickSwitch = quickSwitcherComponent.createObject(timelineRoot);
- TimelineManager.focusTimeline();
quickSwitch.open();
}
}
@@ -165,7 +166,6 @@ Page {
Shortcut {
// Add alternative shortcut, because sometimes Alt+A is stolen by the TextEdit
sequences: ["Alt+A", "Ctrl+Shift+A"]
- context: Qt.ApplicationShortcut
onActivated: Rooms.nextRoomWithActivity()
}
@@ -366,9 +366,24 @@ Page {
id: mainWindow
anchors.fill: parent
- initialItem: ChatPage {
+ initialItem: WelcomePage {
//anchors.fill: parent
}
}
+ Component {
+ id: chatPage
+
+ ChatPage {
+ }
+ }
+
+ Connections {
+ function onSwitchToChatPage() {
+ console.log("AAAA");
+ mainWindow.replace(chatPage);
+ }
+ target: MainWindow
+ }
+
}
diff --git a/resources/qml/components/FlatButton.qml b/resources/qml/components/FlatButton.qml
index 8ca3f104..72184d28 100644
--- a/resources/qml/components/FlatButton.qml
+++ b/resources/qml/components/FlatButton.qml
@@ -12,7 +12,7 @@ import im.nheko 1.0
Button {
id: control
- implicitHeight: Math.ceil(control.contentItem.implicitHeight * 1.5)
+ implicitHeight: Math.ceil(control.contentItem.implicitHeight * 1.70)
implicitWidth: Math.ceil(control.contentItem.implicitWidth + control.contentItem.implicitHeight)
hoverEnabled: true
@@ -42,7 +42,7 @@ Button {
background: Rectangle {
//height: control.contentItem.implicitHeight * 2
//width: control.contentItem.implicitWidth * 2
- radius: height / 6
+ radius: height / 8
color: Qt.lighter(Nheko.colors.dark, control.down ? 1.4 : (control.hovered ? 1.2 : 1))
}
diff --git a/resources/qml/pages/WelcomePage.qml b/resources/qml/pages/WelcomePage.qml
new file mode 100644
index 00000000..d95b6104
--- /dev/null
+++ b/resources/qml/pages/WelcomePage.qml
@@ -0,0 +1,76 @@
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Layouts 1.2
+import QtQuick.Window 2.15
+import im.nheko 1.0
+import "../components/"
+
+ColumnLayout {
+ FontMetrics {
+ id: fontMetrics
+ }
+
+ Shortcut {
+ sequence: StandardKey.Quit
+ onActivated: Qt.quit()
+ }
+
+ Item {
+ Layout.fillHeight: true
+ }
+
+ Image {
+ Layout.alignment: Qt.AlignHCenter
+ source: "qrc:/logos/splash.png"
+ height: 256
+ width: 256
+ }
+
+ Label {
+ Layout.margins: Nheko.paddingLarge
+ Layout.bottomMargin: 0
+ Layout.alignment: Qt.AlignHCenter
+ Layout.fillWidth: true
+ text: qsTr("Welcome to nheko! The desktop client for the Matrix protocol.")
+ color: Nheko.colors.text
+ font.pointSize: fontMetrics.font.pointSize*2
+ wrapMode: Text.Wrap
+ horizontalAlignment: Text.AlignHCenter
+ }
+ Label {
+ Layout.margins: Nheko.paddingLarge
+ Layout.alignment: Qt.AlignHCenter
+ Layout.fillWidth: true
+ text: qsTr("Enjoy your stay!")
+ color: Nheko.colors.text
+ font.pointSize: fontMetrics.font.pointSize*1.5
+ wrapMode: Text.Wrap
+ horizontalAlignment: Text.AlignHCenter
+ }
+
+ RowLayout {
+ Item {
+ Layout.fillWidth: true
+ }
+ FlatButton {
+ Layout.margins: Nheko.paddingLarge
+ Layout.alignment: Qt.AlignHCenter
+ text: qsTr("REGISTER")
+ onClicked: {
+ }
+ }
+ FlatButton {
+ Layout.margins: Nheko.paddingLarge
+ Layout.alignment: Qt.AlignHCenter
+ text: qsTr("LOGIN")
+ onClicked: {
+ }
+ }
+ Item {
+ Layout.fillWidth: true
+ }
+}
+ Item {
+ Layout.fillHeight: true
+ }
+}
|