summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-30 14:24:28 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-30 14:24:28 +0800
commit61bcce08d358c36d6e1cd9d9908229589a0eb374 (patch)
tree3267fb757dcd77bbe8718e0f3cdc31a8d9ea3172
parent2bd8d579e56c1373a4b8851d367ce80669b688a8 (diff)
Simplify & reuse menu item background
-rw-r--r--Header.ui.qml82
1 files changed, 49 insertions, 33 deletions
diff --git a/Header.ui.qml b/Header.ui.qml
index 4cc507d..54eae75 100644
--- a/Header.ui.qml
+++ b/Header.ui.qml
@@ -46,22 +46,23 @@ ToolBar {
}
Component {
- id: image
- Image {
- source: imageSource
- sourceSize {
- width: size
- height: size
+ id: background
+
+ Item {
+ implicitWidth: width
+
+ Rectangle {
+ id: rectangle
+ anchors.fill: parent
+ radius: 5.2
+ color: Eduport.mode
+ ? Eduport.bsDark
+ : Eduport.bsBodyBg
}
- layer {
- enabled: true
- effect: OpacityMask {
- maskSource: Rectangle {
- width: size
- height: size
- radius: size
- }
- }
+
+ DrpShdw.Box {
+ source: rectangle
+ anchors.fill: rectangle
}
}
}
@@ -120,6 +121,35 @@ ToolBar {
width: 1
}
}
+
+ Menu {
+ y: parent.height
+ background: Loader {
+ width: 256
+ sourceComponent: background
+ }
+ }
+ }
+
+ Component {
+ id: image
+ Image {
+ source: imageSource
+ sourceSize {
+ width: size
+ height: size
+ }
+ layer {
+ enabled: true
+ effect: OpacityMask {
+ maskSource: Rectangle {
+ width: size
+ height: size
+ radius: size
+ }
+ }
+ }
+ }
}
ToolButton {
@@ -142,6 +172,10 @@ ToolBar {
y: parent.height
horizontalPadding: 10
verticalPadding: 16
+ background: Loader {
+ width: 260.734
+ sourceComponent: background
+ }
delegate: MenuItem {
id: menuItem
font: Eduport.bsBtnFont
@@ -186,24 +220,6 @@ ToolBar {
radius: 5.2
}
}
- background: Item {
- implicitWidth: 260.734
- implicitHeight: 295.406
-
- Rectangle {
- id: rectangle
- anchors.fill: parent
- radius: 5.2
- color: Eduport.mode
- ? Eduport.bsDark
- : Eduport.bsBodyBg
- }
-
- DrpShdw.Box {
- source: rectangle
- anchors.fill: rectangle
- }
- }
Item {
id: info