Skip to content

Commit

Permalink
Windows Aero header
Browse files Browse the repository at this point in the history
  • Loading branch information
curoviyxru committed Nov 6, 2023
1 parent 485f7c1 commit e499167
Show file tree
Hide file tree
Showing 14 changed files with 163 additions and 27 deletions.
Binary file modified kutegramquick.ico
Binary file not shown.
12 changes: 9 additions & 3 deletions kutegramquick.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ DEFINES += VERSION=\"\\\"$$VERSION\\\"\"
#DEFINES += COMMIT_SHA=\"\\\"$$COMMIT_SHA\\\"\"

QT += core declarative network xml
greaterThan(QT_MAJOR_VERSION, 4) {
win32:QT += winextras
}

DEFINES += QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_PLUS
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT KG_NO_DEBUG KG_NO_INFO

Expand Down Expand Up @@ -57,21 +61,23 @@ symbian {
INCLUDEPATH += src

SOURCES += \
src/main.cpp \
src/main.cpp \
src/dialogsmodel.cpp \
src/messagesmodel.cpp \
src/avatardownloader.cpp \
src/foldersmodel.cpp \
src/currentuserinfo.cpp \
src/messageutil.cpp
src/messageutil.cpp \
src/platformutils.cpp

HEADERS += \
src/dialogsmodel.h \
src/messagesmodel.h \
src/avatardownloader.h \
src/foldersmodel.h \
src/currentuserinfo.h \
src/messageutil.h
src/messageutil.h \
src/platformutils.h

OTHER_FILES += \
qtc_packaging/debian_harmattan/rules \
Expand Down
Binary file modified kutegramquick_big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions qml/auth/IntroPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ Rectangle {
width: parent.width * 2 / 3
spacing: 5

Image {
Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
width: Math.min(introPageRect.height / 2, parent.width * 2 / 3)
height: width
asynchronous: true
smooth: true
source: "../../kutegramquick_big.png"
color: globalAccent
radius: width / 4

Image {
anchors.fill: parent
asynchronous: true
smooth: true
source: "../../kutegramquick_big.png"
}
}

Text {
Expand Down
32 changes: 22 additions & 10 deletions qml/control/AuthScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,53 +25,62 @@ Rectangle {
name: "INTRO"
PropertyChanges {
target: introPage
x: 0
anchors.leftMargin: 0
opacity: 1
}
PropertyChanges {
target: phonePage
x: width
anchors.leftMargin: width
opacity: 0
}
PropertyChanges {
target: codePage
x: width
anchors.leftMargin: width
opacity: 0
}
},
State {
name: "PHONE"
PropertyChanges {
target: introPage
x: -width
anchors.leftMargin: -width
opacity: 0
}
PropertyChanges {
target: phonePage
x: 0
anchors.leftMargin: 0
opacity: 1
}
PropertyChanges {
target: codePage
x: width
anchors.leftMargin: width
opacity: 0
}
},
State {
name: "CODE"
PropertyChanges {
target: introPage
x: -width
anchors.leftMargin: -width
opacity: 0
}
PropertyChanges {
target: phonePage
x: -width
anchors.leftMargin: -width
opacity: 0
}
PropertyChanges {
target: codePage
x: 0
anchors.leftMargin: 0
opacity: 1
}
}
]

transitions: [
Transition {
NumberAnimation {
properties: "x"
properties: "anchors.leftMargin,opacity"
easing.type: Easing.InOutQuad
duration: 200
}
Expand All @@ -80,18 +89,21 @@ Rectangle {

IntroPage {
id: introPage
anchors.left: parent.left
width: parent.width
height: parent.height
}

PhonePage {
id: phonePage
anchors.left: parent.left
width: parent.width
height: parent.height
}

CodePage {
id: codePage
anchors.left: parent.left
width: parent.width
height: parent.height
}
Expand Down
30 changes: 25 additions & 5 deletions qml/control/MainScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "../message"
import "../control"
import "../auth"

Rectangle {
Item {
id: mainScreen
state: "MENU"

Expand All @@ -13,22 +13,22 @@ Rectangle {
name: "MENU"
PropertyChanges {
target: messagePage
x: mainScreen.width
anchors.leftMargin: mainScreen.width
}
},
State {
name: "CHAT"
PropertyChanges {
target: messagePage
x: mainScreen.width < 600 * kgScaling ? 0 : dialogPage.width
anchors.leftMargin: mainScreen.width < 600 * kgScaling ? 0 : dialogPage.width
}
}
]

transitions: [
Transition {
NumberAnimation {
properties: "x"
properties: "anchors.leftMargin"
easing.type: Easing.InOutQuad
duration: 200
}
Expand All @@ -40,28 +40,48 @@ Rectangle {
messagePage.globalState = "NO_SELECT";
}

Rectangle {
color: "white"
anchors.top: topBar.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
}

DialogPage {
id: dialogPage
anchors.top: topBar.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width < 600 * kgScaling ? parent.width : 300 * kgScaling
}

MessageIntroPage {
id: messageIntroPage
anchors.top: topBar.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.leftMargin: dialogPage.width
width: messagePage.width
x: dialogPage.width
}

MessagePage {
id: messagePage
anchors.top: topBar.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width < 600 * kgScaling ? parent.width : parent.width - 300 * kgScaling
}

Rectangle {
id: sidePanelSeparator
anchors.top: topBar.bottom
anchors.bottom: parent.bottom
anchors.left: messageIntroPage.left
width: 1 * kgScaling
color: "#EEEEEE"
}

TopBar {
id: topBar
anchors.top: parent.top
Expand Down
7 changes: 6 additions & 1 deletion qml/control/TopBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ Rectangle {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
color: globalAccent
color: platformUtils.windowsIsCompositionEnabled() ? "transparent" : globalAccent
state: currentState == "CHAT" ? "BACK" : currentState

Component.onCompleted: {
platformUtils.windowsExtendFrameIntoClientArea(0, height, 0, 0);
}

Rectangle {
height: 1 * kgScaling
anchors.left: parent.left
Expand Down Expand Up @@ -58,6 +62,7 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.bottomMargin: 1 * kgScaling
height: 2 * kgScaling
color: "#FFFFFF"
}
Expand Down
2 changes: 1 addition & 1 deletion qml/dialog/DialogItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Item {
}

Rectangle {
height: 1
height: 1 * kgScaling
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
Expand Down
1 change: 1 addition & 0 deletions qml/dialog/DialogPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Rectangle {
id: folderSlide
focus: true
anchors.fill: parent
clip: true

model: foldersModel
cacheBuffer: width * 5
Expand Down
14 changes: 11 additions & 3 deletions qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import "control"
import "auth"
import Kutegram 1.0

Rectangle {
Item {
//TODO: remove dynamically unused pages / components from memory
//TODO: keypad navigation
id: root

width: 320
height: 240

property color globalAccent: "#54759E"
property color globalAccent: platformUtils.isWindows() ? platformUtils.windowsRealColorizationColor() : "#54759E"

state: "AUTH"

Expand All @@ -25,6 +25,10 @@ Rectangle {
anchors.leftMargin: root.width
opacity: 0
}
PropertyChanges {
target: authScreen
anchors.leftMargin: 0
}
},
State {
name: "MAIN"
Expand All @@ -33,13 +37,17 @@ Rectangle {
anchors.leftMargin: 0
opacity: 1
}
PropertyChanges {
target: authScreen
anchors.leftMargin: -root.width
}
}
]

transitions: [
Transition {
NumberAnimation {
properties: "opacity,anchors.leftMargin"
properties: "anchors.leftMargin,opacity"
easing.type: Easing.InOutQuad
duration: 200
}
Expand Down
1 change: 1 addition & 0 deletions qml/message/MessagePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: messageEdit.top
clip: true

boundsBehavior: Flickable.StopAtBounds

Expand Down
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "avatardownloader.h"
#include "foldersmodel.h"
#include "currentuserinfo.h"
#include "platformutils.h"

#if QT_VERSION >= 0x040702
#include <QNetworkConfigurationManager>
Expand Down Expand Up @@ -69,14 +70,19 @@ int main(int argc, char *argv[])
qmlRegisterType<AvatarDownloader>("Kutegram", 1, 0, "AvatarDownloader");
qmlRegisterType<FoldersModel>("Kutegram", 1, 0, "FoldersModel");
qmlRegisterType<CurrentUserInfo>("Kutegram", 1, 0, "CurrentUserInfo");
qmlRegisterUncreatableType<PlatformUtils>("Kutegram", 1, 0, "PlatformUtils", "PlatformUtils is uncreatable. Use platformUtils root property.");

//TODO show status pane without button group on Symbian
QmlApplicationViewer viewer;
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer.rootContext()->setContextProperty("kutegramVersion", QApplication::applicationVersion());
viewer.rootContext()->setContextProperty("kutegramPlatform", systemName());
viewer.rootContext()->setContextProperty("platformUtils", new PlatformUtils(&viewer));
viewer.rootContext()->setContextProperty("kgScaling", ((float) fontMetrics.height()) / 13.0f);
viewer.setMainQmlFile(QLatin1String("qrc:///qml/main.qml"));
viewer.setAttribute(Qt::WA_TranslucentBackground, true);
viewer.setAttribute(Qt::WA_NoSystemBackground, false);
viewer.setStyleSheet("background: transparent");
viewer.setWindowTitle("Kutegram");
viewer.showExpanded();

Expand Down
Loading

0 comments on commit e499167

Please sign in to comment.