Skip to content

Commit

Permalink
Merge branch 'master' into topic-update-nosync
Browse files Browse the repository at this point in the history
  • Loading branch information
FeiWang1119 authored Oct 16, 2024
2 parents 6d18650 + 68199d7 commit 880a5ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
21 changes: 10 additions & 11 deletions qt6/src/qml/TextField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,21 @@ T.TextField {
verticalAlignment: TextInput.AlignVCenter
onEffectiveHorizontalAlignmentChanged: placeholder.effectiveHorizontalAlignmentChanged()

Loader {
// use Loader will cause placeholdertext horizontalAlignment not work
// QQuickPlaceholderText will assume it's parent item is QQuickTextInput or QQuickTextInput
// see QQuickPlaceholderText::updateAlignment()
PlaceholderText {
id: placeholder
active: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
x: control.leftPadding
y: control.topPadding
width: control.width - (control.leftPadding + control.rightPadding)
height: control.height - (control.topPadding + control.bottomPadding)
signal effectiveHorizontalAlignmentChanged

sourceComponent: PlaceholderText {
text: control.placeholderText
font: control.font
color: control.placeholderTextColor
verticalAlignment: control.verticalAlignment
renderType: control.renderType
}
text: control.placeholderText
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
font: control.font
color: control.placeholderTextColor
verticalAlignment: control.verticalAlignment
renderType: control.renderType
}

background: EditPanel {
Expand Down
1 change: 1 addition & 0 deletions src/dtkdeclarative_assets.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<file alias="built-in-icons/slider_point_left.dci">icons/bloom/slider_point_left.dci</file>
<file alias="built-in-icons/slider_round_hor.dci">icons/bloom/slider_round_hor.dci</file>
<file alias="built-in-icons/slider_round_ver.dci">icons/bloom/slider_round_ver.dci</file>
<file alias="built-in-icons/switch_button.dci">icons/bloom/switch_button.dci</file>
<file alias="built-in-icons/switch_on.dci">icons/bloom/switch_on.dci</file>
<file alias="built-in-icons/switch_off.dci">icons/bloom/switch_off.dci</file>
<file alias="built-in-icons/slider_point_up.dci">icons/bloom/slider_point_up.dci</file>
Expand Down

0 comments on commit 880a5ff

Please sign in to comment.