DemoPanel improved layout
This commit is contained in:
parent
05b76b96b3
commit
285321dcb9
1 changed files with 53 additions and 26 deletions
|
|
@ -21,12 +21,10 @@ NPanel {
|
||||||
radius: Style.radiusMedium * scaling
|
radius: Style.radiusMedium * scaling
|
||||||
border.color: Theme.backgroundTertiary
|
border.color: Theme.backgroundTertiary
|
||||||
border.width: Math.max(1, 1.5 * scale)
|
border.width: Math.max(1, 1.5 * scale)
|
||||||
width: 340 * scaling
|
width: 500 * scaling
|
||||||
height: 200
|
height: 300
|
||||||
anchors.top: parent.top
|
anchors.centerIn: parent
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.topMargin: 4 * scaling
|
|
||||||
anchors.rightMargin: 4 * scaling
|
|
||||||
|
|
||||||
// Prevent closing when clicking in the panel bg
|
// Prevent closing when clicking in the panel bg
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
@ -38,34 +36,63 @@ NPanel {
|
||||||
anchors.margins: 16 * scaling
|
anchors.margins: 16 * scaling
|
||||||
spacing: 12 * scaling
|
spacing: 12 * scaling
|
||||||
|
|
||||||
NToggle {
|
|
||||||
label: "Label"
|
// NIconButton
|
||||||
description: "Description"
|
RowLayout {
|
||||||
onToggled: function(value: bool) {
|
spacing: 16 * scaling
|
||||||
console.log("NToggle: " + value)
|
Text {
|
||||||
|
text: "NIconButton"
|
||||||
|
color: Theme.textPrimary
|
||||||
|
}
|
||||||
|
|
||||||
|
NIconButton {
|
||||||
|
id: myIconButton
|
||||||
|
icon: "refresh"
|
||||||
|
onEntered: function() {
|
||||||
|
myTooltip.show();
|
||||||
|
}
|
||||||
|
onExited: function() {
|
||||||
|
myTooltip.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NIconButton {
|
|
||||||
id: myIconButton
|
// NToggle
|
||||||
icon: "refresh"
|
RowLayout {
|
||||||
onEntered: function() {
|
spacing: 16 * scaling
|
||||||
myTooltip.show();
|
uniformCellSizes: true
|
||||||
|
Text {
|
||||||
|
text: "NToggle + NTooltip"
|
||||||
|
color: Theme.textPrimary
|
||||||
}
|
}
|
||||||
onExited: function() {
|
|
||||||
myTooltip.hide();
|
NToggle {
|
||||||
|
label: "Label"
|
||||||
|
description: "Description"
|
||||||
|
onToggled: function(value: bool) {
|
||||||
|
console.log("NToggle: " + value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NTooltip {
|
||||||
|
id: myTooltip
|
||||||
|
target: myIconButton
|
||||||
|
positionAbove: false
|
||||||
|
text: "Hello world"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NTooltip {
|
// NSlider
|
||||||
id: myTooltip
|
RowLayout {
|
||||||
target: myIconButton
|
spacing: 16 * scaling
|
||||||
positionAbove: false
|
Text {
|
||||||
text: "Hello world"
|
text: "NSlider"
|
||||||
}
|
color: Theme.textPrimary
|
||||||
|
}
|
||||||
|
|
||||||
NSlider {}
|
NSlider {}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue