Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix the collapsible property layout as well as other small fixes.

Wolthera van Hövell tot Westerflier4edfc2fd0375
diff --git a/plugins/dockers/textproperties/qml/CollapsibleGroupProperty.qml b/plugins/dockers/textproperties/qml/CollapsibleGroupProperty.qml
index 2fdf6696b8..2cfbdc22a8 100644
--- a/plugins/dockers/textproperties/qml/CollapsibleGroupProperty.qml
+++ b/plugins/dockers/textproperties/qml/CollapsibleGroupProperty.qml
@@ -22,6 +22,7 @@ TextPropertyBase {
flow: GridLayout.LeftToRight
columns: 2;
columnSpacing: root.columnSpacing;
+ width: parent.width;
Item {
Layout.preferredHeight: firstColumnWidth;
@@ -41,22 +42,10 @@ TextPropertyBase {
anchors.verticalCenter: parent.verticalCenter;
}
}
-
-
- RowLayout {
+ Item {
id: titleItemContainer;
Layout.fillWidth: true;
- spacing: columnSpacing;
- Label {
- id: propertyTitle;
- text: root.propertyName;
- height: parent.height;
- verticalAlignment: Text.AlignVCenter
- color: sysPalette.text;
- elide: Text.ElideRight;
- Layout.fillWidth: true;
-
- }
+ height: childrenRect.height;
}
}
diff --git a/plugins/dockers/textproperties/qml/FontFamily.qml b/plugins/dockers/textproperties/qml/FontFamily.qml
index 5e73cbcccf..958c12f99e 100644
--- a/plugins/dockers/textproperties/qml/FontFamily.qml
+++ b/plugins/dockers/textproperties/qml/FontFamily.qml
@@ -38,7 +38,19 @@ CollapsibleGroupProperty {
mainWindow.slotUpdateStylesModel();
}
- titleItem: ComboBox {
+ titleItem: RowLayout {
+ width: parent.width;
+ height: childrenRect.height;
+ Label {
+ id: propertyTitle;
+ text: propertyName;
+ verticalAlignment: Text.AlignVCenter
+ color: sysPalette.text;
+ elide: Text.ElideRight;
+ Layout.maximumWidth: contentWidth;
+
+ }
+ ComboBox {
id: mainFamilyCmb;
model: fontFamilyModel;
Layout.fillWidth: true;
@@ -77,7 +89,7 @@ CollapsibleGroupProperty {
x: mainFamilyCmb.width - width;
width: contentWidth;
height: contentHeight;
- padding: 1;
+ padding: 2;
contentItem: FontResourceView {
id: fontResourceView;
@@ -89,6 +101,7 @@ CollapsibleGroupProperty {
}
wheelEnabled: true;
}
+ }
onEnableProperty: properties.fontFamiliesState = KoSvgTextPropertiesModel.PropertySet;
@@ -120,6 +133,13 @@ CollapsibleGroupProperty {
text: modelData;
width: parent.width;
}
+ Label {
+ text: i18n("Family list is empty");
+ wrapMode: Text.WordWrap;
+ anchors.fill: parent;
+ anchors.horizontalCenter: parent.horizontalCenter;
+ visible: parent.count === 0;
+ }
}
}
diff --git a/plugins/dockers/textproperties/qml/FontResourceView.qml b/plugins/dockers/textproperties/qml/FontResourceView.qml
index 5154a4d597..337f9ab242 100644
--- a/plugins/dockers/textproperties/qml/FontResourceView.qml
+++ b/plugins/dockers/textproperties/qml/FontResourceView.qml
@@ -46,6 +46,7 @@ ColumnLayout {
}
}
RowLayout {
+ Layout.preferredHeight: childrenRect.height;
TextField {
id: search;
placeholderText: i18nc("@info:placeholder", "Search...");
diff --git a/plugins/dockers/textproperties/qml/FontStyle.qml b/plugins/dockers/textproperties/qml/FontStyle.qml
index e5fd328c33..52e9d9cc25 100644
--- a/plugins/dockers/textproperties/qml/FontStyle.qml
+++ b/plugins/dockers/textproperties/qml/FontStyle.qml
@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
-import QtQuick 2.0
+import QtQuick 2.15
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
@@ -19,7 +19,7 @@ CollapsibleGroupProperty {
property alias fontWeight: fontWeightSpn.value;
property alias fontWidth: fontStretchSpn.value;
property alias fontSlantSlope: fontSlantSpn.value;
- property int fontSlant: KoSvgTextPropertiesModel.StyleNormal;
+ property int fontSlant: CssFontStyleModel.StyleNormal;
onFontSlantChanged: {
fontSlantCmb.currentIndex = fontSlantCmb.indexOfValue(fontSlant);
@@ -90,11 +90,25 @@ CollapsibleGroupProperty {
properties.fontWeightState = KoSvgTextPropertiesModel.PropertySet;
}
- titleItem: ComboBox {
+
+ titleItem: RowLayout{
+ width: parent.width;
+ height: childrenRect.height;
+ spacing: columnSpacing;
+ Label {
+ id: propertyTitle;
+ text: propertyName;
+ verticalAlignment: Text.AlignVCenter
+ color: sysPalette.text;
+ elide: Text.ElideRight;
+ Layout.maximumWidth: contentWidth;
+ }
+
+ ComboBox {
id: styleCmb;
model: fontStylesModel;
textRole: "display";
- width: parent.width;
+ Layout.fillWidth: true;
onActivated: {
if (!blockSignals) {
// Because each change to propertiesModel causes signals to fire,
@@ -113,7 +127,7 @@ CollapsibleGroupProperty {
properties.axisValues = axesValues;
}
}
- }
+ }}
contentItem: GridLayout {
id: mainLayout;
@@ -275,8 +289,12 @@ CollapsibleGroupProperty {
Layout.preferredHeight: contentHeight;
spacing: parent.columnSpacing;
- function updateAxes() {
-
+ Label {
+ text: i18n("No extra variable axes in this font");
+ wrapMode: Text.WordWrap;
+ anchors.fill: parent;
+ anchors.horizontalCenter: parent.horizontalCenter;
+ visible: parent.count === 0;
}
delegate: RowLayout {
diff --git a/plugins/dockers/textproperties/qml/TextAlign.qml b/plugins/dockers/textproperties/qml/TextAlign.qml
index 204bcf387f..3b4a01d5c8 100644
--- a/plugins/dockers/textproperties/qml/TextAlign.qml
+++ b/plugins/dockers/textproperties/qml/TextAlign.qml
@@ -52,6 +52,19 @@ CollapsibleGroupProperty {
}
}
+ titleItem: RowLayout {
+ width: parent.width;
+ height: childrenRect.height;
+ Label {
+ id: propertyTitle;
+ text: propertyName;
+ verticalAlignment: Text.AlignVCenter
+ color: sysPalette.text;
+ elide: Text.ElideRight;
+ Layout.maximumWidth: contentWidth;
+ }
+ }
+
onEnableProperty: properties.textAnchorState = KoSvgTextPropertiesModel.PropertySet;
contentItem: GridLayout {
diff --git a/plugins/dockers/textproperties/qml/TextIndent.qml b/plugins/dockers/textproperties/qml/TextIndent.qml
index 471b64c5d2..64fdd5286e 100644
--- a/plugins/dockers/textproperties/qml/TextIndent.qml
+++ b/plugins/dockers/textproperties/qml/TextIndent.qml
@@ -59,8 +59,19 @@ CollapsibleGroupProperty {
onEnableProperty: properties.textIndentState = KoSvgTextPropertiesModel.PropertySet;
titleItem: RowLayout {
+ width: parent.width;
+ height: childrenRect.height;
spacing: columnSpacing;
- Layout.fillWidth: true;
+
+ Label {
+ id: propertyTitle;
+ text: propertyName;
+ verticalAlignment: Text.AlignVCenter
+ color: sysPalette.text;
+ elide: Text.ElideRight;
+ Layout.maximumWidth: contentWidth;
+ }
+
DoubleSpinBox {
id: textIndentSpn;
Layout.fillWidth: true;
diff --git a/plugins/dockers/textproperties/qml/TextPropertyBaseList.qml b/plugins/dockers/textproperties/qml/TextPropertyBaseList.qml
index 905b47c5d6..31dc5f02ba 100644
--- a/plugins/dockers/textproperties/qml/TextPropertyBaseList.qml
+++ b/plugins/dockers/textproperties/qml/TextPropertyBaseList.qml
@@ -184,15 +184,17 @@ ColumnLayout {
popup: Popup {
y: addPropertyCmb.height - 1;
width: addPropertyCmb.width;
- height: childrenRect.height;
- padding: 1;
+ height: contentHeight;
+ padding: 2;
contentItem: ColumnLayout {
clip: true;
width: parent.width;
ListView {
+ clip: true;
+ Layout.preferredHeight: contentHeight;
+ Layout.maximumHeight: 300;
Layout.fillWidth: true;
- Layout.fillHeight: true;
model: addPropertyCmb.popup.visible ? addPropertyCmb.delegateModel : null
currentIndex: addPropertyCmb.highlightedIndex;