text selectable by mouse

This commit is contained in:
Marco Martin 2011-11-08 20:54:13 +01:00
parent 869afade06
commit b51d5b1cd9
2 changed files with 3 additions and 0 deletions

View File

@ -151,6 +151,7 @@ Item {
font.weight: theme.defaultFont.weight font.weight: theme.defaultFont.weight
font.wordSpacing: theme.defaultFont.wordSpacing font.wordSpacing: theme.defaultFont.wordSpacing
color: theme.viewTextColor color: theme.viewTextColor
selectByMouse: true
onCursorPositionChanged: { onCursorPositionChanged: {
if (cursorRectangle.x < flickArea.contentX) { if (cursorRectangle.x < flickArea.contentX) {

View File

@ -137,10 +137,12 @@ Item {
anchors { anchors {
left: parent.left left: parent.left
right: parent.right right: parent.right
verticalCenter: parent.verticalCenter
// TODO: see what is the correct policy for margins // TODO: see what is the correct policy for margins
leftMargin: 2 * base.margins.left leftMargin: 2 * base.margins.left
rightMargin: 2 * base.margins.right rightMargin: 2 * base.margins.right
} }
selectByMouse: true
y: (height - font.pixelSize) * 0.4 // XXX: verticalCenter anchor is not centering the text y: (height - font.pixelSize) * 0.4 // XXX: verticalCenter anchor is not centering the text
height: Math.min(2 * font.pixelSize, parent.height) height: Math.min(2 * font.pixelSize, parent.height)
color: theme.textColor color: theme.textColor