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