diff --git a/ViewSolutions/src/ViewSolutionsModule/ActivityProcessor.qml b/ViewSolutions/src/ViewSolutionsModule/ActivityProcessor.qml index 27823bb..00364c7 100644 --- a/ViewSolutions/src/ViewSolutionsModule/ActivityProcessor.qml +++ b/ViewSolutions/src/ViewSolutionsModule/ActivityProcessor.qml @@ -9,13 +9,14 @@ import QtQuick import QtQuick.Controls -Pane { +Page { id: root // use Comonent delegates only property alias initialItem: stackView.initialItem property alias currentItem: stackView.currentItem - property alias titlesAligh: headerView.titlesAligh + property int titlesAligh: Text.AlignLeft + property alias depth: stackView.depth property bool cache: true property bool enableHeader: true @@ -25,124 +26,118 @@ Pane { background: Item{} - contentItem: Page { - id: contentPage - - padding: 0 - background: Item{} - - header: ActivityProcessorHeader { - id: headerView - visible: root.enableHeader - title: { - if (root.enableHeader && stackView.currentItem && stackView.currentItem.title) { - return stackView.currentItem.title - } - - return "" - } - - backButton: root.enableHeader && stackView.depth > 1 && (stackView.currentItem && stackView.currentItem.buttonBack) - - closeButton: root.enableHeader && (stackView.currentItem && stackView.currentItem.closeButton) - titlesAligh: Text.AlignLeft - onBackClicked: { - root.popItem() + header: ActivityProcessorHeader { + id: headerView + visible: root.enableHeader + title: { + if (root.enableHeader && stackView.currentItem && stackView.currentItem.title) { + return stackView.currentItem.title } + return "" } - contentItem: StackView { - id: stackView + backButton: root.enableHeader && stackView.depth > 1 && (stackView.currentItem && stackView.currentItem.buttonBack) - Connections { - target: (stackView.currentItem && stackView.currentItem.finish)? stackView.currentItem : null + closeButton: root.enableHeader && (stackView.currentItem && stackView.currentItem.closeButton) + titlesAligh: root.titlesAligh + onBackClicked: { + root.popItem() + } - function onFinish() { - root.popItem() + } + + contentItem: StackView { + id: stackView + + Connections { + target: (stackView.currentItem && stackView.currentItem.finish)? stackView.currentItem : null + + function onFinish() { + root.popItem() + } + } + + padding: 0 + + implicitWidth: (stackView.currentItem)? stackView.currentItem.implicitWidth: 0 + implicitHeight: (stackView.currentItem)? stackView.currentItem.implicitHeight: 0 + + property int durationAnimation: 400 + popEnter: Transition { + ParallelAnimation { + NumberAnimation { + properties: "opacity" + from: 0 + to: 1 + duration: stackView.durationAnimation + } + NumberAnimation { + properties: "x" + from: (stackView.mirrored ? -1 : 1) * -stackView.width + to: 0 + duration: stackView.durationAnimation + easing.type: Easing.OutCubic } } + } - padding: 0 - - implicitWidth: (stackView.currentItem)? stackView.currentItem.implicitWidth: 0 - implicitHeight: (stackView.currentItem)? stackView.currentItem.implicitHeight: 0 - - property int durationAnimation: 400 - popEnter: Transition { - ParallelAnimation { - NumberAnimation { - properties: "opacity" - from: 0 - to: 1 - duration: stackView.durationAnimation - } - NumberAnimation { - properties: "x" - from: (stackView.mirrored ? -1 : 1) * -stackView.width - to: 0 - duration: stackView.durationAnimation - easing.type: Easing.OutCubic - } + popExit: Transition { + ParallelAnimation { + NumberAnimation { + properties: "opacity" + from: 1 + to: 0 + duration: stackView.durationAnimation / 2 + } + NumberAnimation { + properties: "x" + from: 0 + to: (stackView.mirrored ? -1 : 1) * stackView.width + duration: stackView.durationAnimation + easing.type: Easing.OutCubic } } + } - popExit: Transition { - ParallelAnimation { - NumberAnimation { - properties: "opacity" - from: 1 - to: 0 - duration: stackView.durationAnimation / 2 - } - NumberAnimation { - properties: "x" - from: 0 - to: (stackView.mirrored ? -1 : 1) * stackView.width - duration: stackView.durationAnimation - easing.type: Easing.OutCubic - } + pushEnter: Transition { + ParallelAnimation { + NumberAnimation { + properties: "opacity" + from: 0 + to: 1 + duration: stackView.durationAnimation + } + NumberAnimation { + properties: "x" + from: (stackView.mirrored ? -1 : 1) * stackView.width + to: 0 + duration: stackView.durationAnimation + easing.type: Easing.OutCubic } } + } - pushEnter: Transition { - ParallelAnimation { - NumberAnimation { - properties: "opacity" - from: 0 - to: 1 - duration: stackView.durationAnimation - } - NumberAnimation { - properties: "x" - from: (stackView.mirrored ? -1 : 1) * stackView.width - to: 0 - duration: stackView.durationAnimation - easing.type: Easing.OutCubic - } + pushExit: Transition { + ParallelAnimation { + NumberAnimation { + properties: "opacity" + from: 1 + to: 0 + duration: stackView.durationAnimation / 2 } - } - - pushExit: Transition { - ParallelAnimation { - NumberAnimation { - properties: "opacity" - from: 1 - to: 0 - duration: stackView.durationAnimation / 2 - } - NumberAnimation { - properties: "x" - from: 0 - to: (stackView.mirrored ? -1 : 1) * -stackView.width - duration: stackView.durationAnimation - easing.type: Easing.OutCubic - } + NumberAnimation { + properties: "x" + from: 0 + to: (stackView.mirrored ? -1 : 1) * -stackView.width + duration: stackView.durationAnimation + easing.type: Easing.OutCubic } } } } + // create new activity from component with model activityModel, after drop this activity will be called callback function // Note The callback function works only with ActivityPage childs. function newActivityFromComponent(component, activityModel, callback) { diff --git a/ViewSolutions/src/iguitokensmodel.cpp b/ViewSolutions/src/iguitokensmodel.cpp index a8697fb..2f8cbd6 100644 --- a/ViewSolutions/src/iguitokensmodel.cpp +++ b/ViewSolutions/src/iguitokensmodel.cpp @@ -15,7 +15,11 @@ QString iGUITokensModel::modelId() const { return "GUITokens"; } -QColor &iGUITokensModel::addTransporent(QColor &input, float alpha) const { +QColor iGUITokensModel::addTransporent(QColor input, float alpha) const { + return addTransporentImpl(input, alpha); +} + +QColor &iGUITokensModel::addTransporentImpl(QColor &input, float alpha) const { input.setAlphaF(alpha); return input; } diff --git a/ViewSolutions/src/iguitokensmodel.h b/ViewSolutions/src/iguitokensmodel.h index d417362..98f67e5 100644 --- a/ViewSolutions/src/iguitokensmodel.h +++ b/ViewSolutions/src/iguitokensmodel.h @@ -34,10 +34,13 @@ class VIEWSOLUTION_EXPORT iGUITokensModel: public QObject, public iModel Q_PROPERTY(QColor color_text_tertiary READ color_text_tertiary CONSTANT FINAL) Q_PROPERTY(QColor color_text_disabled READ color_text_disabled CONSTANT FINAL) + Q_PROPERTY(QColor color_border_primary READ color_border_primary CONSTANT FINAL) Q_PROPERTY(QColor color_border_secondary READ color_border_secondary CONSTANT FINAL) Q_PROPERTY(QColor color_border_disabled READ color_border_disabled CONSTANT FINAL) + Q_PROPERTY(QColor color_devider READ color_devider CONSTANT FINAL) + Q_PROPERTY(QColor color_background READ color_background CONSTANT FINAL) //states_colors_constants: Q_PROPERTY(QColor pressed_focused READ pressed_focused CONSTANT FINAL) @@ -89,6 +92,7 @@ public: virtual QColor color_border_secondary() const = 0; virtual QColor color_border_disabled() const = 0; virtual QColor color_devider() const = 0; + virtual QColor color_background() const = 0; virtual QColor pressed_focused() const = 0; virtual QColor hover() const = 0; @@ -125,6 +129,9 @@ public: public: QString modelId() const; + Q_INVOKABLE QColor addTransporent(QColor input, float alpha) const; + + protected: /** * @brief addTransporent This method add alpha chennel to the color. @@ -132,7 +139,7 @@ protected: * @param alpha alphachennol factor from 0 to 1. * @return color with new alpha chennel. */ - QColor& addTransporent(QColor& input, float alpha) const; + QColor& addTransporentImpl(QColor& input, float alpha) const; }; } #endif // IGUITOKENSMODEL_H