make old contentMaxWidth/height props kinda work

This commit is contained in:
Marco Martin 2014-08-13 19:14:05 +02:00
parent 5961bcaaa7
commit 99cc40053f

View File

@ -53,26 +53,25 @@ QtControls.TextArea {
* interactive. This property is useful for temporarily disabling * interactive. This property is useful for temporarily disabling
* flicking. * flicking.
*/ */
property bool interactive property bool interactive: !selectByMouse
onInteractiveChanged: selectByMouse = !interactive
/** /**
* type:int * type:int
* Maximum width that the text content can have. * Maximum width that the text content can have.
*/ */
property int contentMaxWidth property int contentMaxWidth: contentItem.width
/** /**
* type:int * type:int
* Maximum height that the text content can have. * Maximum height that the text content can have.
*/ */
property int contentMaxHeight property int contentMaxHeight: contentItem.height
// Overriding QtQuick.Item activeFocus property. // Overriding QtQuick.Item activeFocus property.
//property alias activeFocus: textEdit.activeFocus //property alias activeFocus: textEdit.activeFocus
implicitWidth: theme.mSize(theme.defaultFont).width*25 + base.internalPadding*2 implicitWidth: theme.mSize(theme.defaultFont).width*25 + style.textMargin
implicitHeight: theme.mSize(theme.defaultFont).height*8 + base.internalPadding*2 implicitHeight: theme.mSize(theme.defaultFont).height*8 + style.textMargin
opacity: enabled ? 1.0 : 0.5
Label { Label {
anchors.centerIn: parent anchors.centerIn: parent
@ -80,6 +79,7 @@ QtControls.TextArea {
text: textArea.placeholderText text: textArea.placeholderText
visible: textArea.text == "" && !textArea.activeFocus visible: textArea.text == "" && !textArea.activeFocus
color: theme.viewTextColor color: theme.viewTextColor
horizontalAlignment: Text.AlignHCenter
opacity: 0.5 opacity: 0.5
} }