mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-13 22:05:48 +00:00
* more intuitive configuration UI
* add queueLimit runtime configuration
This commit is contained in:
@ -37,19 +37,47 @@ Item {
|
||||
|
||||
property bool debug: dpAdds.isDebugEnabled()
|
||||
|
||||
property alias cfg_background: background.checked
|
||||
property alias cfg_verticalLayout: verticalLayout.checked
|
||||
property alias cfg_height: widgetHeight.value
|
||||
property alias cfg_width: widgetWidth.value
|
||||
property string cfg_mark: mark.currentText
|
||||
property string cfg_tooltipType: tooltipType.currentText
|
||||
property alias cfg_tooltipWidth: tooltipWidth.value
|
||||
property alias cfg_tooltipColor: tooltipColor.text
|
||||
property alias cfg_background: background.checked
|
||||
property alias cfg_verticalLayout: verticalLayout.checked
|
||||
property string cfg_mark: mark.currentText
|
||||
|
||||
|
||||
Column {
|
||||
id: pageColumn
|
||||
anchors.fill: parent
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.heigth
|
||||
width: parent.width * 2 / 5
|
||||
}
|
||||
QtControls.CheckBox {
|
||||
id: background
|
||||
width: parent.width * 3 / 5
|
||||
text: i18n("Enable background")
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.heigth
|
||||
width: parent.width * 2 / 5
|
||||
}
|
||||
QtControls.CheckBox {
|
||||
id: verticalLayout
|
||||
width: parent.width * 3 / 5
|
||||
text: i18n("Vertical layout")
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
@ -90,126 +118,6 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Tooltip type")
|
||||
}
|
||||
QtControls.ComboBox {
|
||||
id: tooltipType
|
||||
width: parent.width * 3 / 5
|
||||
textRole: "label"
|
||||
model: [
|
||||
{
|
||||
'label': i18n("contours"),
|
||||
'name': "contours"
|
||||
},
|
||||
{
|
||||
'label': i18n("windows"),
|
||||
'name': "windows"
|
||||
},
|
||||
{
|
||||
'label': i18n("clean desktop"),
|
||||
'name': "clean"
|
||||
},
|
||||
{
|
||||
'label': i18n("names"),
|
||||
'name': "names"
|
||||
},
|
||||
{
|
||||
'label': i18n("none"),
|
||||
'name': "none"
|
||||
}
|
||||
]
|
||||
onCurrentIndexChanged: cfg_tooltipType = model[currentIndex]["name"]
|
||||
Component.onCompleted: {
|
||||
if (debug) console.debug()
|
||||
for (var i = 0; i < model.length; i++) {
|
||||
if (model[i]["name"] == plasmoid.configuration.tooltipType) {
|
||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
||||
tooltipType.currentIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Tooltip width")
|
||||
}
|
||||
QtControls.SpinBox {
|
||||
id: tooltipWidth
|
||||
width: parent.width * 3 / 5
|
||||
minimumValue: 100
|
||||
maximumValue: 1000
|
||||
stepSize: 50
|
||||
value: plasmoid.configuration.tooltipWidth
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Font color")
|
||||
}
|
||||
QtControls.Button {
|
||||
id: tooltipColor
|
||||
width: parent.width * 3 / 5
|
||||
style: QtStyles.ButtonStyle {
|
||||
background: Rectangle {
|
||||
color: plasmoid.configuration.tooltipColor
|
||||
}
|
||||
}
|
||||
text: plasmoid.configuration.tooltipColor
|
||||
onClicked: colorDialog.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.heigth
|
||||
width: parent.width * 2 / 5
|
||||
}
|
||||
QtControls.CheckBox {
|
||||
id: background
|
||||
width: parent.width * 3 / 5
|
||||
text: i18n("Enable background")
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.heigth
|
||||
width: parent.width * 2 / 5
|
||||
}
|
||||
QtControls.CheckBox {
|
||||
id: verticalLayout
|
||||
width: parent.width * 3 / 5
|
||||
text: i18n("Vertical layout")
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
@ -230,6 +138,107 @@ Item {
|
||||
onCurrentIndexChanged: cfg_mark = currentText
|
||||
}
|
||||
}
|
||||
|
||||
QtControls.GroupBox {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
title: i18n("Tooltip")
|
||||
Column {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Tooltip type")
|
||||
}
|
||||
QtControls.ComboBox {
|
||||
id: tooltipType
|
||||
width: parent.width * 3 / 5
|
||||
textRole: "label"
|
||||
model: [
|
||||
{
|
||||
'label': i18n("contours"),
|
||||
'name': "contours"
|
||||
},
|
||||
{
|
||||
'label': i18n("windows"),
|
||||
'name': "windows"
|
||||
},
|
||||
{
|
||||
'label': i18n("clean desktop"),
|
||||
'name': "clean"
|
||||
},
|
||||
{
|
||||
'label': i18n("names"),
|
||||
'name': "names"
|
||||
},
|
||||
{
|
||||
'label': i18n("none"),
|
||||
'name': "none"
|
||||
}
|
||||
]
|
||||
onCurrentIndexChanged: cfg_tooltipType = model[currentIndex]["name"]
|
||||
Component.onCompleted: {
|
||||
if (debug) console.debug()
|
||||
for (var i = 0; i < model.length; i++) {
|
||||
if (model[i]["name"] == plasmoid.configuration.tooltipType) {
|
||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
||||
tooltipType.currentIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Tooltip width")
|
||||
}
|
||||
QtControls.SpinBox {
|
||||
id: tooltipWidth
|
||||
width: parent.width * 3 / 5
|
||||
minimumValue: 100
|
||||
maximumValue: 1000
|
||||
stepSize: 50
|
||||
value: plasmoid.configuration.tooltipWidth
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: i18n("Font color")
|
||||
}
|
||||
QtControls.Button {
|
||||
id: tooltipColor
|
||||
width: parent.width * 3 / 5
|
||||
style: QtStyles.ButtonStyle {
|
||||
background: Rectangle {
|
||||
color: plasmoid.configuration.tooltipColor
|
||||
}
|
||||
}
|
||||
text: plasmoid.configuration.tooltipColor
|
||||
onClicked: colorDialog.visible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QtDialogs.ColorDialog {
|
||||
|
Reference in New Issue
Block a user