fix positioning of edit menu, add a button to select
don't show edit menu for passwords
This commit is contained in:
parent
69f9460139
commit
8e0c244482
@ -57,6 +57,15 @@ Item {
|
|||||||
x: parent.margins.left
|
x: parent.margins.left
|
||||||
y: parent.margins.top
|
y: parent.margins.top
|
||||||
property Item checkedButton
|
property Item checkedButton
|
||||||
|
PlasmaComponents.ToolButton {
|
||||||
|
iconSource: "text-field"
|
||||||
|
flat: false
|
||||||
|
visible: input.selectedText == ""
|
||||||
|
onClicked: {
|
||||||
|
selectWord();
|
||||||
|
popupTimer.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
PlasmaComponents.ToolButton {
|
PlasmaComponents.ToolButton {
|
||||||
iconSource: "edit-cut"
|
iconSource: "edit-cut"
|
||||||
flat: false
|
flat: false
|
||||||
@ -77,7 +86,7 @@ Item {
|
|||||||
}
|
}
|
||||||
PlasmaComponents.ToolButton {
|
PlasmaComponents.ToolButton {
|
||||||
iconSource: "edit-paste"
|
iconSource: "edit-paste"
|
||||||
enabled: input.canPaste
|
visible: input.canPaste
|
||||||
flat: false
|
flat: false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
control.paste();
|
control.paste();
|
||||||
@ -127,11 +136,12 @@ Item {
|
|||||||
id: popupTimer
|
id: popupTimer
|
||||||
interval: 1
|
interval: 1
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if ((input.canPaste || selectionStart !== selectionEnd) && control.activeFocus) {
|
if (control.echoMode != TextInput.Password && control.activeFocus) {
|
||||||
var startRect = input.positionToRectangle(input.selectionStart);
|
var startRect = input.positionToRectangle(input.selectionStart);
|
||||||
var endRect = input.positionToRectangle(input.selectionEnd);
|
var endRect = input.positionToRectangle(input.selectionEnd);
|
||||||
|
|
||||||
var pos = getMenuInstance().parent.mapFromItem(input, startRect.x, startRect.y + units.gridUnit);
|
var pos = getMenuInstance().parent.mapFromItem(input, (startRect.x + endRect.x)/2 - getMenuInstance().width/2, endRect.y);
|
||||||
|
pos.y += (pos.y + getMenuInstance().height + units.gridUnit) > getMenuInstance().parent.height ? -units.smallSpacing - getMenuInstance().height : units.gridUnit*2;
|
||||||
|
|
||||||
getMenuInstance().dismiss();
|
getMenuInstance().dismiss();
|
||||||
getMenuInstance().popup(pos);
|
getMenuInstance().popup(pos);
|
||||||
|
@ -39,7 +39,7 @@ QtQuickControlStyle.TextAreaStyle {
|
|||||||
backgroundColor: "transparent"
|
backgroundColor: "transparent"
|
||||||
textColor: control.backgroundVisible ? theme.viewTextColor : PlasmaCore.ColorScope.textColor
|
textColor: control.backgroundVisible ? theme.viewTextColor : PlasmaCore.ColorScope.textColor
|
||||||
selectionColor: control.backgroundVisible ? theme.viewFocusColor : PlasmaCore.ColorScope.highlightColor
|
selectionColor: control.backgroundVisible ? theme.viewFocusColor : PlasmaCore.ColorScope.highlightColor
|
||||||
selectedTextColor: control.backgroundVisible ? theme.viewFocusColor : PlasmaCore.ColorScope.backgroundColor
|
selectedTextColor: control.backgroundVisible ? theme.viewBackgroundColor : PlasmaCore.ColorScope.backgroundColor
|
||||||
|
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user