diff --git a/modules/Backlight.qml b/modules/Backlight.qml index 354db87..0238759 100644 --- a/modules/Backlight.qml +++ b/modules/Backlight.qml @@ -174,19 +174,13 @@ M.BarSection { onHoveredChanged: root._panelHovered = hovered } - Rectangle { + M.PopupBackground { x: panelContent.x y: panelContent.y width: panelContent.width height: panelContent.height - color: M.Theme.base01 opacity: panelContent.opacity * Math.max(M.Theme.barOpacity, 0.85) - topLeftRadius: 0 - topRightRadius: 0 - bottomLeftRadius: M.Theme.radius - bottomRightRadius: M.Theme.radius - border.color: root.accentColor - border.width: 1 + accentColor: root.accentColor } Column { diff --git a/modules/Flyout.qml b/modules/Flyout.qml index 58539c0..b2e7e03 100644 --- a/modules/Flyout.qml +++ b/modules/Flyout.qml @@ -83,16 +83,9 @@ PanelWindow { opacity: 0 y: -height - Rectangle { + M.PopupBackground { anchors.fill: parent - color: M.Theme.base01 - opacity: Math.max(M.Theme.barOpacity, 0.85) - topLeftRadius: 0 - topRightRadius: 0 - bottomLeftRadius: M.Theme.radius - bottomRightRadius: M.Theme.radius - border.color: M.FlyoutState.accentColor - border.width: 1 + accentColor: M.FlyoutState.accentColor } Text { diff --git a/modules/Mpris.qml b/modules/Mpris.qml index 0258397..5f2d79c 100644 --- a/modules/Mpris.qml +++ b/modules/Mpris.qml @@ -180,19 +180,13 @@ M.BarSection { onHoveredChanged: root._panelHovered = hovered } - Rectangle { + M.PopupBackground { x: panelContent.x y: panelContent.y width: panelContent.width height: panelContent.height - color: M.Theme.base01 opacity: panelContent.opacity * Math.max(M.Theme.barOpacity, 0.85) - topLeftRadius: 0 - topRightRadius: 0 - bottomLeftRadius: M.Theme.radius - bottomRightRadius: M.Theme.radius - border.color: root.accentColor - border.width: 1 + accentColor: root.accentColor } Column { diff --git a/modules/PopupBackground.qml b/modules/PopupBackground.qml new file mode 100644 index 0000000..b71da4d --- /dev/null +++ b/modules/PopupBackground.qml @@ -0,0 +1,15 @@ +import QtQuick +import "." as M + +Rectangle { + property color accentColor: M.Theme.base05 + + color: M.Theme.base01 + opacity: Math.max(M.Theme.barOpacity, 0.85) + topLeftRadius: 0 + topRightRadius: 0 + bottomLeftRadius: M.Theme.radius + bottomRightRadius: M.Theme.radius + border.color: accentColor + border.width: 1 +} diff --git a/modules/PopupPanel.qml b/modules/PopupPanel.qml index 706d30a..ed8b5e6 100644 --- a/modules/PopupPanel.qml +++ b/modules/PopupPanel.qml @@ -56,16 +56,9 @@ PanelWindow { anchors.fill: parent } - Rectangle { + M.PopupBackground { anchors.fill: parent - color: M.Theme.base01 - opacity: Math.max(M.Theme.barOpacity, 0.85) - topLeftRadius: 0 - topRightRadius: 0 - bottomLeftRadius: M.Theme.radius - bottomRightRadius: M.Theme.radius - border.color: root.accentColor - border.width: 1 + accentColor: root.accentColor } Column { diff --git a/modules/Volume.qml b/modules/Volume.qml index 134a54d..b2d9500 100644 --- a/modules/Volume.qml +++ b/modules/Volume.qml @@ -185,19 +185,13 @@ M.BarSection { // Click inside panel doesn't dismiss } - Rectangle { + M.PopupBackground { x: panelContent.x y: panelContent.y width: panelContent.width height: panelContent.height - color: M.Theme.base01 opacity: panelContent.opacity * Math.max(M.Theme.barOpacity, 0.85) - topLeftRadius: 0 - topRightRadius: 0 - bottomLeftRadius: M.Theme.radius - bottomRightRadius: M.Theme.radius - border.color: root.accentColor - border.width: 1 + accentColor: root.accentColor } Column { diff --git a/modules/qmldir b/modules/qmldir index 848ae10..62b0404 100644 --- a/modules/qmldir +++ b/modules/qmldir @@ -13,6 +13,7 @@ Volume 1.0 Volume.qml Tray 1.0 Tray.qml TrayMenu 1.0 TrayMenu.qml PopupPanel 1.0 PopupPanel.qml +PopupBackground 1.0 PopupBackground.qml PowerMenu 1.0 PowerMenu.qml ScreenCorners 1.0 ScreenCorners.qml ThemedIcon 1.0 ThemedIcon.qml