forked from qt-creator/qt-creator
QmlDesigner: Fix the text overlap for TopLevelComboBox
Task-number: QDS-9464 Change-Id: I72e6e855c0b7ebeb6893fe9a4f463b6ef6197248 Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -60,6 +60,7 @@ Item {
|
|||||||
valueRole: root.valueRole
|
valueRole: root.valueRole
|
||||||
implicitWidth: StudioTheme.Values.singleControlColumnWidth
|
implicitWidth: StudioTheme.Values.singleControlColumnWidth
|
||||||
width: implicitWidth
|
width: implicitWidth
|
||||||
|
textElidable: true
|
||||||
|
|
||||||
onFocusChanged: {
|
onFocusChanged: {
|
||||||
if (itemFilterComboBox.focus)
|
if (itemFilterComboBox.focus)
|
||||||
|
@@ -13,6 +13,7 @@ T.ComboBox {
|
|||||||
|
|
||||||
property alias actionIndicator: actionIndicator
|
property alias actionIndicator: actionIndicator
|
||||||
property alias labelColor: comboBoxInput.color
|
property alias labelColor: comboBoxInput.color
|
||||||
|
property alias textElidable: comboBoxInput.elidable
|
||||||
|
|
||||||
// This property is used to indicate the global hover state
|
// This property is used to indicate the global hover state
|
||||||
property bool hover: (comboBoxInput.hover || actionIndicator.hover || popupIndicator.hover)
|
property bool hover: (comboBoxInput.hover || actionIndicator.hover || popupIndicator.hover)
|
||||||
|
@@ -14,6 +14,11 @@ TextInput {
|
|||||||
|
|
||||||
property bool edit: control.activeFocus
|
property bool edit: control.activeFocus
|
||||||
property bool hover: mouseArea.containsMouse && control.enabled
|
property bool hover: mouseArea.containsMouse && control.enabled
|
||||||
|
property bool elidable: false
|
||||||
|
readonly property real textAdvanceWidth: control.elidable
|
||||||
|
? (elidableText.leftPadding
|
||||||
|
+ elidableTextMetrics.advanceWidth)
|
||||||
|
: control.implicitWidth
|
||||||
|
|
||||||
z: 2
|
z: 2
|
||||||
font: control.__parentControl.font
|
font: control.__parentControl.font
|
||||||
@@ -32,7 +37,7 @@ TextInput {
|
|||||||
selectByMouse: false
|
selectByMouse: false
|
||||||
activeFocusOnPress: false
|
activeFocusOnPress: false
|
||||||
clip: true
|
clip: true
|
||||||
echoMode: TextInput.NoEcho
|
echoMode: control.elidable ? TextInput.NoEcho : TextInput.Normal
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: elidableText
|
id: elidableText
|
||||||
@@ -44,9 +49,16 @@ TextInput {
|
|||||||
font: control.font
|
font: control.font
|
||||||
color: control.color
|
color: control.color
|
||||||
text: control.text
|
text: control.text
|
||||||
|
visible: control.elidable
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextMetrics {
|
||||||
|
id: elidableTextMetrics
|
||||||
|
font: elidableText.font
|
||||||
|
text: elidableText.text
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: background
|
id: background
|
||||||
x: control.style.borderWidth
|
x: control.style.borderWidth
|
||||||
|
Reference in New Issue
Block a user