Commit 1bb57b10 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Use `ShadowedRectangle`

Instead of expensive DropShadow layer.

Differential Revision: https://phabricator.kde.org/D28029
parent 4d5c8a34
......@@ -25,8 +25,7 @@ import QtQuick.Window 2.2
import QtQuick.Templates @QQC2_VERSION@ as T
import QtQuick.Controls @QQC2_VERSION@ as Controls
import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate
import QtGraphicalEffects 1.0
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kirigami 2.12 as Kirigami
import "private" as Private
......@@ -231,25 +230,22 @@ T.ComboBox {
boundsBehavior: Flickable.StopAtBounds
T.ScrollBar.vertical: Controls.ScrollBar { }
}
background: Rectangle {
background: Kirigami.ShadowedRectangle {
anchors {
fill: parent
margins: -1
}
radius: 2
color: Kirigami.Theme.backgroundColor
property color borderColor: Kirigami.Theme.textColor
border.color: Qt.rgba(borderColor.r, borderColor.g, borderColor.b, 0.3)
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
radius: 8
samples: 8
horizontalOffset: 0
verticalOffset: 2
color: Qt.rgba(0, 0, 0, 0.3)
}
border.width: 1
shadow.xOffset: 0
shadow.yOffset: 2
shadow.color: Qt.rgba(0, 0, 0, 0.3)
shadow.size: 8
}
}
}
......@@ -22,10 +22,9 @@
import QtQuick 2.7
import QtQuick.Layouts 1.2
import QtGraphicalEffects 1.0
import QtQuick.Controls @QQC2_VERSION@
import QtQuick.Templates @QQC2_VERSION@ as T
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kirigami 2.12 as Kirigami
T.Menu {
id: control
......@@ -97,21 +96,18 @@ T.Menu {
}
}
background: Rectangle {
background: Kirigami.ShadowedRectangle {
radius: 2
implicitWidth: Kirigami.Units.gridUnit * 8
color: Kirigami.Theme.backgroundColor
property color borderColor: Kirigami.Theme.textColor
border.color: Qt.rgba(borderColor.r, borderColor.g, borderColor.b, 0.3)
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
radius: 8
samples: 8
horizontalOffset: 0
verticalOffset: 2
color: Qt.rgba(0, 0, 0, 0.3)
}
border.width: 1
shadow.xOffset: 0
shadow.yOffset: 2
shadow.color: Qt.rgba(0, 0, 0, 0.3)
shadow.size: 8
}
}
......@@ -21,9 +21,8 @@
import QtQuick 2.6
import QtGraphicalEffects 1.0
import QtQuick.Templates @QQC2_VERSION@ as T
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kirigami 2.12 as Kirigami
T.Popup {
id: control
......@@ -62,20 +61,17 @@ T.Popup {
contentItem: Item { }
background: Rectangle {
background: Kirigami.ShadowedRectangle {
radius: 2
color: Kirigami.Theme.backgroundColor
property color borderColor: Kirigami.Theme.textColor
border.color: Qt.rgba(borderColor.r, borderColor.g, borderColor.b, 0.3)
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
radius: 8
samples: 16
horizontalOffset: 0
verticalOffset: 4
color: Qt.rgba(0, 0, 0, 0.3)
}
border.width: 1
shadow.xOffset: 0
shadow.yOffset: 4
shadow.color: Qt.rgba(0, 0, 0, 0.3)
shadow.size: 8
}
}
......@@ -21,10 +21,9 @@
import QtQuick 2.6
import QtGraphicalEffects 1.0
import QtQuick.Controls @QQC2_VERSION@ as Controls
import QtQuick.Templates @QQC2_VERSION@ as T
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kirigami 2.12 as Kirigami
T.ToolTip {
id: controlRoot
......@@ -60,21 +59,15 @@ T.ToolTip {
color: Kirigami.Theme.textColor
}
background: Rectangle {
background: Kirigami.ShadowedRectangle {
radius: 3
opacity: 0.95
color: Kirigami.Theme.backgroundColor
Kirigami.Theme.colorSet: Kirigami.Theme.Tooltip
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
radius: 4
samples: 8
horizontalOffset: 0
verticalOffset: 2
color: Qt.rgba(0, 0, 0, 0.3)
}
}
shadow.xOffset: 0
shadow.yOffset: 2
shadow.size: 4
shadow.color: Qt.rgba(0, 0, 0, 0.3)
}
}
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