~zsombi/ubuntu-ui-toolkit/50-custom-delegates

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/TextCursor.qml

prereq sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    Connections {
65
65
        target: inputHandler
66
66
        onPressAndHold: openPopover()
 
67
        onTextModified: typing = true
 
68
        onTap: typing = false
67
69
    }
68
70
 
69
71
    function openPopover() {
85
87
                                    "target": handler.main
86
88
                                })
87
89
            }
 
90
            contextMenuVisible = true;
 
91
            popup.onVisibleChanged.connect(contextMenuHidden.bind(undefined, popup));
88
92
            // do not grab focus!
89
93
            popup.__foreground.activeFocusOnPress = false;
90
94
        }
124
128
        when: caret
125
129
        property: "visible"
126
130
        value: QuickUtils.touchScreenAvailable
 
131
         && (contextMenuVisible || !typing)
 
132
    }
 
133
    property bool typing: false
 
134
    property bool contextMenuVisible: false
 
135
    function contextMenuHidden(p) {
 
136
        contextMenuVisible = false
127
137
    }
128
138
    onXChanged: if (draggedItem.state === "") draggedItem.moveToCaret()
129
139
    onYChanged: if (draggedItem.state === "") draggedItem.moveToCaret()