This commit is contained in:
zhuzichu
2024-01-29 16:36:30 +08:00
parent 5056dc57cf
commit 1b0bd0e750
18 changed files with 74 additions and 26 deletions

View File

@ -131,12 +131,12 @@ void FluentUI::registerTypes(const char *uri){
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTreeView.qml"),uri,major,minor,"FluTreeView");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluWindow.qml"),uri,major,minor,"FluWindow");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRangeSlider.qml"),uri,major,minor,"FluRangeSlider");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluStaggeredView.qml"),uri,major,minor,"FluStaggeredView");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluStaggeredLayout.qml"),uri,major,minor,"FluStaggeredLayout");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluProgressButton.qml"),uri,major,minor,"FluProgressButton");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLoadingButton.qml"),uri,major,minor,"FluLoadingButton");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluClip.qml"),uri,major,minor,"FluClip");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLoader.qml"),uri,major,minor,"FluLoader");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluShortcutPicker.qml"),uri,major,minor,"FluShortcutPicker");
qmlRegisterUncreatableMetaObject(Fluent_Awesome::staticMetaObject, uri,major,minor,"FluentIcons", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluThemeType::staticMetaObject, uri,major,minor,"FluThemeType", "Access to enums & flags only");

View File

@ -64,7 +64,15 @@ TextArea{
anchors.fill: parent
cursorShape: Qt.IBeamCursor
acceptedButtons: Qt.RightButton
onClicked: control.echoMode !== TextInput.Password && menu.popup()
onClicked: {
if(control.echoMode === TextInput.Password){
return
}
if(control.readOnly && control.text === ""){
return
}
menu.popup()
}
}
FluTextBoxMenu{
id:menu

View File

@ -62,7 +62,15 @@ TextField{
anchors.fill: parent
cursorShape: Qt.IBeamCursor
acceptedButtons: Qt.RightButton
onClicked: control.echoMode !== TextInput.Password && menu.popup()
onClicked: {
if(control.echoMode === TextInput.Password){
return
}
if(control.readOnly && control.text === ""){
return
}
menu.popup()
}
}
RowLayout{
height: parent.height

View File

@ -69,7 +69,7 @@
<file>FluentUI/Controls/FluShadow.qml</file>
<file>FluentUI/Controls/FluSlider.qml</file>
<file>FluentUI/Controls/FluSpinBox.qml</file>
<file>FluentUI/Controls/FluStaggeredView.qml</file>
<file>FluentUI/Controls/FluStaggeredLayout.qml</file>
<file>FluentUI/Controls/FluStatusView.qml</file>
<file>FluentUI/Controls/FluTableView.qml</file>
<file>FluentUI/Controls/FluTabView.qml</file>

View File

@ -65,7 +65,15 @@ TextArea{
anchors.fill: parent
cursorShape: Qt.IBeamCursor
acceptedButtons: Qt.RightButton
onClicked: control.echoMode !== TextInput.Password && menu.popup()
onClicked: {
if(control.echoMode === TextInput.Password){
return
}
if(control.readOnly && control.text === ""){
return
}
menu.popup()
}
}
FluTextBoxMenu{
id:menu

View File

@ -63,7 +63,15 @@ TextField{
anchors.fill: parent
cursorShape: Qt.IBeamCursor
acceptedButtons: Qt.RightButton
onClicked: control.echoMode !== TextInput.Password && menu.popup()
onClicked: {
if(control.echoMode === TextInput.Password){
return
}
if(control.readOnly && control.text === ""){
return
}
menu.popup()
}
}
RowLayout{
height: parent.height