refactor: extract PopupBackground component for shared panel styling
This commit is contained in:
parent
1dea93e1bd
commit
50af43a76e
7 changed files with 26 additions and 42 deletions
|
|
@ -174,19 +174,13 @@ M.BarSection {
|
||||||
onHoveredChanged: root._panelHovered = hovered
|
onHoveredChanged: root._panelHovered = hovered
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
M.PopupBackground {
|
||||||
x: panelContent.x
|
x: panelContent.x
|
||||||
y: panelContent.y
|
y: panelContent.y
|
||||||
width: panelContent.width
|
width: panelContent.width
|
||||||
height: panelContent.height
|
height: panelContent.height
|
||||||
color: M.Theme.base01
|
|
||||||
opacity: panelContent.opacity * Math.max(M.Theme.barOpacity, 0.85)
|
opacity: panelContent.opacity * Math.max(M.Theme.barOpacity, 0.85)
|
||||||
topLeftRadius: 0
|
accentColor: root.accentColor
|
||||||
topRightRadius: 0
|
|
||||||
bottomLeftRadius: M.Theme.radius
|
|
||||||
bottomRightRadius: M.Theme.radius
|
|
||||||
border.color: root.accentColor
|
|
||||||
border.width: 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
|
|
||||||
|
|
@ -83,16 +83,9 @@ PanelWindow {
|
||||||
opacity: 0
|
opacity: 0
|
||||||
y: -height
|
y: -height
|
||||||
|
|
||||||
Rectangle {
|
M.PopupBackground {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: M.Theme.base01
|
accentColor: M.FlyoutState.accentColor
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
|
|
||||||
|
|
@ -180,19 +180,13 @@ M.BarSection {
|
||||||
onHoveredChanged: root._panelHovered = hovered
|
onHoveredChanged: root._panelHovered = hovered
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
M.PopupBackground {
|
||||||
x: panelContent.x
|
x: panelContent.x
|
||||||
y: panelContent.y
|
y: panelContent.y
|
||||||
width: panelContent.width
|
width: panelContent.width
|
||||||
height: panelContent.height
|
height: panelContent.height
|
||||||
color: M.Theme.base01
|
|
||||||
opacity: panelContent.opacity * Math.max(M.Theme.barOpacity, 0.85)
|
opacity: panelContent.opacity * Math.max(M.Theme.barOpacity, 0.85)
|
||||||
topLeftRadius: 0
|
accentColor: root.accentColor
|
||||||
topRightRadius: 0
|
|
||||||
bottomLeftRadius: M.Theme.radius
|
|
||||||
bottomRightRadius: M.Theme.radius
|
|
||||||
border.color: root.accentColor
|
|
||||||
border.width: 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
|
|
||||||
15
modules/PopupBackground.qml
Normal file
15
modules/PopupBackground.qml
Normal file
|
|
@ -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
|
||||||
|
}
|
||||||
|
|
@ -56,16 +56,9 @@ PanelWindow {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
M.PopupBackground {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: M.Theme.base01
|
accentColor: root.accentColor
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
|
|
||||||
|
|
@ -185,19 +185,13 @@ M.BarSection {
|
||||||
// Click inside panel doesn't dismiss
|
// Click inside panel doesn't dismiss
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
M.PopupBackground {
|
||||||
x: panelContent.x
|
x: panelContent.x
|
||||||
y: panelContent.y
|
y: panelContent.y
|
||||||
width: panelContent.width
|
width: panelContent.width
|
||||||
height: panelContent.height
|
height: panelContent.height
|
||||||
color: M.Theme.base01
|
|
||||||
opacity: panelContent.opacity * Math.max(M.Theme.barOpacity, 0.85)
|
opacity: panelContent.opacity * Math.max(M.Theme.barOpacity, 0.85)
|
||||||
topLeftRadius: 0
|
accentColor: root.accentColor
|
||||||
topRightRadius: 0
|
|
||||||
bottomLeftRadius: M.Theme.radius
|
|
||||||
bottomRightRadius: M.Theme.radius
|
|
||||||
border.color: root.accentColor
|
|
||||||
border.width: 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ Volume 1.0 Volume.qml
|
||||||
Tray 1.0 Tray.qml
|
Tray 1.0 Tray.qml
|
||||||
TrayMenu 1.0 TrayMenu.qml
|
TrayMenu 1.0 TrayMenu.qml
|
||||||
PopupPanel 1.0 PopupPanel.qml
|
PopupPanel 1.0 PopupPanel.qml
|
||||||
|
PopupBackground 1.0 PopupBackground.qml
|
||||||
PowerMenu 1.0 PowerMenu.qml
|
PowerMenu 1.0 PowerMenu.qml
|
||||||
ScreenCorners 1.0 ScreenCorners.qml
|
ScreenCorners 1.0 ScreenCorners.qml
|
||||||
ThemedIcon 1.0 ThemedIcon.qml
|
ThemedIcon 1.0 ThemedIcon.qml
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue