Commit ab21a4e5 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(app): try to extract style from component (unstable)

parent 6fceeeb1
...@@ -33,6 +33,7 @@ lupdate_only{ ...@@ -33,6 +33,7 @@ lupdate_only{
ui/components/scrollBar/*.qml \ ui/components/scrollBar/*.qml \
ui/components/select/*.qml \ ui/components/select/*.qml \
ui/components/timeline/*.qml \ ui/components/timeline/*.qml \
ui/style/collapse/*.qml \
ui/views/*.qml \ ui/views/*.qml \
ui/views/mainWindow/*.qml ui/views/mainWindow/*.qml
} }
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
<file>ui/components/form/DarkButton.qml</file> <file>ui/components/form/DarkButton.qml</file>
<file>ui/components/invertedMouseArea/InvertedMouseArea.qml</file> <file>ui/components/invertedMouseArea/InvertedMouseArea.qml</file>
<file>ui/scripts/utils.js</file> <file>ui/scripts/utils.js</file>
<file>ui/style/qmldir</file>
<file>ui/style/collapse/Style.qml</file>
<file>ui/views/newCall.qml</file> <file>ui/views/newCall.qml</file>
<file>ui/views/manageAccounts.qml</file> <file>ui/views/manageAccounts.qml</file>
<file>ui/views/mainWindow/mainWindow.qml</file> <file>ui/views/mainWindow/mainWindow.qml</file>
......
#include <cstdlib> #include <cstdlib>
#include <QQmlFileSelector>
#include <QMenu> #include <QMenu>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include <QQmlContext> #include <QQmlContext>
...@@ -46,9 +47,15 @@ void setTrayIcon (QQmlApplicationEngine &engine) { ...@@ -46,9 +47,15 @@ void setTrayIcon (QQmlApplicationEngine &engine) {
} }
int main (int argc, char *argv[]) { int main (int argc, char *argv[]) {
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
App app(argc, argv); App app(argc, argv);
QQmlApplicationEngine engine(QUrl("qrc:/ui/views/mainWindow/mainWindow.qml")); QQmlApplicationEngine engine;
// Provide `+custom` folders for custom components.
QQmlFileSelector *selector = new QQmlFileSelector(&engine);
selector->setExtraSelectors(QStringList("custom"));
engine.load(QUrl("qrc:/ui/views/mainWindow/mainWindow.qml"));
if (engine.rootObjects().isEmpty()) if (engine.rootObjects().isEmpty())
return EXIT_FAILURE; return EXIT_FAILURE;
......
...@@ -3,6 +3,8 @@ import QtQuick 2.7 ...@@ -3,6 +3,8 @@ import QtQuick 2.7
import 'qrc:/ui/components/form' import 'qrc:/ui/components/form'
import 'qrc:/ui/components/image' import 'qrc:/ui/components/image'
import 'qrc:/ui/style' as Style
// =================================================================== // ===================================================================
Item { Item {
...@@ -18,9 +20,7 @@ Item { ...@@ -18,9 +20,7 @@ Item {
ActionButton { ActionButton {
anchors.centerIn: parent anchors.centerIn: parent
background: Rectangle { background: Style.CollapseStyle.background
color: 'transparent'
}
icon: 'collapse' icon: 'collapse'
iconSize: 32 iconSize: 32
id: button id: button
......
...@@ -17,7 +17,6 @@ Item { ...@@ -17,7 +17,6 @@ Item {
} }
_mouseArea.parent = (function () { _mouseArea.parent = (function () {
// Search root.
var root = item var root = item
while (root.parent != null) { while (root.parent != null) {
......
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