status-desktop/ui/StatusQ/sandbox/pages/StatusMenuPage.qml

223 lines
5.5 KiB
QML
Raw Normal View History

import QtQuick 2.14
import QtQuick.Layouts 1.14
import QtQuick.Controls 2.13
2022-12-01 16:58:37 +00:00
import Qt.labs.qmlmodels 1.0
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
2022-12-01 16:58:37 +00:00
import "../demoapp/data" 1.0
GridLayout {
columns: 1
columnSpacing: 5
rowSpacing: 5
StatusButton {
text: "Simple"
onClicked: simpleMenu.popup()
}
StatusButton {
text: "Complex"
onClicked: complexMenu.popup()
}
StatusButton {
2022-12-01 16:58:37 +00:00
id: customPopupButton
text: "Menu with custom images and icons"
onClicked: customMenu.popup()
}
StatusButton {
text: "Menu with custom font settings"
onClicked: differentFontMenu.popup()
}
2022-12-01 16:58:37 +00:00
StatusButton {
text: "StatusSearchLocationMenu"
onClicked: searchPopupMenu.popup()
StatusSearchLocationMenu {
id: searchPopupMenu
locationModel: Models.optionsModel
}
}
StatusButton {
text: "Status with success actions"
onClicked: successActionsMenu.popup()
}
2022-12-01 16:58:37 +00:00
StatusMenu {
id: simpleMenu
2022-12-01 16:58:37 +00:00
StatusAction {
text: "One"
}
2022-12-01 16:58:37 +00:00
StatusAction {
text: "Two"
}
2022-12-01 16:58:37 +00:00
StatusAction {
text: "Three"
}
}
2022-12-01 16:58:37 +00:00
StatusMenu {
id: complexMenu
2022-12-01 16:58:37 +00:00
hideDisabledItems: false
2022-12-01 16:58:37 +00:00
StatusAction {
text: "One"
assetSettings.name: "info"
}
StatusMenuSeparator {}
2022-12-01 16:58:37 +00:00
StatusAction {
text: "Two"
assetSettings.name: "info"
}
2022-12-01 16:58:37 +00:00
StatusMenu {
title: "Two"
assetSettings.name: "info"
2022-12-01 16:58:37 +00:00
StatusAction {
text: "One"
assetSettings.name: "info"
}
2022-12-01 16:58:37 +00:00
StatusAction {
text: "Three"
assetSettings.name: "info"
}
}
2022-12-01 16:58:37 +00:00
StatusAction {
text: "Disabled"
assetSettings.name: "info"
enabled: false
}
StatusAction {
text: "Danger"
type: StatusAction.Type.Danger
}
}
2022-12-01 16:58:37 +00:00
StatusMenu {
id: customMenu
2022-12-01 16:58:37 +00:00
StatusAction {
text: "Anywhere"
}
StatusMenuSeparator {}
2022-12-01 16:58:37 +00:00
StatusMenu {
title: "Chat"
assetSettings.name: "chat"
2022-12-01 16:58:37 +00:00
StatusAction {
text: "vitalik.eth"
assetSettings.isImage: true
2022-12-01 16:58:37 +00:00
assetSettings.imgIsIdenticon: true
assetSettings.name: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0Bh
CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
}
2022-12-01 16:58:37 +00:00
StatusAction {
text: "Pascal"
assetSettings.isImage: true
assetSettings.name: "qrc:/demoapp/data/profile-image-1.jpeg"
2022-12-01 16:58:37 +00:00
ringSettings.ringSpecModel:
ListModel {
ListElement { colorId: 13; segmentLength: 5 }
ListElement { colorId: 31; segmentLength: 5 }
ListElement { colorId: 10; segmentLength: 1 }
ListElement { colorId: 2; segmentLength: 5 }
ListElement { colorId: 26; segmentLength: 2 }
ListElement { colorId: 19; segmentLength: 4 }
ListElement { colorId: 28; segmentLength: 3 }
}
ringSettings.distinctiveColors: Theme.palette.identiconRingColors
}
}
2022-12-01 16:58:37 +00:00
StatusMenu {
title: "Cryptokitties"
2022-12-01 16:58:37 +00:00
assetSettings.isImage: true
assetSettings.name: "qrc:/demoapp/data/profile-image-1.jpeg"
2022-12-01 16:58:37 +00:00
StatusAction {
text: "welcome"
assetSettings.name: "channel"
assetSettings.color: Theme.palette.directColor1
}
2022-12-01 16:58:37 +00:00
StatusAction {
text: "support"
assetSettings.name: "channel"
assetSettings.color: Theme.palette.directColor1
}
StatusMenuHeadline { text: "Public" }
2022-12-01 16:58:37 +00:00
StatusAction {
text: "news"
assetSettings.name: "channel"
assetSettings.color: Theme.palette.directColor1
}
}
2022-12-01 16:58:37 +00:00
StatusMenu {
title: "Another community"
2022-12-01 16:58:37 +00:00
assetSettings.isLetterIdenticon: true
assetSettings.color: "red"
2022-12-01 16:58:37 +00:00
StatusAction {
text: "welcome"
assetSettings.isLetterIdenticon: true
2022-12-01 16:58:37 +00:00
assetSettings.color: "blue"
}
}
}
2022-12-01 16:58:37 +00:00
StatusMenu {
id: differentFontMenu
2022-12-01 16:58:37 +00:00
StatusAction {
text: "Bold"
fontSettings.bold: true
}
2022-12-01 16:58:37 +00:00
StatusAction {
text: "Italic"
fontSettings.italic: true
}
2022-12-01 16:58:37 +00:00
StatusAction {
text: "16px"
fontSettings.pixelSize: 16
}
}
StatusMenu {
id: successActionsMenu
StatusSuccessAction {
text: "Action"
successText: "Success!"
icon.name: "copy"
}
StatusSuccessAction {
text: "Dismiss Action"
successText: "Dismiss success!"
icon.name: "destroy"
autoDismissMenu: true
}
}
}