From d300e9c92af20bf94f3f112fad571daeef41ca694f4d3dd2537347ed11e1c109 Mon Sep 17 00:00:00 2001 From: linuxero Date: Thu, 13 Mar 2025 15:04:53 +0100 Subject: [PATCH] TeroStyle - Theme initial try --- Gui/LoginScreen.qml | 2 +- Gui/PrinterDialog.qml | 1 + Gui/PyqcrmConf.qml | 1 + TeroStyle/Button.qml | 37 +++++++++++++++++++++++++++++++++++++ TeroStyle/TeroStyle.qml | 15 +++++++++++++++ TeroStyle/qmldir | 3 +++ main.py | 3 ++- qml.qrc | 4 ++++ 8 files changed, 64 insertions(+), 2 deletions(-) create mode 100755 TeroStyle/Button.qml create mode 100644 TeroStyle/TeroStyle.qml create mode 100755 TeroStyle/qmldir diff --git a/Gui/LoginScreen.qml b/Gui/LoginScreen.qml index 7fbe4d6..273a78f 100644 --- a/Gui/LoginScreen.qml +++ b/Gui/LoginScreen.qml @@ -3,7 +3,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Dialogs import QtQuick.Layouts - +import "qrc:/TeroStyle" Item { diff --git a/Gui/PrinterDialog.qml b/Gui/PrinterDialog.qml index f7a4388..442c78b 100644 --- a/Gui/PrinterDialog.qml +++ b/Gui/PrinterDialog.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts +import "qrc:/TeroStyle" Window { diff --git a/Gui/PyqcrmConf.qml b/Gui/PyqcrmConf.qml index 7706ef5..e95c337 100644 --- a/Gui/PyqcrmConf.qml +++ b/Gui/PyqcrmConf.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts +//import "qrc:/TeroStyle" Item { diff --git a/TeroStyle/Button.qml b/TeroStyle/Button.qml new file mode 100755 index 0000000..18bbeaf --- /dev/null +++ b/TeroStyle/Button.qml @@ -0,0 +1,37 @@ +import QtQuick +import QtQuick.Templates as T +T.Button +{ + id: tsBut + property int tsWidth: tsButtonText.width + 10 + property int tsHeight: tsButtonText.height + 8 + + height: tsHeight + width: tsWidth + + background: Rectangle + { + id: tsButton + anchors.fill: parent + radius: 50 + color: "red" + + MouseArea + { + id: mouseArea + anchors.fill: parent + onClicked: tsBut.clicked() + } + + Text + { + id: tsButtonText + anchors.centerIn: parent + color: "indigo" + //font.pixelSize: 13 + font: tsBut.font + text: tsBut.text + } + } +} + diff --git a/TeroStyle/TeroStyle.qml b/TeroStyle/TeroStyle.qml new file mode 100644 index 0000000..7f5965a --- /dev/null +++ b/TeroStyle/TeroStyle.qml @@ -0,0 +1,15 @@ +import QtQuick +import QtQuick.Controls + +Item +{ + id: teroStyle + anchors.fill: parent + + + Rectangle + { + anchors.fill: parent + color: "dodgerblue" + } +} diff --git a/TeroStyle/qmldir b/TeroStyle/qmldir new file mode 100755 index 0000000..a41971c --- /dev/null +++ b/TeroStyle/qmldir @@ -0,0 +1,3 @@ +module TeroStyle +TeroStyle 1.0 TeroStyle.qml +Button 1.0 Button.qml diff --git a/main.py b/main.py index a522bd0..e95c0cb 100644 --- a/main.py +++ b/main.py @@ -100,7 +100,8 @@ if __name__ == "__main__": pyq_server = QLocalServer() pyq_server.listen("PYQCRM_INSTANCE") - engine.addImportPath("qrc:/"); + engine.addImportPath("qrc:/") + engine.addImportPath("qrc:/Style") # qml_file = Path(__file__).resolve().parent / "Gui/main.qml" diff --git a/qml.qrc b/qml.qrc index 83f2403..0dcc64e 100644 --- a/qml.qrc +++ b/qml.qrc @@ -49,5 +49,9 @@ Gui/UtilityDialogs.qml Gui/OffersTable.qml Gui/OfferTable.qml + TeroStyle/Button.qml + TeroStyle/qmldir + TeroStyle/TeroStyle.qml +