Handle mouse area inside OrgText object
This commit is contained in:
parent
9164c1a3c3
commit
697706610e
2 changed files with 8 additions and 8 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
ListItem {
|
||||
Item {
|
||||
id: orgItem
|
||||
|
||||
property bool focused: document.focusedIndex == index
|
||||
|
|
@ -12,7 +12,7 @@ ListItem {
|
|||
leftMargin: Theme.paddingMedium * depth
|
||||
}
|
||||
|
||||
contentHeight: loader.item ? loader.item.height : 0
|
||||
height: loader.item ? loader.item.height : 0
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
|
|
@ -36,11 +36,6 @@ ListItem {
|
|||
document.focusedItem = orgItem
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
loader.item.setCursorPositionAt(mouse.x, mouse.y)
|
||||
document.focusedIndex = index
|
||||
}
|
||||
|
||||
function forceCommit (update) { loader.item.forceCommit(update) }
|
||||
function setCursorPositionAtEnd (fix) { loader.item.setCursorPositionAtEnd(fix) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
Item {
|
||||
MouseArea {
|
||||
id: orgText
|
||||
|
||||
property int contentHeight
|
||||
|
|
@ -19,6 +19,11 @@ Item {
|
|||
visible: editing
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
edit.setCursorPositionAt(mouse.x, mouse.y)
|
||||
document.focusedIndex = index
|
||||
}
|
||||
|
||||
function forceCommit (update) { edit.forceCommit(update) }
|
||||
function setCursorPositionAt (x, y) { edit.setCursorPositionAt(x, y) }
|
||||
function setCursorPositionAtEnd (fix) { edit.setCursorPositionAtEnd(fix) }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue