Merge branch 'main' into 1.7.6-dev

# Conflicts:
#	src/Qt5/imports/FluentUI/Controls/FluRadioButtons.qml
#	src/Qt6/imports/FluentUI/Controls/FluRadioButtons.qml
This commit is contained in:
朱子楚\zhuzi
2024-05-10 12:26:14 +08:00
11 changed files with 311 additions and 101 deletions

View File

@ -18,22 +18,23 @@ FluObject {
if(screenLayout){
var last = screenLayout.getLastloader();
if(last.type === type && last.text === text && moremsg === last.moremsg){
last.restart();
return;
last.duration = duration
if (duration > 0) last.restart();
return last;
}
}
initScreenLayout();
contentComponent.createObject(screenLayout,{
type:type,
text:text,
duration:duration,
moremsg:moremsg,
});
return contentComponent.createObject(screenLayout,{
type:type,
text:text,
duration:duration,
moremsg:moremsg,
});
}
function createCustom(itemcomponent,duration){
initScreenLayout();
if(itemcomponent){
contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
return contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
}
}
function initScreenLayout(){
@ -85,7 +86,9 @@ FluObject {
}
Timer {
id:delayTimer
interval: duration; running: duration > 0; repeat: duration > 0
interval: duration;
running: duration > 0;
repeat: duration > 0
onTriggered: content.close();
}
FluLoader{
@ -235,18 +238,26 @@ FluObject {
}
}
function showSuccess(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "");
return mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "");
}
function showInfo(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "");
return mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "");
}
function showWarning(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "");
return mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "");
}
function showError(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
return mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
}
function showCustom(itemcomponent,duration=1000){
mcontrol.createCustom(itemcomponent,duration);
return mcontrol.createCustom(itemcomponent,duration);
}
function clearAllInfo(){
if(mcontrol.screenLayout != null) {
mcontrol.screenLayout.destroy()
mcontrol.screenLayout = null
}
return true
}
}

View File

@ -9,6 +9,8 @@ Item{
property int currentIndex : -1
property int spacing: 8
property int orientation: Qt.Vertical
property bool disabled: false
property bool manuallyDisabled: false
QtObject{
id: d
function updateChecked(){
@ -22,12 +24,23 @@ Item{
buttons[currentIndex].checked = true
}
}
function refreshButtonStatus() {
for(var i = 0;i<buttons.length;i++){
if(!manuallyDisabled) buttons[i].enabled = !disabled
}
}
}
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
onCurrentIndexChanged: {
d.updateChecked()
}
onDisabledChanged: {
d.refreshButtonStatus()
}
onManuallyDisabledChanged: {
d.refreshButtonStatus()
}
Component{
id:com_vertical
ColumnLayout {
@ -45,6 +58,7 @@ Item{
}
}
d.updateChecked()
d.refreshButtonStatus()
}
}
}
@ -65,6 +79,7 @@ Item{
}
}
d.updateChecked()
d.refreshButtonStatus()
}
}
}

View File

@ -299,16 +299,19 @@ Window {
loader_loading.sourceComponent = undefined
}
function showSuccess(text,duration,moremsg){
info_bar.showSuccess(text,duration,moremsg)
return info_bar.showSuccess(text,duration,moremsg)
}
function showInfo(text,duration,moremsg){
info_bar.showInfo(text,duration,moremsg)
return info_bar.showInfo(text,duration,moremsg)
}
function showWarning(text,duration,moremsg){
info_bar.showWarning(text,duration,moremsg)
return info_bar.showWarning(text,duration,moremsg)
}
function showError(text,duration,moremsg){
info_bar.showError(text,duration,moremsg)
return info_bar.showError(text,duration,moremsg)
}
function clearAllInfo(){
return info_bar.clearAllInfo()
}
function moveWindowToDesktopCenter(){
var availableGeometry = FluTools.desktopAvailableGeometry(window)

View File

@ -1,6 +1,6 @@
import QtQuick
import QtQuick.Controls
import FluentUI
import QtQuick 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
FluObject {
property var root;
@ -18,22 +18,23 @@ FluObject {
if(screenLayout){
var last = screenLayout.getLastloader();
if(last.type === type && last.text === text && moremsg === last.moremsg){
last.restart();
return;
last.duration = duration
if (duration > 0) last.restart();
return last;
}
}
initScreenLayout();
contentComponent.createObject(screenLayout,{
type:type,
text:text,
duration:duration,
moremsg:moremsg,
});
return contentComponent.createObject(screenLayout,{
type:type,
text:text,
duration:duration,
moremsg:moremsg,
});
}
function createCustom(itemcomponent,duration){
initScreenLayout();
if(itemcomponent){
contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
return contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
}
}
function initScreenLayout(){
@ -85,7 +86,9 @@ FluObject {
}
Timer {
id:delayTimer
interval: duration; running: duration > 0; repeat: duration > 0
interval: duration;
running: duration > 0;
repeat: duration > 0
onTriggered: content.close();
}
FluLoader{
@ -235,18 +238,26 @@ FluObject {
}
}
function showSuccess(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "");
return mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "");
}
function showInfo(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "");
return mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "");
}
function showWarning(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "");
return mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "");
}
function showError(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
return mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
}
function showCustom(itemcomponent,duration=1000){
mcontrol.createCustom(itemcomponent,duration);
return mcontrol.createCustom(itemcomponent,duration);
}
function clearAllInfo(){
if(mcontrol.screenLayout != null) {
mcontrol.screenLayout.destroy()
mcontrol.screenLayout = null
}
return true
}
}

View File

@ -10,6 +10,8 @@ Item{
property int currentIndex : -1
property int spacing: 8
property int orientation: Qt.Vertical
property bool disabled: false
property bool manuallyDisabled: false
QtObject{
id: d
function updateChecked(){
@ -23,12 +25,23 @@ Item{
buttons[currentIndex].checked = true
}
}
function refreshButtonStatus() {
for(var i = 0;i<buttons.length;i++){
if(!manuallyDisabled) buttons[i].enabled = !disabled
}
}
}
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
onCurrentIndexChanged: {
d.updateChecked()
}
onDisabledChanged: {
d.refreshButtonStatus()
}
onManuallyDisabledChanged: {
d.refreshButtonStatus()
}
Component{
id:com_vertical
ColumnLayout {
@ -46,6 +59,7 @@ Item{
}
}
d.updateChecked()
d.refreshButtonStatus()
}
}
}
@ -66,6 +80,7 @@ Item{
}
}
d.updateChecked()
d.refreshButtonStatus()
}
}
}

View File

@ -298,16 +298,19 @@ Window {
loader_loading.sourceComponent = undefined
}
function showSuccess(text,duration,moremsg){
info_bar.showSuccess(text,duration,moremsg)
return info_bar.showSuccess(text,duration,moremsg)
}
function showInfo(text,duration,moremsg){
info_bar.showInfo(text,duration,moremsg)
return info_bar.showInfo(text,duration,moremsg)
}
function showWarning(text,duration,moremsg){
info_bar.showWarning(text,duration,moremsg)
return info_bar.showWarning(text,duration,moremsg)
}
function showError(text,duration,moremsg){
info_bar.showError(text,duration,moremsg)
return info_bar.showError(text,duration,moremsg)
}
function clearAllInfo(){
return info_bar.clearAllInfo()
}
function moveWindowToDesktopCenter(){
var availableGeometry = FluTools.desktopAvailableGeometry(window)