summaryrefslogtreecommitdiff
path: root/src/widgets/TextField.qml
blob: 83ea724d805ffd5e8cf6ca74dff3cc491acbf33d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import QtQuick 1.0
import "custom" as Components
import "plugin"

Components.TextField {
    id:textfield
    minimumWidth:200
    desktopBehavior:true
    placeholderText:""
    topMargin:2
    bottomMargin:2
    leftMargin:6
    rightMargin:6
    width:200
    height: editItem.sizeFromContents(100, 20).height
    clip:false

    QStyleItem {
        id:editItem
        elementType:"edit"
        sunken:true
        focus:textfield.activeFocus
        hover:containsMouse
    }

    background: QStyleBackground {
        anchors.fill:parent
        style: QStyleItem{
            elementType:"edit"
            sunken:true
            focus:textfield.activeFocus
        }
    }

    Item{
        id:focusFrame
        anchors.fill: textfield
        parent:textfield
        visible:framestyle.styleHint("focuswidget")
        QStyleBackground{
            anchors.margins: -2
            anchors.rightMargin:-4
            anchors.bottomMargin:-4
            anchors.fill: parent
            visible:textfield.activeFocus
            style: QStyleItem {
                id:framestyle
                elementType:"focusframe"
            }
        }
    }
}