basic menu styling
This commit is contained in:
parent
d3d6fe7d57
commit
ac24279799
3 changed files with 51 additions and 0 deletions
12
components/StyledMenu.qml
Normal file
12
components/StyledMenu.qml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Menu {
|
||||
id: root
|
||||
|
||||
palette.window: Theme.palette.base100
|
||||
palette.base: Theme.palette.base100
|
||||
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
}
|
||||
9
components/StyledMenuItem.qml
Normal file
9
components/StyledMenuItem.qml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
MenuItem {
|
||||
palette.text: Theme.palette.basecontent
|
||||
palette.highlight: Theme.palette.primary
|
||||
palette.highlightedText: Theme.palette.primarycontent
|
||||
}
|
||||
|
|
@ -114,6 +114,36 @@ StyledWindow {
|
|||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
StyledText {
|
||||
text: "Menu"
|
||||
font.pixelSize: 18
|
||||
}
|
||||
Button {
|
||||
id: fileButton
|
||||
text: "File"
|
||||
onPressed: menu.visible ? menu.close() : menu.open()
|
||||
|
||||
StyledMenu {
|
||||
id: menu
|
||||
y: fileButton.height
|
||||
|
||||
StyledMenuItem {
|
||||
text: "New..."
|
||||
}
|
||||
StyledMenuItem {
|
||||
text: "Open..."
|
||||
}
|
||||
StyledMenuItem {
|
||||
text: "Save"
|
||||
}
|
||||
StyledMenuItem {
|
||||
text: "Close"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
StyledText {
|
||||
text: "Drawer"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue