Skip to content
Snippets Groups Projects
Commit 0c982a30 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: I "fixed" the resize behaivour

With this change the leading label will be resized first if the user
increases the size of the property editor.
So if property names are too long (elided), due to translation or
because the pane was generated automatically, the user is able to resize
the label.
parent b1dac076
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,7 @@ QWidget { //This is a special doubleSpinBox that does color coding for states ...@@ -70,7 +70,7 @@ QWidget { //This is a special doubleSpinBox that does color coding for states
id: label; id: label;
font.bold: true; font.bold: true;
alignment: doubleSpinBox.alignRight ? "Qt::AlignRight | Qt::AlignVCenter" : "Qt::AlignLeft | Qt::AlignVCenter"; alignment: doubleSpinBox.alignRight ? "Qt::AlignRight | Qt::AlignVCenter" : "Qt::AlignLeft | Qt::AlignVCenter";
fixedWidth: 76 fixedWidth: frame.labelWidth
visible: doubleSpinBox.text != ""; visible: doubleSpinBox.text != "";
toolTip: text toolTip: text
} }
......
...@@ -4,5 +4,5 @@ import Bauhaus 1.0 ...@@ -4,5 +4,5 @@ import Bauhaus 1.0
QLabel { QLabel {
id: label id: label
alignment: "Qt::AlignRight | Qt::AlignVCenter" alignment: "Qt::AlignRight | Qt::AlignVCenter"
fixedWidth: 76 fixedWidth: frame.labelWidth
} }
...@@ -5,6 +5,21 @@ WidgetFrame { ...@@ -5,6 +5,21 @@ WidgetFrame {
id: propertyFrame; id: propertyFrame;
minimumWidth: 300; minimumWidth: 300;
property int frameWidth: width
property int labelWidth: 76
onFrameWidthChanged: {
if (frameWidth > 300) {
var moreSpace = (frameWidth - 300) / 3;
var newFixedWidth = 76 + moreSpace;
if (newFixedWidth > 200)
newFixedWidth = 200;
labelWidth = newFixedWidth;
} else {
labelWidth = 76;
}
}
objectName: "propertyEditorFrame" objectName: "propertyEditorFrame"
styleSheetFile: "propertyEditor.css"; styleSheetFile: "propertyEditor.css";
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment