KDeclarative
9 import QtQuick.Dialogs 1.0 as QtDialogs
34 property alias color: colorDialog.color
39 property alias dialogTitle: colorDialog.title
45 property alias currentColor: colorDialog.currentColor
50 property alias showAlphaChannel: colorDialog.showAlphaChannel
57 signal accepted(color color)
59 readonly
property real _buttonMarigns: 4
61 implicitWidth: 40 + _buttonMarigns*2
66 anchors.fill: colorBlock
67 visible: colorDialog.color.a < 1
70 var ctx = getContext(
'2d');
72 ctx.fillStyle =
"white";
73 ctx.fillRect(0,0, ctx.width, ctx.height)
75 ctx.fillStyle =
"black";
77 for (var j=0;j<width;j+=16) {
78 for (var i=0;i<height;i+=16) {
80 ctx.fillRect(j,i,8,8);
81 ctx.fillRect(j+8,i+8,8,8);
91 anchors.centerIn: parent
92 height: parent.height - _buttonMarigns*2
93 width: parent.width - _buttonMarigns*2
96 color: enabled ? colorDialog.color : disabledPalette.button
100 colorGroup: SystemPalette.Disabled
104 QtDialogs.ColorDialog {
106 onAccepted: colorPicker.accepted(color)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by
doxygen 1.8.11 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.