Warning, /graphics/krita/libs/libqml/qml/panels/toolconfigpages/fill.qml is written in an unsupported language. File is not indexed.

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2012 Dan Leinir Turthra Jensen <admin@leinir.dk>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.3
0008 import org.krita.sketch 1.0
0009 import org.krita.sketch.components 1.0
0010 
0011 Column {
0012     id: base
0013     property bool fullView: true;
0014     height: childrenRect.height;
0015     spacing: Constants.DefaultMargin;
0016 
0017     Label {
0018         id: compositeModeListLabel
0019         visible: fullView;
0020         text: "Blending mode:"
0021         font: Settings.theme.font("panelSection");
0022     }
0023     ExpandingListView {
0024         id: compositeModeList
0025         visible: fullView;
0026         expandedHeight: Constants.GridHeight * 6;
0027         width: parent.width;
0028 
0029         property bool firstSet: false;
0030         onCurrentIndexChanged: {
0031             if (firstSet) { model.activateItem(currentIndex); }
0032             else { firstSet = true; }
0033         }
0034         model: compositeOpModel;
0035     }
0036 
0037     RangeInput {
0038         id: opacityInput;
0039         width: parent.width;
0040         placeholder: "Opacity";
0041         min: 0; max: 1; decimals: 2;
0042         value: compositeOpModel.opacity;
0043         onValueChanged: compositeOpModel.changePaintopValue("opacity", value);
0044         enabled: compositeOpModel.opacityEnabled;
0045     }
0046 
0047     RangeInput {
0048         id: thresholdInput;
0049         width: parent.width;
0050         placeholder: "Threshold";
0051         min: 0; max: 255; decimals: 0;
0052         value: 255;
0053         onValueChanged: if (toolManager.currentTool) toolManager.currentTool.slotSetThreshold(value);
0054     }
0055 
0056     CheckBox {
0057         id: fillSelectionCheck;
0058         visible: fullView;
0059         width: parent.width;
0060         text: "Fill Selection";
0061         checked: false;
0062         onCheckedChanged: if (toolManager.currentTool) toolManager.currentTool.slotSetFillSelection(checked);
0063     }
0064 
0065     CheckBox {
0066         id: limitToLayerCheck;
0067         visible: fullView;
0068         width: parent.width;
0069         text: "Limit to Layer";
0070         checked: false;
0071         onCheckedChanged: if (toolManager.currentTool) toolManager.currentTool.slotSetSampleMerged(checked);
0072     }
0073 
0074     Component.onCompleted: compositeModeList.currentIndex = compositeOpModel.indexOf(compositeOpModel.currentCompositeOpID);
0075     Connections {
0076         target: compositeOpModel;
0077         onOpacityChanged: opacityInput.value = compositeOpModel.opacity;
0078         onCurrentCompositeOpIDChanged: {
0079             var newIndex = compositeOpModel.indexOf(compositeOpModel.currentCompositeOpID);
0080             if (compositeModeList.currentIndex !== newIndex) {
0081                 compositeModeList.currentIndex = newIndex;
0082             }
0083         }
0084     }
0085 }