Simplify setting menus

This commit is contained in:
Anton Thomasson 2020-11-23 20:29:59 +01:00
parent f69d67ce6e
commit 77628cf944
5 changed files with 7 additions and 25 deletions

View file

@ -4,7 +4,6 @@ import seaprint.convertchecker 1.0
import "../pages/utils.js" as Utils
Setting {
id: settingEntry
height: button.height + menu.height
property var choices
@ -33,12 +32,11 @@ Setting {
}
else
{
menu.open(settingEntry)
menu.open(this)
}
}
ContextMenu {
id: menu
menu: ContextMenu {
enabled: valid && limited_choices.length <= num_large_choices
Repeater {
model: limited_choices

View file

@ -2,9 +2,6 @@ import QtQuick 2.0
import Sailfish.Silica 1.0
Setting {
id: settingEntry
height: button.height + menu.height
property int low
property int high
@ -14,15 +11,9 @@ Setting {
label: prettyName
value: choice ? choice : default_choice
onClicked: parent.clicked()
Component.onCompleted: {
console.log("button height: " + button.height)
}
}
onClicked: menu.open(settingEntry)
ContextMenu {
id: menu
menu: ContextMenu {
enabled: valid
MenuItem {
Slider

View file

@ -5,8 +5,6 @@ import seaprint.ippmsg 1.0
import "../pages/utils.js" as Utils
Setting {
id: settingEntry
height: button.height + menu.height
property var printer
@ -28,9 +26,7 @@ Setting {
onClicked: parent.clicked()
}
onClicked: menu.open(settingEntry)
ContextMenu {
menu: ContextMenu {
id: menu
enabled: true
MenuItem {

View file

@ -2,8 +2,6 @@ import QtQuick 2.0
import Sailfish.Silica 1.0
Setting {
id: settingEntry
height: button.height + menu.height
property int high
@ -44,10 +42,7 @@ Setting {
onClicked: parent.clicked()
}
onClicked: menu.open(settingEntry)
ContextMenu {
id: menu
menu: ContextMenu {
enabled: valid
MenuItem {

View file

@ -11,7 +11,9 @@ Item {
property var choice
property var default_choice
signal clicked()
onClicked: menu.open(this)
property var menu