diff --git a/samples/style/RoundNode.qml b/samples/style/RoundNode.qml index 5846325e..3793031e 100644 --- a/samples/style/RoundNode.qml +++ b/samples/style/RoundNode.qml @@ -33,8 +33,9 @@ //----------------------------------------------------------------------------- import QtQuick -import QtQuick.Controls.Material import QtQuick.Layouts +import QtQuick.Controls.Material +import QtQuick.Effects import QuickQanava 2.0 as Qan import "qrc:/QuickQanava" as Qan @@ -51,29 +52,19 @@ Qan.NodeItem { radius: width / 2; border.color: Material.accent; border.width: 2 color: roundNode.style.backColor - } - property color styleBackColor: style.backColor - onStyleBackColorChanged: nodeColor = Qt.rgba( style.backColor.r, style.backColor.g, style.backColor.b, 0.2 ) - property color nodeColor - property color backColor: Material.background - - // FIXME #218 - /* - Qan.LinearGradient { - anchors.fill: parent - z: 2 - source: background - start: Qt.point(0.,0.) - end: Qt.point(background.width, background.height) gradient: Gradient { - id: backGrad GradientStop { position: 0.0; color: roundNode.nodeColor } GradientStop { position: 1.0; - color: Qt.tint( roundNode.nodeColor, roundNode.backColor ) + color: Qt.tint(roundNode.nodeColor, roundNode.backColor) } } - }*/ + } + property color styleBackColor: style.backColor + onStyleBackColorChanged: nodeColor = Qt.rgba( style.backColor.r, style.backColor.g, style.backColor.b, 0.2 ) + property color nodeColor + property color backColor: Material.background + Rectangle { id: border z: 3 @@ -87,14 +78,15 @@ Qan.NodeItem { z: 3 anchors.centerIn: parent } - // FIXME #218 - /* - Qan.Glow { - z: 0 + MultiEffect { source: background - anchors.fill: parent - color: Material.theme === Material.Light ? Qt.lighter( Material.foreground ) : Qt.darker( Material.foreground ) - radius: 12; samples: 15 - spread: 0.25; transparentBorder: true - }*/ -} + anchors.centerIn: parent + width: background.width + (6 * 2) // glowRadius = 6 + height: background.height + (6 * 2) + blurEnabled: true + blurMax: 30 + blur: 1. + colorization: 1.0 + colorizationColor: Qt.rgba(1, 1, 1, 0.3) + } +} // Qan.NodeItem: roundNode diff --git a/src/RectGlowEffect.qml b/src/RectGlowEffect.qml index 57da0f26..32727075 100644 --- a/src/RectGlowEffect.qml +++ b/src/RectGlowEffect.qml @@ -72,7 +72,6 @@ Item { blurEnabled: glowEffect.style !== undefined ? style.effectEnabled : false blurMax: 30 blur: 1. - //blurMultiplier: 0.1 colorization: 1.0 colorizationColor: glowColor @@ -90,7 +89,7 @@ Item { height: border.height - 2 border.width: 1 border.color: Qt.rgba(1, 1, 1, 0.3) - color: 'transparent' + color: Qt.rgba(0, 0, 0, 0) radius: backRadius } } diff --git a/src/RectNodeTemplate.qml b/src/RectNodeTemplate.qml index 7b296510..b5cd6b29 100644 --- a/src/RectNodeTemplate.qml +++ b/src/RectNodeTemplate.qml @@ -54,6 +54,13 @@ Item { if (delegateLoader?.item?.nodeItem) delegateLoader.item.nodeItem = nodeItem } + onWidthChanged: updateDefaultBoundingShape() + onHeightChanged: updateDefaultBoundingShape() + function updateDefaultBoundingShape() { + if (nodeItem) + nodeItem.setDefaultBoundingShape() + } + readonly property real backRadius: nodeItem?.style ? nodeItem.style.backRadius : 4. Loader { id: delegateLoader diff --git a/src/qanBottomResizer.cpp b/src/qanBottomResizer.cpp index e7fb871f..795df907 100644 --- a/src/qanBottomResizer.cpp +++ b/src/qanBottomResizer.cpp @@ -179,7 +179,7 @@ void BottomResizer::hoverLeaveEvent(QHoverEvent *event) } void BottomResizer::mouseMoveEvent(QMouseEvent* event) { - const auto mePos = event->scenePosition(); // FIXME #218 check at high scale... + const auto mePos = event->scenePosition(); if (event->buttons() | Qt::LeftButton && !_dragInitialPos.isNull() && !_targetInitialSize.isEmpty()) { diff --git a/src/qanEdgeItem.cpp b/src/qanEdgeItem.cpp index 33a6d1be..f19434d8 100644 --- a/src/qanEdgeItem.cpp +++ b/src/qanEdgeItem.cpp @@ -202,7 +202,7 @@ void EdgeItem::configureDestinationItem(QQuickItem* item) /* Edge Drawing Management *///------------------------------------------------ void EdgeItem::setHidden(bool hidden) noexcept { - if ( hidden != _hidden ) { + if (hidden != _hidden) { _hidden = hidden; emit hiddenChanged(); } @@ -210,7 +210,7 @@ void EdgeItem::setHidden(bool hidden) noexcept void EdgeItem::setArrowSize( qreal arrowSize ) noexcept { - if ( !qFuzzyCompare(1. + arrowSize, 1. + _arrowSize ) ) { + if (!qFuzzyCompare(1. + arrowSize, 1. + _arrowSize)) { _arrowSize = arrowSize; emit arrowSizeChanged(); updateItem(); @@ -637,8 +637,6 @@ void EdgeItem::generateArrowGeometry(GeometryCache& cache) const noexcept // Update source arrow cache points const auto srcShape = getSrcShape(); switch (srcShape) { - // FIXME AHN - //case qan::EdgeItem::ArrowShape::Undefined: // [[fallthrough]] case qan::EdgeItem::ArrowShape::Arrow: // [[fallthrough]] case qan::EdgeItem::ArrowShape::ArrowOpen: cache.srcA1 = arrowA1; @@ -658,8 +656,6 @@ void EdgeItem::generateArrowGeometry(GeometryCache& cache) const noexcept // Update destination arrow cache points const auto dstShape = getDstShape(); switch (dstShape) { - // FIXME AHN - //case qan::EdgeItem::ArrowShape::Undefined: // [[fallthrough]] case qan::EdgeItem::ArrowShape::Arrow: // [[fallthrough]] case qan::EdgeItem::ArrowShape::ArrowOpen: cache.dstA1 = arrowA1; diff --git a/src/qanNodeItem.h b/src/qanNodeItem.h index f9f5f123..4ecbecbe 100644 --- a/src/qanNodeItem.h +++ b/src/qanNodeItem.h @@ -371,7 +371,7 @@ public slots: void boundingShapeChanged(); //! signal is Emitted when the bounding shape become invalid and should be regenerated from QML. void requestUpdateBoundingShape(); -protected: +public: QPolygonF generateDefaultBoundingShape() const; private: QPolygonF _boundingShape; diff --git a/src/qanStyle.h b/src/qanStyle.h index e7cb5e84..1a566c32 100644 --- a/src/qanStyle.h +++ b/src/qanStyle.h @@ -349,8 +349,6 @@ class EdgeStyle : public qan::Style public: //! End type drawing configuration enum class ArrowShape { - //! Invalid undefined value, usefull for serialization (if Undefined, default to Arrow). - //Undefined = 0, //! Do not draw an end. None = 0, //! End shape is an arrow.