Changeset View
Changeset View
Standalone View
Standalone View
src/declarativeimports/plasmastyle/TextFieldStyle.qml
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 46 | background: Item { | |||
---|---|---|---|---|---|
68 | 68 | | |||
69 | Component.onCompleted: { | 69 | Component.onCompleted: { | ||
70 | root.padding.left = base.margins.left | 70 | root.padding.left = base.margins.left | ||
71 | root.padding.top = base.margins.top | 71 | root.padding.top = base.margins.top | ||
72 | root.padding.bottom = base.margins.bottom | 72 | root.padding.bottom = base.margins.bottom | ||
73 | 73 | | |||
74 | //TODO: if QtControls gets a component for this, use it instead of this hardcoded heuristic | 74 | //TODO: if QtControls gets a component for this, use it instead of this hardcoded heuristic | ||
75 | root.padding.right = Qt.binding(function() { | 75 | root.padding.right = Qt.binding(function() { | ||
76 | var actionIconSize = Math.max(textField.height * 0.8, units.iconSizes.small); | 76 | var actionIconSize = Math.max(control.height * 0.8, units.iconSizes.small); | ||
77 | //actionCount is an int of the number of items | 77 | //actionCount is an int of the number of items | ||
78 | var actionCount = (control.hasOwnProperty("clearButtonShown") && control.clearButtonShown) + | 78 | var actionCount = (control.hasOwnProperty("clearButtonShown") && control.clearButtonShown) + | ||
79 | (control.hasOwnProperty("__effectiveRevealPasswordButtonShown") && control.__effectiveRevealPasswordButtonShown); | 79 | (control.hasOwnProperty("__effectiveRevealPasswordButtonShown") && control.__effectiveRevealPasswordButtonShown); | ||
80 | return base.margins.right + (actionIconSize * actionCount) + (actionCount > 0 ? units.smallSpacing : 0); | 80 | return base.margins.right + (actionIconSize * actionCount) + (actionCount > 0 ? units.smallSpacing : 0); | ||
81 | }) | 81 | }) | ||
82 | } | 82 | } | ||
83 | } | 83 | } | ||
84 | 84 | | |||
Show All 14 Lines |