mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-24 03:30:59 +08:00
update
This commit is contained in:
parent
a27554bfb2
commit
5cfd9824a8
@ -3,45 +3,40 @@ import QtQuick.Controls 2.15
|
|||||||
import FluentUI 1.0
|
import FluentUI 1.0
|
||||||
|
|
||||||
FluObject {
|
FluObject {
|
||||||
property var root;
|
property var root
|
||||||
property int layoutY: 75
|
property int layoutY: 75
|
||||||
id:control
|
id:control
|
||||||
FluObject{
|
FluObject{
|
||||||
id:mcontrol
|
id:mcontrol
|
||||||
property string const_success: "success";
|
property string const_success: "success"
|
||||||
property string const_info: "info";
|
property string const_info: "info"
|
||||||
property string const_warning: "warning";
|
property string const_warning: "warning"
|
||||||
property string const_error: "error";
|
property string const_error: "error"
|
||||||
property int maxWidth: 300;
|
property int maxWidth: 300
|
||||||
property var screenLayout: null;
|
property var screenLayout: null
|
||||||
function create(type,text,duration,moremsg){
|
function create(type,text,duration,moremsg){
|
||||||
if(screenLayout){
|
if(screenLayout){
|
||||||
var last = screenLayout.getLastloader();
|
var last = screenLayout.getLastloader()
|
||||||
if(last.type === type && last.text === text && moremsg === last.moremsg){
|
if(last.type === type && last.text === text && moremsg === last.moremsg){
|
||||||
last.duration = duration
|
last.duration = duration
|
||||||
if (duration > 0) last.restart();
|
if (duration > 0) last.restart()
|
||||||
return last;
|
return last
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
initScreenLayout();
|
initScreenLayout()
|
||||||
return contentComponent.createObject(screenLayout,{
|
return contentComponent.createObject(screenLayout,{type:type,text:text,duration:duration,moremsg:moremsg,})
|
||||||
type:type,
|
|
||||||
text:text,
|
|
||||||
duration:duration,
|
|
||||||
moremsg:moremsg,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function createCustom(itemcomponent,duration){
|
function createCustom(itemcomponent,duration){
|
||||||
initScreenLayout();
|
initScreenLayout()
|
||||||
if(itemcomponent){
|
if(itemcomponent){
|
||||||
return contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
|
return contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function initScreenLayout(){
|
function initScreenLayout(){
|
||||||
if(screenLayout == null){
|
if(screenLayout == null){
|
||||||
screenLayout = screenlayoutComponent.createObject(root);
|
screenLayout = screenlayoutComponent.createObject(root)
|
||||||
screenLayout.y = control.layoutY;
|
screenLayout.y = control.layoutY
|
||||||
screenLayout.z = 100000;
|
screenLayout.z = 100000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component{
|
Component{
|
||||||
@ -58,44 +53,44 @@ FluObject {
|
|||||||
duration: FluTheme.animationEnabled ? 333 : 0
|
duration: FluTheme.animationEnabled ? 333 : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onChildrenChanged: if(children.length === 0) destroy();
|
onChildrenChanged: if(children.length === 0) destroy()
|
||||||
function getLastloader(){
|
function getLastloader(){
|
||||||
if(children.length > 0){
|
if(children.length > 0){
|
||||||
return children[children.length - 1];
|
return children[children.length - 1]
|
||||||
}
|
}
|
||||||
return null;
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component{
|
Component{
|
||||||
id:contentComponent
|
id:contentComponent
|
||||||
Item{
|
Item{
|
||||||
id:content;
|
id:content
|
||||||
property int duration: 1500
|
property int duration: 1500
|
||||||
property var itemcomponent
|
property var itemcomponent
|
||||||
property string type
|
property string type
|
||||||
property string text
|
property string text
|
||||||
property string moremsg
|
property string moremsg
|
||||||
width: parent.width;
|
width: parent.width
|
||||||
height: loader.height;
|
height: loader.height
|
||||||
function close(){
|
function close(){
|
||||||
content.destroy();
|
content.destroy()
|
||||||
}
|
}
|
||||||
function restart(){
|
function restart(){
|
||||||
delayTimer.restart();
|
delayTimer.restart()
|
||||||
}
|
}
|
||||||
Timer {
|
Timer {
|
||||||
id:delayTimer
|
id:delayTimer
|
||||||
interval: duration;
|
interval: duration
|
||||||
running: duration > 0;
|
running: duration > 0
|
||||||
repeat: duration > 0
|
repeat: duration > 0
|
||||||
onTriggered: content.close();
|
onTriggered: content.close()
|
||||||
}
|
}
|
||||||
FluLoader{
|
FluLoader{
|
||||||
id:loader;
|
id:loader
|
||||||
x:(parent.width - width) / 2;
|
x:(parent.width - width) / 2
|
||||||
property var _super: content;
|
property var _super: content
|
||||||
scale: item ? 1 : 0;
|
scale: item ? 1 : 0
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
enabled: FluTheme.animationEnabled
|
enabled: FluTheme.animationEnabled
|
||||||
@ -104,30 +99,30 @@ FluObject {
|
|||||||
duration: 167
|
duration: 167
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sourceComponent:itemcomponent ? itemcomponent : mcontrol.fluent_sytle;
|
sourceComponent:itemcomponent ? itemcomponent : mcontrol.fluent_sytle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
property Component fluent_sytle: Rectangle{
|
property Component fluent_sytle: Rectangle{
|
||||||
width: rowlayout.width + (btn_close.visible ? 30 : 48);
|
width: rowlayout.width + (btn_close.visible ? 30 : 48)
|
||||||
height: rowlayout.height + 20;
|
height: rowlayout.height + 20
|
||||||
color: {
|
color: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return Qt.rgba(57/255,61/255,27/255,1);
|
case mcontrol.const_success: return Qt.rgba(57/255,61/255,27/255,1)
|
||||||
case mcontrol.const_warning: return Qt.rgba(67/255,53/255,25/255,1);
|
case mcontrol.const_warning: return Qt.rgba(67/255,53/255,25/255,1)
|
||||||
case mcontrol.const_info: return Qt.rgba(39/255,39/255,39/255,1);
|
case mcontrol.const_info: return Qt.rgba(39/255,39/255,39/255,1)
|
||||||
case mcontrol.const_error: return Qt.rgba(68/255,39/255,38/255,1);
|
case mcontrol.const_error: return Qt.rgba(68/255,39/255,38/255,1)
|
||||||
}
|
}
|
||||||
return Qt.rgba(255,255,255,1)
|
return Qt.rgba(1,1,1,1)
|
||||||
}else{
|
}else{
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return "#dff6dd";
|
case mcontrol.const_success: return Qt.rgba(223/255,246/255,221/255,1)
|
||||||
case mcontrol.const_warning: return "#fff4ce";
|
case mcontrol.const_warning: return Qt.rgba(255/255,244/255,206/255,1)
|
||||||
case mcontrol.const_info: return "#f4f4f4";
|
case mcontrol.const_info: return Qt.rgba(244/255,244/255,244/255,1)
|
||||||
case mcontrol.const_error: return "#fde7e9";
|
case mcontrol.const_error: return Qt.rgba(253/255,231/255,233/255,1)
|
||||||
}
|
}
|
||||||
return "#FFFFFF"
|
return Qt.rgba(1,1,1,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluShadow{
|
FluShadow{
|
||||||
@ -138,34 +133,34 @@ FluObject {
|
|||||||
border.color: {
|
border.color: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return Qt.rgba(56/255,61/255,27/255,1);
|
case mcontrol.const_success: return Qt.rgba(56/255,61/255,27/255,1)
|
||||||
case mcontrol.const_warning: return Qt.rgba(66/255,53/255,25/255,1);
|
case mcontrol.const_warning: return Qt.rgba(66/255,53/255,25/255,1)
|
||||||
case mcontrol.const_info: return Qt.rgba(38/255,39/255,39/255,1);
|
case mcontrol.const_info: return Qt.rgba(38/255,39/255,39/255,1)
|
||||||
case mcontrol.const_error: return Qt.rgba(67/255,39/255,38/255,1);
|
case mcontrol.const_error: return Qt.rgba(67/255,39/255,38/255,1)
|
||||||
}
|
}
|
||||||
return "#FFFFFF"
|
return Qt.rgba(1,1,1,1)
|
||||||
}else{
|
}else{
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return "#d2e8d0";
|
case mcontrol.const_success: return Qt.rgba(210/255,232/255,208/255,1)
|
||||||
case mcontrol.const_warning: return "#f0e6c2";
|
case mcontrol.const_warning: return Qt.rgba(240/255,230/255,194/255,1)
|
||||||
case mcontrol.const_info: return "#e6e6e6";
|
case mcontrol.const_info: return Qt.rgba(230/255,230/255,230/255,1)
|
||||||
case mcontrol.const_error: return "#eed9db";
|
case mcontrol.const_error: return Qt.rgba(238/255,217/255,219/255,1)
|
||||||
}
|
}
|
||||||
return "#FFFFFF"
|
return Qt.rgba(1,1,1,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row{
|
Row{
|
||||||
id:rowlayout
|
id:rowlayout
|
||||||
x:20;
|
x:20
|
||||||
y:(parent.height - height) / 2;
|
y:(parent.height - height) / 2
|
||||||
spacing: 10
|
spacing: 10
|
||||||
FluIcon{
|
FluIcon{
|
||||||
iconSource:{
|
iconSource:{
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return FluentIcons.CompletedSolid;
|
case mcontrol.const_success: return FluentIcons.CompletedSolid
|
||||||
case mcontrol.const_warning: return FluentIcons.InfoSolid;
|
case mcontrol.const_warning: return FluentIcons.InfoSolid
|
||||||
case mcontrol.const_info: return FluentIcons.InfoSolid;
|
case mcontrol.const_info: return FluentIcons.InfoSolid
|
||||||
case mcontrol.const_error: return FluentIcons.StatusErrorFull;
|
case mcontrol.const_error: return FluentIcons.StatusErrorFull
|
||||||
}FluentIcons.StatusErrorFull
|
}FluentIcons.StatusErrorFull
|
||||||
return FluentIcons.FA_info_circle
|
return FluentIcons.FA_info_circle
|
||||||
}
|
}
|
||||||
@ -173,20 +168,20 @@ FluObject {
|
|||||||
iconColor: {
|
iconColor: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1);
|
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1)
|
||||||
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1);
|
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1)
|
||||||
case mcontrol.const_info: return FluTheme.primaryColor;
|
case mcontrol.const_info: return FluTheme.primaryColor
|
||||||
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1);
|
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1)
|
||||||
}
|
}
|
||||||
return "#FFFFFF"
|
return Qt.rgba(1,1,1,1)
|
||||||
}else{
|
}else{
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return "#0f7b0f";
|
case mcontrol.const_success: return Qt.rgba(15/255,123/255,15/255,1)
|
||||||
case mcontrol.const_warning: return "#9d5d00";
|
case mcontrol.const_warning: return Qt.rgba(157/255,93/255,0/255,1)
|
||||||
case mcontrol.const_info: return "#0066b4";
|
case mcontrol.const_info: return Qt.rgba(0/255,102/255,180/255,1)
|
||||||
case mcontrol.const_error: return "#c42b1c";
|
case mcontrol.const_error: return Qt.rgba(196/255,43/255,28/255,1)
|
||||||
}
|
}
|
||||||
return "#FFFFFF"
|
return Qt.rgba(1,1,1,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -211,46 +206,32 @@ FluObject {
|
|||||||
id:btn_close
|
id:btn_close
|
||||||
iconSource: FluentIcons.ChromeClose
|
iconSource: FluentIcons.ChromeClose
|
||||||
iconSize: 10
|
iconSize: 10
|
||||||
y:5
|
verticalPadding: 0
|
||||||
|
horizontalPadding: 0
|
||||||
|
width: 30
|
||||||
|
height: 20
|
||||||
visible: _super.duration<=0
|
visible: _super.duration<=0
|
||||||
iconColor: {
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
if(FluTheme.dark){
|
iconColor: FluTheme.dark ? Qt.rgba(222/255,222/255,222/255,1) : Qt.rgba(97/255,97/255,97/255,1)
|
||||||
switch(_super.type){
|
|
||||||
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1);
|
|
||||||
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1);
|
|
||||||
case mcontrol.const_info: return FluTheme.primaryColor;
|
|
||||||
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1);
|
|
||||||
}
|
|
||||||
return "#FFFFFF"
|
|
||||||
}else{
|
|
||||||
switch(_super.type){
|
|
||||||
case mcontrol.const_success: return "#0f7b0f";
|
|
||||||
case mcontrol.const_warning: return "#9d5d00";
|
|
||||||
case mcontrol.const_info: return "#0066b4";
|
|
||||||
case mcontrol.const_error: return "#c42b1c";
|
|
||||||
}
|
|
||||||
return "#FFFFFF"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onClicked: _super.close()
|
onClicked: _super.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function showSuccess(text,duration=1000,moremsg){
|
function showSuccess(text,duration=1000,moremsg){
|
||||||
return 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){
|
function showInfo(text,duration=1000,moremsg){
|
||||||
return 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){
|
function showWarning(text,duration=1000,moremsg){
|
||||||
return 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){
|
function showError(text,duration=1000,moremsg){
|
||||||
return mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
|
return mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "")
|
||||||
}
|
}
|
||||||
function showCustom(itemcomponent,duration=1000){
|
function showCustom(itemcomponent,duration=1000){
|
||||||
return mcontrol.createCustom(itemcomponent,duration);
|
return mcontrol.createCustom(itemcomponent,duration)
|
||||||
}
|
}
|
||||||
function clearAllInfo(){
|
function clearAllInfo(){
|
||||||
if(mcontrol.screenLayout != null) {
|
if(mcontrol.screenLayout != null) {
|
||||||
|
@ -1120,7 +1120,8 @@ Item {
|
|||||||
}
|
}
|
||||||
padding: 0
|
padding: 0
|
||||||
focus: true
|
focus: true
|
||||||
contentItem: Item{
|
contentItem: FluClip{
|
||||||
|
radius: [5,5,5,5]
|
||||||
ListView{
|
ListView{
|
||||||
id:list_view
|
id:list_view
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -1145,7 +1146,6 @@ Item {
|
|||||||
visible: item_button.activeFocus
|
visible: item_button.activeFocus
|
||||||
radius:4
|
radius:4
|
||||||
}
|
}
|
||||||
|
|
||||||
FluLoader{
|
FluLoader{
|
||||||
id:item_dot_loader
|
id:item_dot_loader
|
||||||
anchors{
|
anchors{
|
||||||
@ -1160,7 +1160,6 @@ Item {
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
contentItem: FluText{
|
contentItem: FluText{
|
||||||
text:modelData.title
|
text:modelData.title
|
||||||
@ -1187,13 +1186,13 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
background: FluRectangle{
|
background: Rectangle{
|
||||||
implicitWidth: 180
|
implicitWidth: 180
|
||||||
radius: [4,4,4,4]
|
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
||||||
FluShadow{
|
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
|
||||||
radius: 4
|
border.width: 1
|
||||||
}
|
radius: 5
|
||||||
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
|
FluShadow{}
|
||||||
}
|
}
|
||||||
function showPopup(pos,height,model){
|
function showPopup(pos,height,model){
|
||||||
background.implicitHeight = height
|
background.implicitHeight = height
|
||||||
|
@ -1,47 +1,42 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluObject {
|
FluObject {
|
||||||
property var root;
|
property var root
|
||||||
property int layoutY: 75
|
property int layoutY: 75
|
||||||
id:control
|
id:control
|
||||||
FluObject{
|
FluObject{
|
||||||
id:mcontrol
|
id:mcontrol
|
||||||
property string const_success: "success";
|
property string const_success: "success"
|
||||||
property string const_info: "info";
|
property string const_info: "info"
|
||||||
property string const_warning: "warning";
|
property string const_warning: "warning"
|
||||||
property string const_error: "error";
|
property string const_error: "error"
|
||||||
property int maxWidth: 300;
|
property int maxWidth: 300
|
||||||
property var screenLayout: null;
|
property var screenLayout: null
|
||||||
function create(type,text,duration,moremsg){
|
function create(type,text,duration,moremsg){
|
||||||
if(screenLayout){
|
if(screenLayout){
|
||||||
var last = screenLayout.getLastloader();
|
var last = screenLayout.getLastloader()
|
||||||
if(last.type === type && last.text === text && moremsg === last.moremsg){
|
if(last.type === type && last.text === text && moremsg === last.moremsg){
|
||||||
last.duration = duration
|
last.duration = duration
|
||||||
if (duration > 0) last.restart();
|
if (duration > 0) last.restart()
|
||||||
return last;
|
return last
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
initScreenLayout();
|
initScreenLayout()
|
||||||
return contentComponent.createObject(screenLayout,{
|
return contentComponent.createObject(screenLayout,{type:type,text:text,duration:duration,moremsg:moremsg,})
|
||||||
type:type,
|
|
||||||
text:text,
|
|
||||||
duration:duration,
|
|
||||||
moremsg:moremsg,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function createCustom(itemcomponent,duration){
|
function createCustom(itemcomponent,duration){
|
||||||
initScreenLayout();
|
initScreenLayout()
|
||||||
if(itemcomponent){
|
if(itemcomponent){
|
||||||
return contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
|
return contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function initScreenLayout(){
|
function initScreenLayout(){
|
||||||
if(screenLayout == null){
|
if(screenLayout == null){
|
||||||
screenLayout = screenlayoutComponent.createObject(root);
|
screenLayout = screenlayoutComponent.createObject(root)
|
||||||
screenLayout.y = control.layoutY;
|
screenLayout.y = control.layoutY
|
||||||
screenLayout.z = 100000;
|
screenLayout.z = 100000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component{
|
Component{
|
||||||
@ -58,44 +53,44 @@ FluObject {
|
|||||||
duration: FluTheme.animationEnabled ? 333 : 0
|
duration: FluTheme.animationEnabled ? 333 : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onChildrenChanged: if(children.length === 0) destroy();
|
onChildrenChanged: if(children.length === 0) destroy()
|
||||||
function getLastloader(){
|
function getLastloader(){
|
||||||
if(children.length > 0){
|
if(children.length > 0){
|
||||||
return children[children.length - 1];
|
return children[children.length - 1]
|
||||||
}
|
}
|
||||||
return null;
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component{
|
Component{
|
||||||
id:contentComponent
|
id:contentComponent
|
||||||
Item{
|
Item{
|
||||||
id:content;
|
id:content
|
||||||
property int duration: 1500
|
property int duration: 1500
|
||||||
property var itemcomponent
|
property var itemcomponent
|
||||||
property string type
|
property string type
|
||||||
property string text
|
property string text
|
||||||
property string moremsg
|
property string moremsg
|
||||||
width: parent.width;
|
width: parent.width
|
||||||
height: loader.height;
|
height: loader.height
|
||||||
function close(){
|
function close(){
|
||||||
content.destroy();
|
content.destroy()
|
||||||
}
|
}
|
||||||
function restart(){
|
function restart(){
|
||||||
delayTimer.restart();
|
delayTimer.restart()
|
||||||
}
|
}
|
||||||
Timer {
|
Timer {
|
||||||
id:delayTimer
|
id:delayTimer
|
||||||
interval: duration;
|
interval: duration
|
||||||
running: duration > 0;
|
running: duration > 0
|
||||||
repeat: duration > 0
|
repeat: duration > 0
|
||||||
onTriggered: content.close();
|
onTriggered: content.close()
|
||||||
}
|
}
|
||||||
FluLoader{
|
FluLoader{
|
||||||
id:loader;
|
id:loader
|
||||||
x:(parent.width - width) / 2;
|
x:(parent.width - width) / 2
|
||||||
property var _super: content;
|
property var _super: content
|
||||||
scale: item ? 1 : 0;
|
scale: item ? 1 : 0
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
enabled: FluTheme.animationEnabled
|
enabled: FluTheme.animationEnabled
|
||||||
@ -104,30 +99,30 @@ FluObject {
|
|||||||
duration: 167
|
duration: 167
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sourceComponent:itemcomponent ? itemcomponent : mcontrol.fluent_sytle;
|
sourceComponent:itemcomponent ? itemcomponent : mcontrol.fluent_sytle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
property Component fluent_sytle: Rectangle{
|
property Component fluent_sytle: Rectangle{
|
||||||
width: rowlayout.width + (btn_close.visible ? 30 : 48);
|
width: rowlayout.width + (btn_close.visible ? 30 : 48)
|
||||||
height: rowlayout.height + 20;
|
height: rowlayout.height + 20
|
||||||
color: {
|
color: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return Qt.rgba(57/255,61/255,27/255,1);
|
case mcontrol.const_success: return Qt.rgba(57/255,61/255,27/255,1)
|
||||||
case mcontrol.const_warning: return Qt.rgba(67/255,53/255,25/255,1);
|
case mcontrol.const_warning: return Qt.rgba(67/255,53/255,25/255,1)
|
||||||
case mcontrol.const_info: return Qt.rgba(39/255,39/255,39/255,1);
|
case mcontrol.const_info: return Qt.rgba(39/255,39/255,39/255,1)
|
||||||
case mcontrol.const_error: return Qt.rgba(68/255,39/255,38/255,1);
|
case mcontrol.const_error: return Qt.rgba(68/255,39/255,38/255,1)
|
||||||
}
|
}
|
||||||
return Qt.rgba(255,255,255,1)
|
return Qt.rgba(1,1,1,1)
|
||||||
}else{
|
}else{
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return "#dff6dd";
|
case mcontrol.const_success: return Qt.rgba(223/255,246/255,221/255,1)
|
||||||
case mcontrol.const_warning: return "#fff4ce";
|
case mcontrol.const_warning: return Qt.rgba(255/255,244/255,206/255,1)
|
||||||
case mcontrol.const_info: return "#f4f4f4";
|
case mcontrol.const_info: return Qt.rgba(244/255,244/255,244/255,1)
|
||||||
case mcontrol.const_error: return "#fde7e9";
|
case mcontrol.const_error: return Qt.rgba(253/255,231/255,233/255,1)
|
||||||
}
|
}
|
||||||
return "#FFFFFF"
|
return Qt.rgba(1,1,1,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluShadow{
|
FluShadow{
|
||||||
@ -138,34 +133,34 @@ FluObject {
|
|||||||
border.color: {
|
border.color: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return Qt.rgba(56/255,61/255,27/255,1);
|
case mcontrol.const_success: return Qt.rgba(56/255,61/255,27/255,1)
|
||||||
case mcontrol.const_warning: return Qt.rgba(66/255,53/255,25/255,1);
|
case mcontrol.const_warning: return Qt.rgba(66/255,53/255,25/255,1)
|
||||||
case mcontrol.const_info: return Qt.rgba(38/255,39/255,39/255,1);
|
case mcontrol.const_info: return Qt.rgba(38/255,39/255,39/255,1)
|
||||||
case mcontrol.const_error: return Qt.rgba(67/255,39/255,38/255,1);
|
case mcontrol.const_error: return Qt.rgba(67/255,39/255,38/255,1)
|
||||||
}
|
}
|
||||||
return "#FFFFFF"
|
return Qt.rgba(1,1,1,1)
|
||||||
}else{
|
}else{
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return "#d2e8d0";
|
case mcontrol.const_success: return Qt.rgba(210/255,232/255,208/255,1)
|
||||||
case mcontrol.const_warning: return "#f0e6c2";
|
case mcontrol.const_warning: return Qt.rgba(240/255,230/255,194/255,1)
|
||||||
case mcontrol.const_info: return "#e6e6e6";
|
case mcontrol.const_info: return Qt.rgba(230/255,230/255,230/255,1)
|
||||||
case mcontrol.const_error: return "#eed9db";
|
case mcontrol.const_error: return Qt.rgba(238/255,217/255,219/255,1)
|
||||||
}
|
}
|
||||||
return "#FFFFFF"
|
return Qt.rgba(1,1,1,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row{
|
Row{
|
||||||
id:rowlayout
|
id:rowlayout
|
||||||
x:20;
|
x:20
|
||||||
y:(parent.height - height) / 2;
|
y:(parent.height - height) / 2
|
||||||
spacing: 10
|
spacing: 10
|
||||||
FluIcon{
|
FluIcon{
|
||||||
iconSource:{
|
iconSource:{
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return FluentIcons.CompletedSolid;
|
case mcontrol.const_success: return FluentIcons.CompletedSolid
|
||||||
case mcontrol.const_warning: return FluentIcons.InfoSolid;
|
case mcontrol.const_warning: return FluentIcons.InfoSolid
|
||||||
case mcontrol.const_info: return FluentIcons.InfoSolid;
|
case mcontrol.const_info: return FluentIcons.InfoSolid
|
||||||
case mcontrol.const_error: return FluentIcons.StatusErrorFull;
|
case mcontrol.const_error: return FluentIcons.StatusErrorFull
|
||||||
}FluentIcons.StatusErrorFull
|
}FluentIcons.StatusErrorFull
|
||||||
return FluentIcons.FA_info_circle
|
return FluentIcons.FA_info_circle
|
||||||
}
|
}
|
||||||
@ -173,20 +168,20 @@ FluObject {
|
|||||||
iconColor: {
|
iconColor: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1);
|
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1)
|
||||||
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1);
|
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1)
|
||||||
case mcontrol.const_info: return FluTheme.primaryColor;
|
case mcontrol.const_info: return FluTheme.primaryColor
|
||||||
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1);
|
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1)
|
||||||
}
|
}
|
||||||
return "#FFFFFF"
|
return Qt.rgba(1,1,1,1)
|
||||||
}else{
|
}else{
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return "#0f7b0f";
|
case mcontrol.const_success: return Qt.rgba(15/255,123/255,15/255,1)
|
||||||
case mcontrol.const_warning: return "#9d5d00";
|
case mcontrol.const_warning: return Qt.rgba(157/255,93/255,0/255,1)
|
||||||
case mcontrol.const_info: return "#0066b4";
|
case mcontrol.const_info: return Qt.rgba(0/255,102/255,180/255,1)
|
||||||
case mcontrol.const_error: return "#c42b1c";
|
case mcontrol.const_error: return Qt.rgba(196/255,43/255,28/255,1)
|
||||||
}
|
}
|
||||||
return "#FFFFFF"
|
return Qt.rgba(1,1,1,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -211,46 +206,32 @@ FluObject {
|
|||||||
id:btn_close
|
id:btn_close
|
||||||
iconSource: FluentIcons.ChromeClose
|
iconSource: FluentIcons.ChromeClose
|
||||||
iconSize: 10
|
iconSize: 10
|
||||||
y:5
|
verticalPadding: 0
|
||||||
|
horizontalPadding: 0
|
||||||
|
width: 30
|
||||||
|
height: 20
|
||||||
visible: _super.duration<=0
|
visible: _super.duration<=0
|
||||||
iconColor: {
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
if(FluTheme.dark){
|
iconColor: FluTheme.dark ? Qt.rgba(222/255,222/255,222/255,1) : Qt.rgba(97/255,97/255,97/255,1)
|
||||||
switch(_super.type){
|
|
||||||
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1);
|
|
||||||
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1);
|
|
||||||
case mcontrol.const_info: return FluTheme.primaryColor;
|
|
||||||
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1);
|
|
||||||
}
|
|
||||||
return "#FFFFFF"
|
|
||||||
}else{
|
|
||||||
switch(_super.type){
|
|
||||||
case mcontrol.const_success: return "#0f7b0f";
|
|
||||||
case mcontrol.const_warning: return "#9d5d00";
|
|
||||||
case mcontrol.const_info: return "#0066b4";
|
|
||||||
case mcontrol.const_error: return "#c42b1c";
|
|
||||||
}
|
|
||||||
return "#FFFFFF"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onClicked: _super.close()
|
onClicked: _super.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function showSuccess(text,duration=1000,moremsg){
|
function showSuccess(text,duration=1000,moremsg){
|
||||||
return 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){
|
function showInfo(text,duration=1000,moremsg){
|
||||||
return 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){
|
function showWarning(text,duration=1000,moremsg){
|
||||||
return 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){
|
function showError(text,duration=1000,moremsg){
|
||||||
return mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
|
return mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "")
|
||||||
}
|
}
|
||||||
function showCustom(itemcomponent,duration=1000){
|
function showCustom(itemcomponent,duration=1000){
|
||||||
return mcontrol.createCustom(itemcomponent,duration);
|
return mcontrol.createCustom(itemcomponent,duration)
|
||||||
}
|
}
|
||||||
function clearAllInfo(){
|
function clearAllInfo(){
|
||||||
if(mcontrol.screenLayout != null) {
|
if(mcontrol.screenLayout != null) {
|
||||||
|
@ -1121,7 +1121,8 @@ Item {
|
|||||||
}
|
}
|
||||||
padding: 0
|
padding: 0
|
||||||
focus: true
|
focus: true
|
||||||
contentItem: Item{
|
contentItem: FluClip{
|
||||||
|
radius: [5,5,5,5]
|
||||||
ListView{
|
ListView{
|
||||||
id:list_view
|
id:list_view
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -1146,7 +1147,6 @@ Item {
|
|||||||
visible: item_button.activeFocus
|
visible: item_button.activeFocus
|
||||||
radius:4
|
radius:4
|
||||||
}
|
}
|
||||||
|
|
||||||
FluLoader{
|
FluLoader{
|
||||||
id:item_dot_loader
|
id:item_dot_loader
|
||||||
anchors{
|
anchors{
|
||||||
@ -1161,7 +1161,6 @@ Item {
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
contentItem: FluText{
|
contentItem: FluText{
|
||||||
text:modelData.title
|
text:modelData.title
|
||||||
@ -1188,13 +1187,13 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
background: FluRectangle{
|
background: Rectangle{
|
||||||
implicitWidth: 180
|
implicitWidth: 180
|
||||||
radius: [4,4,4,4]
|
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
||||||
FluShadow{
|
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
|
||||||
radius: 4
|
border.width: 1
|
||||||
}
|
radius: 5
|
||||||
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
|
FluShadow{}
|
||||||
}
|
}
|
||||||
function showPopup(pos,height,model){
|
function showPopup(pos,height,model){
|
||||||
background.implicitHeight = height
|
background.implicitHeight = height
|
||||||
|
Loading…
Reference in New Issue
Block a user