Commit de07be82 authored by Noah Davis's avatar Noah Davis 🌵
Browse files

Use Loader's active property instead of making a new property

parent bef0cae3
......@@ -8,11 +8,9 @@ import org.kde.kirigami 2.14 as Kirigami
Loader {
id: root
property real radius: Kirigami.Units.smallRadius
property bool unloaded: !visible
active: visible
anchors.fill: parent
sourceComponent: unloaded ? null : raisedGradientComponent
Component {
id: raisedGradientComponent
sourceComponent: Component {
Rectangle {
id: raisedGradient
anchors.fill: parent
......
......@@ -8,11 +8,9 @@ import org.kde.kirigami 2.14 as Kirigami
Loader {
id: root
property real baseRadius: 0
property bool unloaded: !visible
active: visible
anchors.fill: parent
sourceComponent: unloaded ? null : focusRectComponent
Component {
id: focusRectComponent
sourceComponent: Component {
Rectangle {
anchors {
fill: parent
......
......@@ -8,12 +8,10 @@ import org.kde.kirigami 2.14 as Kirigami
Loader {
id: root
property real radius: Kirigami.Units.smallRadius
property bool unloaded: !visible
sourceComponent: unloaded || Kirigami.Theme.lowPowerHardware ? null : shadowComponent
anchors.fill: parent
z: -1
Component {
id: shadowComponent
active: visible && !Kirigami.Theme.lowPowerHardware
sourceComponent: Component {
Kirigami.ShadowedRectangle {
anchors.fill: parent
radius: root.radius
......
......@@ -8,12 +8,10 @@ import org.kde.kirigami 2.14 as Kirigami
Loader {
id: root
property real radius: Kirigami.Units.smallRadius
property bool unloaded: !visible
sourceComponent: unloaded || Kirigami.Theme.lowPowerHardware ? null : shadowComponent
anchors.fill: parent
z: -1
Component {
id: shadowComponent
active: visible && !Kirigami.Theme.lowPowerHardware
sourceComponent: Component {
Kirigami.ShadowedRectangle {
anchors.fill: parent
radius: root.radius
......
......@@ -8,12 +8,10 @@ import org.kde.kirigami 2.14 as Kirigami
Loader {
id: root
property real radius: Kirigami.Units.smallRadius
property bool unloaded: !visible
sourceComponent: unloaded || Kirigami.Theme.lowPowerHardware ? null : shadowComponent
anchors.fill: parent
z: -1
Component {
id: shadowComponent
active: visible && !Kirigami.Theme.lowPowerHardware
sourceComponent: Component {
Kirigami.ShadowedRectangle {
anchors.fill: parent
radius: root.radius
......
Supports Markdown
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