qt-chat-app

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

SplashView.qml (4081B)


      1 import QtQuick
      2 import QtQuick.Layouts
      3 import "../styles"
      4 
      5 Item {
      6     id: root
      7     anchors.fill: parent
      8 
      9     // Property to control button visibility
     10     property bool showGetStartedButton: false
     11 
     12     Rectangle {
     13         anchors.fill: parent
     14         color: TelegramStyle.backgroundColor
     15 
     16         ColumnLayout {
     17             anchors.centerIn: parent
     18             spacing: TelegramStyle.standardMargin * 3
     19             width: 300
     20 
     21             // Logo
     22             Image {
     23                 Layout.alignment: Qt.AlignHCenter
     24                 Layout.preferredWidth: 200
     25                 Layout.preferredHeight: 200
     26                 sourceSize.width: 200
     27                 sourceSize.height: 200
     28                 source: "qrc:/logo.png"
     29                 fillMode: Image.PreserveAspectFit
     30                 smooth: true
     31             }
     32 
     33             // App name/title
     34             Text {
     35                 Layout.alignment: Qt.AlignHCenter
     36                 text: "Beegram"
     37                 font.pixelSize: 32
     38                 font.bold: true
     39                 color: TelegramStyle.textPrimary
     40             }
     41 
     42             // "Get Started" button - only visible when credentials check fails
     43             Rectangle {
     44                 id: getStartedButton
     45                 Layout.fillWidth: true
     46                 Layout.alignment: Qt.AlignHCenter
     47                 height: 48
     48                 radius: 6
     49                 color: buttonMouseArea.containsMouse || activeFocus ? TelegramStyle.accentColor : TelegramStyle.primaryColor
     50                 border.color: activeFocus ? TelegramStyle.textPrimary : "transparent"
     51                 border.width: activeFocus ? 2 : 0
     52                 visible: root.showGetStartedButton
     53                 activeFocusOnTab: true
     54                 focus: visible
     55 
     56                 Keys.onReturnPressed: navigateToLogin()
     57                 Keys.onSpacePressed: navigateToLogin()
     58 
     59                 function navigateToLogin() {
     60                     if (typeof stackView !== 'undefined' && stackView) {
     61                         stackView.replace("qrc:/qml/views/LoginView.qml")
     62                     }
     63                 }
     64 
     65                 Behavior on color {
     66                     ColorAnimation { duration: 100 }
     67                 }
     68 
     69                 Text {
     70                     anchors.centerIn: parent
     71                     text: "Get Started"
     72                     font.pixelSize: TelegramStyle.fontSizeNormal
     73                     font.bold: true
     74                     color: "white"
     75                 }
     76 
     77                 MouseArea {
     78                     id: buttonMouseArea
     79                     anchors.fill: parent
     80                     hoverEnabled: true
     81                     cursorShape: Qt.PointingHandCursor
     82                     onClicked: getStartedButton.navigateToLogin()
     83                 }
     84             }
     85 
     86             // Loading indicator (shown while checking credentials)
     87             Item {
     88                 Layout.fillWidth: true
     89                 Layout.alignment: Qt.AlignHCenter
     90                 height: 48
     91                 visible: !root.showGetStartedButton
     92 
     93                 // Simple rotating spinner
     94                 Rectangle {
     95                     anchors.centerIn: parent
     96                     width: 32
     97                     height: 32
     98                     color: "transparent"
     99                     border.color: TelegramStyle.primaryColor
    100                     border.width: 3
    101                     radius: 16
    102 
    103                     Rectangle {
    104                         width: 8
    105                         height: 8
    106                         radius: 4
    107                         color: TelegramStyle.primaryColor
    108                         anchors.horizontalCenter: parent.horizontalCenter
    109                         anchors.top: parent.top
    110                         anchors.topMargin: -4
    111                     }
    112 
    113                     RotationAnimation on rotation {
    114                         from: 0
    115                         to: 360
    116                         duration: 1000
    117                         loops: Animation.Infinite
    118                         running: !root.showGetStartedButton
    119                     }
    120                 }
    121             }
    122         }
    123     }
    124 }