diff --git a/sources/awesome-widget/package/contents/ui/about.qml b/sources/awesome-widget/package/contents/ui/about.qml index 9df5a3d..1a1ce68 100644 --- a/sources/awesome-widget/package/contents/ui/about.qml +++ b/sources/awesome-widget/package/contents/ui/about.qml @@ -16,8 +16,6 @@ ***************************************************************************/ import QtQuick 2.0 -import QtQuick.Controls 1.3 as QtControls -import QtQuick.Layouts 1.0 as QtLayouts import org.kde.plasma.private.awesomewidget 1.0 @@ -34,4 +32,8 @@ Item { AboutTab { textProvider: awActions } + + Component.onCompleted: { + if (debug) console.debug() + } } diff --git a/sources/awesome-widget/package/contents/ui/qmldir b/sources/awesome-widget/package/contents/ui/qmldir index ee187d3..fe42c6d 100644 --- a/sources/awesome-widget/package/contents/ui/qmldir +++ b/sources/awesome-widget/package/contents/ui/qmldir @@ -1,4 +1,4 @@ -singleton general 1.0 general.qml +singleton general 1.0 file:///usr/share/awesomewidgets/qml/general.qml AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml BugReport file:///usr/share/awesomewidgets/qml/BugReport.qml diff --git a/sources/desktop-panel/package/contents/ui/about.qml b/sources/desktop-panel/package/contents/ui/about.qml index 723dea3..874455a 100644 --- a/sources/desktop-panel/package/contents/ui/about.qml +++ b/sources/desktop-panel/package/contents/ui/about.qml @@ -16,113 +16,23 @@ ***************************************************************************/ import QtQuick 2.0 -import QtQuick.Controls 1.3 as QtControls -import QtQuick.Layouts 1.0 as QtLayouts import org.kde.plasma.private.desktoppanel 1.0 Item { id: aboutPage - // backend DPAdds { id: dpAdds } width: childrenRect.width height: childrenRect.height - implicitWidth: pageColumn.implicitWidth - implicitHeight: pageColumn.implicitHeight - property bool debug: dpAdds.isDebugEnabled() - - - Column { - id: pageColumn - anchors.fill: parent - QtControls.TabView { - height: parent.height - width: parent.width - QtControls.Tab { - anchors.margins: 10.0 - title: i18n("About") - - QtLayouts.ColumnLayout { - QtControls.Label { - QtLayouts.Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - text: dpAdds.getAboutText("header") - } - - QtControls.Label { - QtLayouts.Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - text: dpAdds.getAboutText("version") - } - - QtControls.Label { - QtLayouts.Layout.fillWidth: true - horizontalAlignment: Text.AlignJustify - text: dpAdds.getAboutText("description") - } - - QtControls.Label { - QtLayouts.Layout.fillWidth: true - horizontalAlignment: Text.AlignLeft - textFormat: Text.RichText - text: dpAdds.getAboutText("links") - onLinkActivated: Qt.openUrlExternally(link) - } - - QtControls.Label { - QtLayouts.Layout.fillHeight: true - QtLayouts.Layout.fillWidth: true - font.capitalization: Font.SmallCaps - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignBottom - textFormat: Text.RichText - text: dpAdds.getAboutText("copy") - } - } - } - - QtControls.Tab { - anchors.margins: 10.0 - title: i18n("Acknowledgment") - - QtLayouts.ColumnLayout { - QtControls.Label { - QtLayouts.Layout.fillWidth: true - wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignJustify - text: dpAdds.getAboutText("translators") - } - - QtControls.Label { - QtLayouts.Layout.fillWidth: true - wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignJustify - textFormat: Text.RichText - text: dpAdds.getAboutText("3rdparty") - onLinkActivated: Qt.openUrlExternally(link) - } - - QtControls.Label { - QtLayouts.Layout.fillHeight: true - QtLayouts.Layout.fillWidth: true - wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignJustify - verticalAlignment: Text.AlignTop - textFormat: Text.RichText - text: dpAdds.getAboutText("thanks") - onLinkActivated: Qt.openUrlExternally(link) - } - } - } - } + AboutTab { + textProvider: dpAdds } - Component.onCompleted: { if (debug) console.debug() } diff --git a/sources/desktop-panel/package/contents/ui/advanced.qml b/sources/desktop-panel/package/contents/ui/advanced.qml index 256281f..ade2153 100644 --- a/sources/desktop-panel/package/contents/ui/advanced.qml +++ b/sources/desktop-panel/package/contents/ui/advanced.qml @@ -41,213 +41,154 @@ Item { 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 string cfg_mark: mark.value + property string cfg_tooltipType: tooltipType.value property alias cfg_tooltipWidth: tooltipWidth.value - property alias cfg_tooltipColor: tooltipColor.text + property alias cfg_tooltipColor: tooltipColor.value 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") - } + + CheckBoxSelector { + id: background + 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") - } + CheckBoxSelector { + id: verticalLayout + text: i18n("Vertical layout") } - Row { - height: implicitHeight - width: parent.width - QtControls.Label { - height: parent.height - width: parent.width * 2 / 5 - horizontalAlignment: Text.AlignRight - verticalAlignment: Text.AlignVCenter - text: i18n("Widget height, px") - } - QtControls.SpinBox { - id: widgetHeight - width: parent.width * 3 / 5 - minimumValue: 0 - maximumValue: 4096 - stepSize: 50 - value: plasmoid.configuration.height - } + IntegerSelector { + id: widgetHeight + maximumValue: 4096 + minimumValue: 0 + stepSize: 50 + text: i18n("Widget height, px") + value: plasmoid.configuration.height } - Row { - height: implicitHeight - width: parent.width - QtControls.Label { - height: parent.height - width: parent.width * 2 / 5 - horizontalAlignment: Text.AlignRight - verticalAlignment: Text.AlignVCenter - text: i18n("Widget width, px") - } - QtControls.SpinBox { - id: widgetWidth - width: parent.width * 3 / 5 - minimumValue: 0 - maximumValue: 4096 - stepSize: 50 - value: plasmoid.configuration.width - } + IntegerSelector { + id: widgetWidth + maximumValue: 4096 + minimumValue: 0 + stepSize: 50 + text: i18n("Widget width, px") + value: plasmoid.configuration.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("Mark") - } - QtControls.ComboBox { - id: mark - width: parent.width * 3 / 5 - editable: true - model: ["#", "$", "%", "&", "*", "@", "¤", "¶", "·", "º", - plasmoid.configuration.mark] - currentIndex: model.length - 1 - onCurrentIndexChanged: cfg_mark = currentText - } + ComboBoxSelector { + id: mark + editable: true + model: [ + { + 'label': '#', + 'name': '#' + }, + { + 'label': '$', + 'name': '$' + }, + { + 'label': '%', + 'name': '%' + }, + { + 'label': '&', + 'name': '&' + }, + { + 'label': '*', + 'name': '*' + }, + { + 'label': '@', + 'name': '@' + }, + { + 'label': '¤', + 'name': '¤' + }, + { + 'label': '¶', + 'name': '¶' + }, + { + 'label': '·', + 'name': '·' + }, + { + 'label': 'º', + 'name': 'º' + }, + { + 'label': plasmoid.configuration.mark, + 'name': plasmoid.configuration.mark + } + ] + text: i18n("Mark") + currentIndex: model.length - 1 + onValueEdited: cfg_mark = newValue } 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 - } - } + + ComboBoxSelector { + id: tooltipType + 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" } - } + ] + text: i18n("Tooltip type") + value: plasmoid.configuration.tooltipType + onValueEdited: cfg_tooltipType = newValue } - 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 - } + IntegerSelector { + id: tooltipWidth + maximumValue: 1000 + minimumValue: 100 + stepSize: 50 + text: i18n("Tooltip width") + 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 - } + ColorSelector { + id: tooltipColor + text: i18n("Font color") + value: plasmoid.configuration.tooltipColor } } } } - QtDialogs.ColorDialog { - id: colorDialog - title: i18n("Select a color") - color: tooltipColor.text - onAccepted: tooltipColor.text = colorDialog.color - } - Component.onCompleted: { if (debug) console.debug() } diff --git a/sources/desktop-panel/package/contents/ui/general.qml b/sources/desktop-panel/package/contents/ui/general.qml deleted file mode 100644 index 42cd857..0000000 --- a/sources/desktop-panel/package/contents/ui/general.qml +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - * This file is part of awesome-widgets * - * * - * awesome-widgets is free software: you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * awesome-widgets is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * - ***************************************************************************/ - -pragma Singleton -import QtQuick 2.0 - - -QtObject { - property variant fontWeight: { - "light": Font.Light, - "normal": Font.Normal, - "demibold": Font.DemiBold, - "bold": Font.Bold, - "black": Font.Black - } - property variant align: { - "left": Text.AlignLeft, - "center": Text.AlignHCenter, - "right": Text.AlignRight, - "justify": Text.AlignJustify - } - property variant textStyle: { - "normal": Text.Normal, - "outline": Text.Outline, - "raised": Text.Raised, - "sunken": Text.Sunken - } -} diff --git a/sources/desktop-panel/package/contents/ui/qmldir b/sources/desktop-panel/package/contents/ui/qmldir index ee187d3..fe42c6d 100644 --- a/sources/desktop-panel/package/contents/ui/qmldir +++ b/sources/desktop-panel/package/contents/ui/qmldir @@ -1,4 +1,4 @@ -singleton general 1.0 general.qml +singleton general 1.0 file:///usr/share/awesomewidgets/qml/general.qml AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml BugReport file:///usr/share/awesomewidgets/qml/BugReport.qml diff --git a/sources/awesome-widget/package/contents/ui/general.qml b/sources/qml/general.qml similarity index 100% rename from sources/awesome-widget/package/contents/ui/general.qml rename to sources/qml/general.qml diff --git a/sources/qml/qmldir.in b/sources/qml/qmldir.in index cab0867..d038f78 100644 --- a/sources/qml/qmldir.in +++ b/sources/qml/qmldir.in @@ -1,4 +1,4 @@ -singleton general 1.0 general.qml +singleton general 1.0 file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/general.qml AboutTab file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/AboutTab.qml BugReport file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/BugReport.qml