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

This commit is contained in:
Ronan Abhamon 2016-09-23 14:55:16 +02:00
parent 6fceeeb12e
commit ab21a4e5d9
5 changed files with 14 additions and 5 deletions

View file

@ -33,6 +33,7 @@ lupdate_only{
ui/components/scrollBar/*.qml \
ui/components/select/*.qml \
ui/components/timeline/*.qml \
ui/style/collapse/*.qml \
ui/views/*.qml \
ui/views/mainWindow/*.qml
}

View file

@ -33,6 +33,8 @@
<file>ui/components/form/DarkButton.qml</file>
<file>ui/components/invertedMouseArea/InvertedMouseArea.qml</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/manageAccounts.qml</file>
<file>ui/views/mainWindow/mainWindow.qml</file>

View file

@ -1,5 +1,6 @@
#include <cstdlib>
#include <QQmlFileSelector>
#include <QMenu>
#include <QQmlApplicationEngine>
#include <QQmlContext>
@ -46,9 +47,15 @@ void setTrayIcon (QQmlApplicationEngine &engine) {
}
int main (int argc, char *argv[]) {
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
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())
return EXIT_FAILURE;

View file

@ -3,6 +3,8 @@ import QtQuick 2.7
import 'qrc:/ui/components/form'
import 'qrc:/ui/components/image'
import 'qrc:/ui/style' as Style
// ===================================================================
Item {
@ -18,9 +20,7 @@ Item {
ActionButton {
anchors.centerIn: parent
background: Rectangle {
color: 'transparent'
}
background: Style.CollapseStyle.background
icon: 'collapse'
iconSize: 32
id: button

View file

@ -17,7 +17,6 @@ Item {
}
_mouseArea.parent = (function () {
// Search root.
var root = item
while (root.parent != null) {