Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.

Commit 7c24ea3

Browse files
committed
fix(StatusPopupMenu)!: Refactoring, removed custom components relationships
1 parent 21f1c4c commit 7c24ea3

File tree

6 files changed

+186
-174
lines changed

6 files changed

+186
-174
lines changed

sandbox/pages/StatusPopupMenuPage.qml

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ GridLayout {
2222
onClicked: complexMenu.popup()
2323
}
2424

25-
2625
StatusButton {
26+
id: customPopupButton
2727
text: "Menu with custom images and icons"
2828
onClicked: customMenu.popup()
2929
}
@@ -51,7 +51,7 @@ GridLayout {
5151

5252
StatusPopupMenu {
5353
id: complexMenu
54-
subMenuItemIcons: [{ icon: 'info' }]
54+
// subMenuItemIcons: [{ icon: 'info' }]
5555

5656
StatusMenuItem {
5757
text: "One"
@@ -65,13 +65,10 @@ GridLayout {
6565
assetSettings.name: "info"
6666
}
6767

68-
StatusMenuItem {
69-
text: "Three"
68+
StatusPopupMenu {
69+
title: "Two"
7070
assetSettings.name: "info"
71-
}
7271

73-
StatusPopupMenu {
74-
title: "Four"
7572
StatusMenuItem {
7673
text: "One"
7774
assetSettings.name: "info"
@@ -81,21 +78,34 @@ GridLayout {
8178
assetSettings.name: "info"
8279
}
8380
}
81+
82+
StatusMenuItem {
83+
text: "Disabled"
84+
assetSettings.name: "info"
85+
enabled: false
86+
}
87+
88+
StatusMenuItem {
89+
text: "Danger"
90+
type: StatusMenuItem.Type.Danger
91+
}
8492
}
8593

8694
StatusPopupMenu {
8795
id: customMenu
8896

89-
subMenuItemIcons: [
90-
{ icon: "chat" },
91-
{
92-
source: "qrc:/demoapp/data/profile-image-1.jpeg"
93-
},
94-
{
95-
isLetterIdenticon: true,
96-
color: "red"
97-
}
98-
]
97+
// subMenuItemIcons: [
98+
// {
99+
// icon: "chat"
100+
// },
101+
// {
102+
// source: "qrc:/demoapp/data/profile-image-1.jpeg"
103+
// },
104+
// {
105+
// isLetterIdenticon: true,
106+
// color: "red"
107+
// }
108+
// ]
99109

100110
StatusMenuItem {
101111
text: "Anywhere"
@@ -104,14 +114,15 @@ GridLayout {
104114
StatusMenuSeparator {}
105115

106116
StatusPopupMenu {
107-
title: "Chat"
117+
title: "Chat"
118+
assetSettings.name: "chat"
108119

109120
StatusMenuItem {
110121
text: "vitalik.eth"
111122
assetSettings.isImage: true
123+
assetSettings.imgIsIdenticon: true
112124
assetSettings.name: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0Bh
113125
CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
114-
assetSettings.imgIsIdenticon: true
115126
}
116127

117128
StatusMenuItem {
@@ -123,6 +134,8 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
123134

124135
StatusPopupMenu {
125136
title: "Cryptokitties"
137+
assetSettings.isImage: true
138+
assetSettings.name: "qrc:/demoapp/data/profile-image-1.jpeg"
126139

127140
StatusMenuItem {
128141
text: "welcome"
@@ -146,6 +159,8 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
146159

147160
StatusPopupMenu {
148161
title: "Another community"
162+
assetSettings.isLetterIdenticon: true
163+
assetSettings.bgColor: "red"
149164

150165
StatusMenuItem {
151166
text: "welcome"

sandbox/pages/StatusSelectPage.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Column {
4141
model: commmonModel
4242

4343
selectMenu.delegate: StatusMenuItemDelegate {
44-
statusPopupMenu: select
4544
action: StatusMenuItem {
4645
assetSettings.name: "filled-account"
4746
text: name

src/StatusQ/Popups/StatusMenuItem.qml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@ Action {
99
Normal,
1010
Danger
1111
}
12-
icon.color: "transparent"
12+
1313
property int type: StatusMenuItem.Type.Normal
14-
property real iconRotation: 0
14+
1515
property StatusAssetSettings assetSettings: StatusAssetSettings {
16-
width: 16
17-
height: 16
18-
color: "transparent"
16+
width: 18
17+
height: 18
18+
rotation: 0
1919
isLetterIdenticon: false
2020
imgIsIdenticon: false
21+
color: "transparent"
2122
name: statusMenuItem.icon.name
2223
}
2324

2425
property StatusFontSettings fontSettings: StatusFontSettings {}
26+
27+
icon.color: "transparent"
2528
}

0 commit comments

Comments
 (0)