From 7919e6d25004819833392abadf7e34f2e83d0990 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Fri, 8 May 2015 16:49:13 +0300 Subject: [PATCH] update DP paint --- sources/.kdev4/sources.kdev4 | 2 +- .../package/contents/config/main.xml | 6 +++ .../package/contents/ui/about.qml | 2 +- .../package/contents/ui/activeapp.qml | 3 +- .../package/contents/ui/advanced.qml | 44 ++++++++++++++++++- .../package/contents/ui/inactiveapp.qml | 2 +- .../package/contents/ui/main.qml | 9 ++-- .../package/contents/ui/widget.qml | 3 +- 8 files changed, 60 insertions(+), 11 deletions(-) diff --git a/sources/.kdev4/sources.kdev4 b/sources/.kdev4/sources.kdev4 index ea73c1d..b97529b 100644 --- a/sources/.kdev4/sources.kdev4 +++ b/sources/.kdev4/sources.kdev4 @@ -8,7 +8,7 @@ ProjectRootRelative=./ [CMake][CMake Build Directory 0] Build Directory Path=file:///home/arcanis/Documents/github/awesome-widgets/build -Build Type=Release +Build Type=Debug CMake Binary=file:///usr/bin/cmake Environment Profile= Extra Arguments= diff --git a/sources/desktop-panel-kf5/package/contents/config/main.xml b/sources/desktop-panel-kf5/package/contents/config/main.xml index 39edfda..b8bd4fe 100644 --- a/sources/desktop-panel-kf5/package/contents/config/main.xml +++ b/sources/desktop-panel-kf5/package/contents/config/main.xml @@ -14,6 +14,12 @@ + + 0 + + + 0 + windows diff --git a/sources/desktop-panel-kf5/package/contents/ui/about.qml b/sources/desktop-panel-kf5/package/contents/ui/about.qml index 746ed6f..52cd032 100644 --- a/sources/desktop-panel-kf5/package/contents/ui/about.qml +++ b/sources/desktop-panel-kf5/package/contents/ui/about.qml @@ -34,7 +34,7 @@ Item { Column { id: pageColumn - width: units.gridUnit * 25 + anchors.fill: parent QtControls.TabView { height: parent.height width: parent.width diff --git a/sources/desktop-panel-kf5/package/contents/ui/activeapp.qml b/sources/desktop-panel-kf5/package/contents/ui/activeapp.qml index 66624b1..55776b6 100644 --- a/sources/desktop-panel-kf5/package/contents/ui/activeapp.qml +++ b/sources/desktop-panel-kf5/package/contents/ui/activeapp.qml @@ -48,8 +48,7 @@ Item { Column { id: pageColumn - width: units.gridUnit * 25 - + anchors.fill: parent Row { height: implicitHeight width: parent.width diff --git a/sources/desktop-panel-kf5/package/contents/ui/advanced.qml b/sources/desktop-panel-kf5/package/contents/ui/advanced.qml index 9cf7605..a8023be 100644 --- a/sources/desktop-panel-kf5/package/contents/ui/advanced.qml +++ b/sources/desktop-panel-kf5/package/contents/ui/advanced.qml @@ -32,6 +32,8 @@ Item { property bool debug: DPAdds.isDebugEnabled() + property alias cfg_height: widgetHeight.value + property alias cfg_width: widgetWidth.value property string cfg_tooltipType: tooltipType.currentText property alias cfg_tooltipWidth: tooltipWidth.value property alias cfg_tooltipColor: tooltipColor.text @@ -42,7 +44,47 @@ Item { Column { id: pageColumn - width: units.gridUnit * 25 + anchors.fill: parent + 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 + } + } + + 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 + } + } + Row { height: implicitHeight width: parent.width diff --git a/sources/desktop-panel-kf5/package/contents/ui/inactiveapp.qml b/sources/desktop-panel-kf5/package/contents/ui/inactiveapp.qml index 8c95377..3086751 100644 --- a/sources/desktop-panel-kf5/package/contents/ui/inactiveapp.qml +++ b/sources/desktop-panel-kf5/package/contents/ui/inactiveapp.qml @@ -48,7 +48,7 @@ Item { Column { id: pageColumn - width: units.gridUnit * 25 + anchors.fill: parent Row { height: implicitHeight width: parent.width diff --git a/sources/desktop-panel-kf5/package/contents/ui/main.qml b/sources/desktop-panel-kf5/package/contents/ui/main.qml index 1b65503..681abe1 100644 --- a/sources/desktop-panel-kf5/package/contents/ui/main.qml +++ b/sources/desktop-panel-kf5/package/contents/ui/main.qml @@ -50,13 +50,14 @@ Item { // ui Grid { + anchors.fill: parent + horizontalItemAlignment: Grid.AlignHCenter + verticalItemAlignment: Grid.AlignVCenter columns: plasmoid.configuration.verticalLayout ? 1 : DPAdds.numberOfDesktops() rows: plasmoid.configuration.verticalLayout ? DPAdds.numberOfDesktops() : 1 Repeater { id: repeater - height: implicitHeight - width: implicitWidth model: DPAdds.numberOfDesktops() Text { id: text @@ -123,8 +124,8 @@ Item { repeater.itemAt(i).font.weight = general.fontWeight[plasmoid.configuration.fontWeight] } repeater.itemAt(i).update() - newHeight += repeater.itemAt(i).contentHeight - newWidth += repeater.itemAt(i).contentWidth + newHeight += plasmoid.configuration.height == 0 ? repeater.itemAt(i).contentHeight : plasmoid.configuration.height / repeater.count + newWidth += plasmoid.configuration.width == 0 ? repeater.itemAt(i).contentWidth : plasmoid.configuration.width / repeater.count } Layout.minimumHeight = newHeight Layout.minimumWidth = newWidth diff --git a/sources/desktop-panel-kf5/package/contents/ui/widget.qml b/sources/desktop-panel-kf5/package/contents/ui/widget.qml index 58f8445..0fbb1aa 100644 --- a/sources/desktop-panel-kf5/package/contents/ui/widget.qml +++ b/sources/desktop-panel-kf5/package/contents/ui/widget.qml @@ -35,7 +35,7 @@ Item { Column { id: pageColumn - width: units.gridUnit * 25 + anchors.fill: parent QtControls.Label { width: parent.width horizontalAlignment: Text.AlignHCenter @@ -220,6 +220,7 @@ Item { QtControls.TextArea { id: textPattern width: parent.width + height: parent.height * 4 / 5 textFormat: TextEdit.PlainText text: plasmoid.configuration.text }