mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 08:05:29 +08:00
update
This commit is contained in:
22
src/controls/FluMultiLineTextBox.qml
Normal file
22
src/controls/FluMultiLineTextBox.qml
Normal file
@ -0,0 +1,22 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import FluentUI 1.0
|
||||
|
||||
TextArea{
|
||||
id:input
|
||||
width: 300
|
||||
color: FluApp.isDark ? "#FFFFFF" : "#1A1A1A"
|
||||
wrapMode: Text.WrapAnywhere
|
||||
selectByMouse: true
|
||||
selectionColor: {
|
||||
if(FluApp.isDark){
|
||||
return Qt.rgba(76/255,160/255,224/255,1)
|
||||
}else{
|
||||
return Qt.rgba(0/255,102/255,180/255,1)
|
||||
}
|
||||
}
|
||||
background: FluTextBoxBackground{
|
||||
inputItem: input
|
||||
}
|
||||
|
||||
}
|
@ -16,7 +16,6 @@ Item{
|
||||
height: root.height
|
||||
visible: false
|
||||
color:root.color
|
||||
|
||||
}
|
||||
|
||||
Canvas {
|
||||
|
@ -1,6 +1,22 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
TextField{
|
||||
id:input
|
||||
width: 300
|
||||
color: FluApp.isDark ? "#FFFFFF" : "#1A1A1A"
|
||||
selectionColor: {
|
||||
if(FluApp.isDark){
|
||||
return Qt.rgba(76/255,160/255,224/255,1)
|
||||
}else{
|
||||
return Qt.rgba(0/255,102/255,180/255,1)
|
||||
}
|
||||
}
|
||||
selectByMouse: true
|
||||
background: FluTextBoxBackground{
|
||||
inputItem: input
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
43
src/controls/FluTextBoxBackground.qml
Normal file
43
src/controls/FluTextBoxBackground.qml
Normal file
@ -0,0 +1,43 @@
|
||||
import QtQuick 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
|
||||
Rectangle{
|
||||
id:content
|
||||
|
||||
property Item inputItem
|
||||
|
||||
radius: 4
|
||||
layer.enabled: true
|
||||
color: {
|
||||
if(input.hovered){
|
||||
return FluApp.isDark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
||||
}
|
||||
return FluApp.isDark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(1,1,1,1)
|
||||
}
|
||||
layer.effect:OpacityMask {
|
||||
maskSource: Rectangle {
|
||||
width: content.width
|
||||
height: content.height
|
||||
radius: 4
|
||||
}
|
||||
}
|
||||
border.width: 1
|
||||
border.color: FluApp.isDark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(238/255,238/255,238/255,1)
|
||||
Rectangle{
|
||||
width: parent.width
|
||||
height: input.focus ? 3 : 1
|
||||
anchors.bottom: parent.bottom
|
||||
color: {
|
||||
if(FluApp.isDark){
|
||||
input.focus ? Qt.rgba(76/255,160/255,224/255,1) : Qt.rgba(166/255,166/255,166/255,1)
|
||||
}else{
|
||||
return input.focus ? Qt.rgba(0/255,102/255,180/255,1) : Qt.rgba(183/255,183/255,183/255,1)
|
||||
}
|
||||
}
|
||||
Behavior on height{
|
||||
NumberAnimation{
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user