[TextFieldStyle] Fix textField is not defined error

Summary:
The reference textField is undefined in this context
It works if the style happens to be used from PlasmaComponents
Use control instead to access the TextField.

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: ltoscano, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D5297
This commit is contained in:
David Edmundson 2017-04-25 15:10:24 +01:00 committed by David Edmundson
parent 29f1ee3858
commit 884f89b9b0

View File

@ -73,7 +73,7 @@ QtQuickControlStyle.TextFieldStyle {
//TODO: if QtControls gets a component for this, use it instead of this hardcoded heuristic //TODO: if QtControls gets a component for this, use it instead of this hardcoded heuristic
root.padding.right = Qt.binding(function() { root.padding.right = Qt.binding(function() {
var actionIconSize = Math.max(textField.height * 0.8, units.iconSizes.small); var actionIconSize = Math.max(control.height * 0.8, units.iconSizes.small);
//actionCount is an int of the number of items //actionCount is an int of the number of items
var actionCount = (control.hasOwnProperty("clearButtonShown") && control.clearButtonShown) + var actionCount = (control.hasOwnProperty("clearButtonShown") && control.clearButtonShown) +
(control.hasOwnProperty("__effectiveRevealPasswordButtonShown") && control.__effectiveRevealPasswordButtonShown); (control.hasOwnProperty("__effectiveRevealPasswordButtonShown") && control.__effectiveRevealPasswordButtonShown);