Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/color/contents/ui/config.qml
Show All 13 Lines | |||||
14 | * | 14 | * | ||
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.0 | 20 | import QtQuick 2.0 | ||
21 | import QtQuick.Controls 1.0 as QtControls | 21 | import QtQuick.Controls 1.0 as QtControls | ||
22 | import QtQuick.Dialogs 1.1 as QtDialogs | 22 | import org.kde.kquickcontrols 2.0 as KQuickControls | ||
23 | //We need units from it | 23 | //We need units from it | ||
24 | import org.kde.plasma.core 2.0 as Plasmacore | 24 | import org.kde.plasma.core 2.0 as Plasmacore | ||
25 | 25 | | |||
26 | Column { | 26 | Column { | ||
27 | id: root | 27 | id: root | ||
28 | property alias cfg_Color: colorDialog.color | 28 | property alias cfg_Color: colorButton.color | ||
29 | | ||||
30 | QtDialogs.ColorDialog { | | |||
31 | id: colorDialog | | |||
32 | modality: Qt.WindowModal | | |||
33 | showAlphaChannel: false | | |||
34 | title: i18nd("plasma_wallpaper_org.kde.color", "Select Background Color") | | |||
35 | } | | |||
36 | 29 | | |||
37 | Row { | 30 | Row { | ||
38 | spacing: units.largeSpacing / 2 | 31 | spacing: units.largeSpacing / 2 | ||
39 | 32 | | |||
40 | QtControls.Label { | 33 | QtControls.Label { | ||
41 | width: formAlignment - units.largeSpacing | 34 | width: formAlignment - units.largeSpacing | ||
42 | anchors.verticalCenter: colorButton.verticalCenter | | |||
43 | horizontalAlignment: Text.AlignRight | 35 | horizontalAlignment: Text.AlignRight | ||
44 | text: i18nd("plasma_wallpaper_org.kde.color", "Color:") | 36 | text: i18nd("plasma_wallpaper_org.kde.color", "Color:") | ||
45 | } | 37 | } | ||
46 | QtControls.Button { | 38 | KQuickControls.ColorButton { | ||
47 | id: colorButton | 39 | id: colorButton | ||
48 | width: units.gridUnit * 3 | 40 | dialogTitle: i18nd("plasma_wallpaper_org.kde.color", "Select Background Color") | ||
49 | onClicked: colorDialog.open() | | |||
50 | | ||||
51 | Rectangle { | | |||
52 | id: colorRect | | |||
53 | anchors.centerIn: parent | | |||
54 | width: parent.width - 2 * units.smallSpacing | | |||
55 | height: theme.mSize(theme.defaultFont).height | | |||
56 | color: colorDialog.color | | |||
57 | } | | |||
58 | } | 41 | } | ||
59 | } | 42 | } | ||
60 | } | 43 | } |