Commit d373f9cd authored by Ronan's avatar Ronan
Browse files

feat(app): use styles modules instead of qrc paths

parent 5f98c29a
......@@ -35,16 +35,16 @@
<file>ui/components/form/DarkButton.qml</file>
<file>ui/components/invertedMouseArea/InvertedMouseArea.qml</file>
<file>ui/scripts/utils.js</file>
<file>ui/style/components/qmldir</file>
<file>ui/style/components/DialogStyle.qml</file>
<file>ui/style/components/ScrollBarStyle.qml</file>
<file>ui/style/components/TimelineStyle.qml</file>
<file>ui/style/components/SearchBoxStyle.qml</file>
<file>ui/style/components/CollapseStyle.qml</file>
<file>ui/style/components/PopupStyle.qml</file>
<file>ui/style/global/qmldir</file>
<file>ui/style/global/Colors.qml</file>
<file>ui/style/global/Constants.qml</file>
<file>ui/style/ComponentsStyle/qmldir</file>
<file>ui/style/ComponentsStyle/DialogStyle.qml</file>
<file>ui/style/ComponentsStyle/ScrollBarStyle.qml</file>
<file>ui/style/ComponentsStyle/TimelineStyle.qml</file>
<file>ui/style/ComponentsStyle/SearchBoxStyle.qml</file>
<file>ui/style/ComponentsStyle/CollapseStyle.qml</file>
<file>ui/style/ComponentsStyle/PopupStyle.qml</file>
<file>ui/style/AppStyle/qmldir</file>
<file>ui/style/AppStyle/Colors.qml</file>
<file>ui/style/AppStyle/Constants.qml</file>
<file>ui/views/newCall.qml</file>
<file>ui/views/manageAccounts.qml</file>
<file>ui/views/mainWindow/mainWindow.qml</file>
......
......@@ -55,6 +55,9 @@ int main (int argc, char *argv[]) {
QQmlFileSelector *selector = new QQmlFileSelector(&engine);
selector->setExtraSelectors(QStringList("custom"));
// Set modules paths.
engine.addImportPath(":/ui/style");
engine.load(QUrl("qrc:/ui/views/mainWindow/mainWindow.qml"));
if (engine.rootObjects().isEmpty())
return EXIT_FAILURE;
......
import QtQuick 2.7
import 'qrc:/ui/components/form'
import ComponentsStyle 1.0
import 'qrc:/ui/style/components'
import 'qrc:/ui/components/form'
// ===================================================================
// A simple component to build collapsed item.
......
import QtQuick 2.7
import 'qrc:/ui/components/form'
import ComponentsStyle 1.0
import 'qrc:/ui/style/components'
import 'qrc:/ui/components/form'
// ===================================================================
// A dialog with OK/Cancel buttons.
......
import QtQuick 2.7
import 'qrc:/ui/style/components'
import ComponentsStyle 1.0
// ===================================================================
// Description content used by dialogs.
......
......@@ -2,7 +2,7 @@ import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
import 'qrc:/ui/style/components'
import ComponentsStyle 1.0
// ===================================================================
// Helper to build quickly dialogs.
......
import QtQuick 2.7
import 'qrc:/ui/style/global'
import AppStyle 1.0
// ===================================================================
// Helper to handle button click outside a component.
......
import QtGraphicalEffects 1.0
import 'qrc:/ui/style/components'
import ComponentsStyle 1.0
// ===================================================================
......
import QtQuick 2.7
import QtQuick.Controls 2.0
import 'qrc:/ui/style/components'
import ComponentsStyle 1.0
// ===================================================================
......
import QtQuick 2.7
import QtQuick.Controls 2.0
import AppStyle 1.0
import ComponentsStyle 1.0
import 'qrc:/ui/components/invertedMouseArea'
import 'qrc:/ui/components/popup'
import 'qrc:/ui/style/components'
import 'qrc:/ui/style/global'
// ===================================================================
Item {
......
import QtQuick 2.7
import QtQuick.Layouts 1.3
import ComponentsStyle 1.0
import 'qrc:/ui/components/contact'
import 'qrc:/ui/components/image'
import 'qrc:/ui/components/view'
import 'qrc:/ui/style/components'
// ===================================================================
ColumnLayout {
......
# See: https://wiki.qt.io/Qml_Styling
module Style
module AppStyle
singleton Colors 1.0 Colors.qml
singleton Constants 1.0 Constants.qml
pragma Singleton
import QtQuick 2.7
import 'qrc:/ui/style/global'
import AppStyle 1.0
QtObject {
property QtObject shadow: QtObject {
......
pragma Singleton
import QtQuick 2.7
import 'qrc:/ui/style/global'
import AppStyle 1.0
QtObject {
property string color: Colors.c
......
pragma Singleton
import QtQuick 2.7
import 'qrc:/ui/style/global'
import AppStyle 1.0
QtObject {
property string shadowColor: Colors.a
......
pragma Singleton
import QtQuick 2.7
import 'qrc:/ui/style/global'
import AppStyle 1.0
QtObject {
property QtObject legend: QtObject {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment