qt-chat-app

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 733fc6cb51a0e46c9b7308b15245e27533a5315d
parent 003938557a906bc29822dc72625d81e282cfecdf
Author: Silas Brack <silasbrack@Silass-MacBook-Pro.local>
Date:   Mon, 26 Jan 2026 22:59:20 +0100

Add splash screen with logo and Get Started button

Diffstat:
Mmain.qml | 17+++++++++++++++--
Mqml.qrc | 1+
Aqml/views/SplashView.qml | 121+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 137 insertions(+), 2 deletions(-)

diff --git a/main.qml b/main.qml @@ -142,6 +142,7 @@ Window { property var navigationStack: [] property var stackView: stackViewItem // Expose for child views property var messageCache: globalMessageCache // Expose globally + property bool credentialsChecked: false Component.onCompleted: { // Check for saved credentials on startup @@ -154,12 +155,24 @@ Window { function onAutoLoginSuccess() { console.log("Auto-login successful, navigating to chat list") + credentialsChecked = true stackViewItem.replace("qrc:/qml/views/ChatListView.qml") } function onAutoLoginFailed(reason) { console.log("Auto-login failed:", reason) - // Stay on login view (already loaded by default) + credentialsChecked = true + + // Show "Get Started" button on splash screen + console.log("contentLoader.item exists:", contentLoader.item !== null) + console.log("contentLoader.source:", contentLoader.source) + if (contentLoader.item) { + console.log("Setting showGetStartedButton to true") + contentLoader.item.showGetStartedButton = true + console.log("showGetStartedButton is now:", contentLoader.item.showGetStartedButton) + } else { + console.log("ERROR: contentLoader.item is null!") + } } } @@ -170,7 +183,7 @@ Window { Loader { id: contentLoader anchors.fill: parent - source: "qrc:/qml/views/LoginView.qml" + source: "qrc:/qml/views/SplashView.qml" onLoaded: { if (item) { diff --git a/qml.qrc b/qml.qrc @@ -5,6 +5,7 @@ <!-- Views --> <file>qml/views/LoginView.qml</file> + <file>qml/views/SplashView.qml</file> <file>qml/views/ChatListView.qml</file> <file>qml/views/MessageThreadView.qml</file> <file>qml/views/ProfileView.qml</file> diff --git a/qml/views/SplashView.qml b/qml/views/SplashView.qml @@ -0,0 +1,121 @@ +import QtQuick +import QtQuick.Layouts +import "../styles" + +Item { + id: root + + // Property to control button visibility + property bool showGetStartedButton: false + + onShowGetStartedButtonChanged: { + console.log("SplashView: showGetStartedButton changed to:", showGetStartedButton) + } + + Component.onCompleted: { + console.log("SplashView loaded!") + } + + Rectangle { + anchors.fill: parent + color: TelegramStyle.backgroundColor + + ColumnLayout { + anchors.centerIn: parent + spacing: TelegramStyle.standardMargin * 3 + width: 300 + + // Logo + Image { + Layout.alignment: Qt.AlignHCenter + source: "qrc:/logo.png" + width: 200 + height: 200 + fillMode: Image.PreserveAspectFit + smooth: true + } + + // App name/title + Text { + Layout.alignment: Qt.AlignHCenter + text: "Beegram" + font.pixelSize: 32 + font.bold: true + color: TelegramStyle.textPrimary + } + + // "Get Started" button - only visible when credentials check fails + Rectangle { + id: getStartedButton + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + height: 48 + radius: 6 + color: buttonMouseArea.containsMouse ? TelegramStyle.accentColor : TelegramStyle.primaryColor + visible: root.showGetStartedButton + + Behavior on color { + ColorAnimation { duration: 100 } + } + + Text { + anchors.centerIn: parent + text: "Get Started" + font.pixelSize: TelegramStyle.fontSizeNormal + font.bold: true + color: "white" + } + + MouseArea { + id: buttonMouseArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: { + // Navigate to LoginView + if (typeof stackView !== 'undefined' && stackView) { + stackView.replace("qrc:/qml/views/LoginView.qml") + } + } + } + } + + // Loading indicator (shown while checking credentials) + Item { + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + height: 48 + visible: !root.showGetStartedButton + + // Simple rotating spinner + Rectangle { + anchors.centerIn: parent + width: 32 + height: 32 + color: "transparent" + border.color: TelegramStyle.primaryColor + border.width: 3 + radius: 16 + + Rectangle { + width: 8 + height: 8 + radius: 4 + color: TelegramStyle.primaryColor + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: -4 + } + + RotationAnimation on rotation { + from: 0 + to: 360 + duration: 1000 + loops: Animation.Infinite + running: !root.showGetStartedButton + } + } + } + } + } +}