mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-26 21:37:04 +08:00
update
This commit is contained in:
parent
f0227c5686
commit
cbebb51d62
@ -10,6 +10,7 @@ TextArea{
|
|||||||
property color placeholderNormalColor: FluTheme.dark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1)
|
property color placeholderNormalColor: FluTheme.dark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1)
|
||||||
property color placeholderFocusColor: FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
property color placeholderFocusColor: FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||||
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
||||||
|
property bool isCtrlEnterForNewline: false
|
||||||
id:control
|
id:control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
color: {
|
color: {
|
||||||
@ -20,7 +21,7 @@ TextArea{
|
|||||||
}
|
}
|
||||||
font:FluTextStyle.Body
|
font:FluTextStyle.Body
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
padding: 7
|
padding: 8
|
||||||
leftPadding: padding+4
|
leftPadding: padding+4
|
||||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||||
selectedTextColor: color
|
selectedTextColor: color
|
||||||
@ -44,11 +45,19 @@ TextArea{
|
|||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
function handleCommit(event){
|
function handleCommit(event){
|
||||||
|
if(isCtrlEnterForNewline){
|
||||||
if(event.modifiers & Qt.ControlModifier){
|
if(event.modifiers & Qt.ControlModifier){
|
||||||
insert(control.cursorPosition, "\n")
|
insert(control.cursorPosition, "\n")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
control.commit(control.text)
|
control.commit(control.text)
|
||||||
|
}else{
|
||||||
|
if(event.modifiers & Qt.ControlModifier){
|
||||||
|
control.commit(control.text)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
insert(control.cursorPosition, "\n")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
@ -11,6 +11,7 @@ TextArea{
|
|||||||
property color placeholderNormalColor: FluTheme.dark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1)
|
property color placeholderNormalColor: FluTheme.dark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1)
|
||||||
property color placeholderFocusColor: FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
property color placeholderFocusColor: FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||||
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
||||||
|
property bool isCtrlEnterForNewline: false
|
||||||
id:control
|
id:control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
color: {
|
color: {
|
||||||
@ -45,11 +46,19 @@ TextArea{
|
|||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
function handleCommit(event){
|
function handleCommit(event){
|
||||||
|
if(isCtrlEnterForNewline){
|
||||||
if(event.modifiers & Qt.ControlModifier){
|
if(event.modifiers & Qt.ControlModifier){
|
||||||
insert(control.cursorPosition, "\n")
|
insert(control.cursorPosition, "\n")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
control.commit(control.text)
|
control.commit(control.text)
|
||||||
|
}else{
|
||||||
|
if(event.modifiers & Qt.ControlModifier){
|
||||||
|
control.commit(control.text)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
insert(control.cursorPosition, "\n")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
Loading…
Reference in New Issue
Block a user