main
zhuzihcu 2023-04-19 09:41:08 +08:00
parent cb94db8a97
commit 88fed82260
17 changed files with 641 additions and 530 deletions

View File

@ -6,7 +6,7 @@
AppInfo::AppInfo(QObject *parent)
: QObject{parent}
{
version("1.2.4");
version("1.2.5");
lang(new En());
}

View File

@ -21,6 +21,7 @@ FluScrollablePage{
FluPivot{
anchors.fill: parent
currentIndex: 2
FluPivotItem{
title:"All"
contentItem:FluText{

View File

@ -26,13 +26,25 @@ FluWindow {
SystemTrayIcon {
visible: true
icon.source: "qrc:/res/image/favicon.ico"
onActivated: {
tooltip: "FluentUI"
menu: Menu {
MenuItem {
text: "退出"
onTriggered: {
window.destoryWindow()
FluApp.closeApp()
}
}
}
onActivated:
(reason)=>{
if(reason === SystemTrayIcon.Trigger){
window.show()
window.raise()
window.requestActivate()
}
}
}
FluNavigationView{

View File

@ -127,3 +127,7 @@ void FluApp::clipText(const QString& text){
QString FluApp::uuid(){
return QUuid::createUuid().toString();
}
void FluApp::closeApp(){
qApp->exit(0);
}

View File

@ -34,6 +34,8 @@ public:
Q_INVOKABLE QString uuid();
Q_INVOKABLE void closeApp();
public:
QMap<quint64, QQuickWindow*> wnds;
private:

View File

@ -14,11 +14,6 @@ bool NativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *mes
if (msg == Q_NULLPTR)
return false;
switch(msg->message) {
case WM_COMMAND: {
SendMessage(msg->hwnd, WM_SYSCOMMAND, msg->wParam, msg->lParam);
*result = DefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam);
return true;
}
case WM_NCCALCSIZE:{
NCCALCSIZE_PARAMS& params = *reinterpret_cast<NCCALCSIZE_PARAMS*>(msg->lParam);
if (params.rgrc[0].top != 0)

View File

@ -67,21 +67,26 @@ Rectangle {
modal: true
dim:false
enter: Transition {
NumberAnimation {
property: "y"
from:0
to:popup.y
duration: 150
}
reversible: true
NumberAnimation {
property: "opacity"
from:0
to:1
duration: 150
duration: 83
}
}
exit:Transition {
NumberAnimation {
property: "opacity"
from:1
to:0
duration: 83
}
}
contentItem: Item{
anchors.fill: parent
clip: true
FluCalendarView{
id:container
onDateClicked:
@ -94,15 +99,19 @@ Rectangle {
}
}
}
background: Item{}
background: Item{
FluShadow{
radius: 5
}
}
function showPopup() {
var pos = control.mapToItem(null, 0, 0)
if(window.height>pos.y+control.height+popup.height){
if(window.height>pos.y+control.height+container.height){
popup.y = control.height
} else if(pos.y>popup.height){
popup.y = -popup.height
} else if(pos.y>container.height){
popup.y = -container.height
} else {
popup.y = window.height-(pos.y+popup.height)
popup.y = window.height-(pos.y+container.height)
}
popup.x = -(popup.width-control.width)/2
popup.open()

View File

@ -33,34 +33,42 @@ FluControl{
height: container.height
width: container.width
contentItem: Item{
anchors.fill: parent
clip: true
FluColorView{
id:container
}
}
background:Item{}
enter: Transition {
NumberAnimation {
property: "y"
from:0
to:popup.y
duration: 150
background:Item{
FluShadow{
radius: 5
}
}
enter: Transition {
reversible: true
NumberAnimation {
property: "opacity"
from:0
to:1
duration: 150
duration: 83
}
}
exit:Transition {
NumberAnimation {
property: "opacity"
from:1
to:0
duration: 83
}
}
function showPopup() {
var pos = control.mapToItem(null, 0, 0)
if(window.height>pos.y+control.height+popup.height){
if(window.height>pos.y+control.height+container.height){
popup.y = control.height
} else if(pos.y>popup.height){
popup.y = -popup.height
} else if(pos.y>container.height){
popup.y = -container.height
} else {
popup.y = window.height-(pos.y+popup.height)
popup.y = window.height-(pos.y+container.height)
}
popup.x = -(popup.width-control.width)/2
popup.open()

View File

@ -100,28 +100,39 @@ Rectangle {
Menu{
id:popup
modal: true
width: 300
height: 340
width: container.width
height: container.height
dim:false
enter: Transition {
NumberAnimation {
property: "y"
from:0
to:popup.y
duration: 150
}
reversible: true
NumberAnimation {
property: "opacity"
from:0
to:1
duration: 150
duration: 83
}
}
background:Item{}
contentItem: Rectangle{
exit:Transition {
NumberAnimation {
property: "opacity"
from:1
to:0
duration: 83
}
}
background:Item{
FluShadow{
radius: 4
}
}
contentItem: Item{
clip: true
Rectangle{
id:container
radius: 4
anchors.fill: parent
width: 300
height: 340
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
MouseArea{
anchors.fill: parent
@ -338,6 +349,7 @@ Rectangle {
}
}
}
}
y:35
function showPopup() {
changeFlag = true
@ -362,12 +374,12 @@ Rectangle {
text_day.text = day
var pos = root.mapToItem(null, 0, 0)
if(window.height>pos.y+root.height+popup.height){
if(window.height>pos.y+root.height+container.height){
popup.y = root.height
} else if(pos.y>popup.height){
popup.y = -popup.height
} else if(pos.y>container.height){
popup.y = -container.height
} else {
popup.y = window.height-(pos.y+popup.height)
popup.y = window.height-(pos.y+container.height)
}
popup.open()
}

View File

@ -76,12 +76,13 @@ FluControl {
onClicked: {
var pos = control.mapToItem(null, 0, 0)
if(window.height>pos.y+control.height+menu.height){
var containerHeight = menu.getContainerHeight()
if(window.height>pos.y+control.height+containerHeight){
menu.y = control.height
}else if(pos.y>menu.height){
menu.y = -menu.height
}else if(pos.y>containerHeight){
menu.y = -containerHeight
}else{
menu.y = window.height-(pos.y+menu.height)
menu.y = window.height-(pos.y+containerHeight)
}
menu.open()
}

View File

@ -84,7 +84,9 @@ Item {
height: expand ? contentHeight : 0
Behavior on height {
NumberAnimation{
duration: 150
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: expand ? [ 0, 0, 0, 1 ] : [ 1, 0, 0, 0 ]
}
}
}

View File

@ -12,38 +12,50 @@ Menu {
modal:true
dim:false
enter: Transition {
NumberAnimation {
property: "y"
from:0
to:popup.y
duration: animEnabled ? 150 : 0
}
reversible: true
NumberAnimation {
property: "opacity"
from:0
to:1
duration: animEnabled ? 150 : 0
duration: 83
}
}
exit:Transition {
NumberAnimation {
property: "opacity"
from:1
to:0
duration: 83
}
}
background:Item{
FluShadow{
radius: 5
}
}
background:Item{}
contentItem: Item {
clip: true
Rectangle{
anchors.fill: parent
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,0.97) : Qt.rgba(237/255,237/255,237/255,0.97)
radius: 5
}
FluShadow{
radius: 5
}
Column{
id:container
spacing: 5
topPadding: 5
bottomPadding: 5
width: popup.width
id:container
function closePopup(){
popup.close()
}
}
}
function getContainerHeight(){
return container.height
}
}

View File

@ -120,7 +120,9 @@ Item {
}
Behavior on height {
NumberAnimation{
duration: 150
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
}
@ -137,7 +139,9 @@ Item {
}
Behavior on height {
NumberAnimation{
duration: 150
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
width: layout_list.width
@ -206,12 +210,12 @@ Item {
visible:opacity
Behavior on opacity {
NumberAnimation{
duration: 220
duration: 83
}
}
Behavior on rotation {
NumberAnimation{
duration: 150
duration: 83
}
}
}
@ -290,7 +294,7 @@ Item {
visible:opacity
Behavior on opacity {
NumberAnimation{
duration: 220
duration: 83
}
}
anchors{
@ -313,7 +317,9 @@ Item {
Item{
Behavior on height {
NumberAnimation{
duration: 150
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
clip: true
@ -442,7 +448,7 @@ Item {
visible:opacity
Behavior on opacity {
NumberAnimation{
duration: 220
duration: 83
}
}
color:{
@ -504,7 +510,9 @@ Item {
}
Behavior on Layout.preferredWidth{
NumberAnimation{
duration: 220
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
}
@ -544,10 +552,24 @@ Item {
clip: true
popEnter : Transition{}
popExit : Transition {
NumberAnimation { properties: "y"; from: 0; to: nav_swipe.height; duration: 200 }
NumberAnimation {
properties: "y"
from: 0
to: nav_swipe.height
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 1, 0, 0, 0 ]
}
}
pushEnter: Transition {
NumberAnimation { properties: "y"; from: nav_swipe.height; to: 0; duration: 200 }
NumberAnimation {
properties: "y";
from: nav_swipe.height;
to: 0
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
pushExit : Transition{}
replaceEnter : Transition{}
@ -573,13 +595,17 @@ Item {
}
Behavior on width{
NumberAnimation{
duration: 150
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
Behavior on x{
id:anim_layout_list_x
NumberAnimation{
duration: 150
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
anchors{
@ -626,7 +652,7 @@ Item {
visible: opacity
Behavior on opacity{
NumberAnimation{
duration: 100
duration: 83
}
}
}
@ -636,7 +662,7 @@ Item {
opacity:d.isCompactAndNotPanel
Behavior on opacity{
NumberAnimation{
duration: 220
duration: 83
}
}
hoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
@ -774,7 +800,7 @@ Item {
property: "opacity"
from:0
to:1
duration: 150
duration: 83
}
}
background: Rectangle{

View File

@ -7,6 +7,7 @@ Item {
id:control
default property alias content: d.children
property alias currentIndex: nav_list.currentIndex
property color normalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120
property color hoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black

View File

@ -99,39 +99,46 @@ Rectangle {
text:"AM/PM"
}
Popup{
Menu{
id:popup
width: 300
height: 340
width: container.width
height: container.height
modal: true
dim:false
enter: Transition {
reversible: true
NumberAnimation {
property: "opacity"
from:0
to:1
duration: 150
duration: 83
}
}
exit:Transition {
NumberAnimation {
property: "y"
from:0
to:popup.y
duration: 150
property: "opacity"
from:1
to:0
duration: 83
}
}
background:Item{}
contentItem: Rectangle{
background:Item{
FluShadow{
radius: 4
}
}
contentItem: Item{
clip: true
Rectangle{
id:container
anchors.fill: parent
height: 340
width: 300
radius: 4
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
MouseArea{
anchors.fill: parent
}
FluShadow{
radius: 4
}
RowLayout{
id:layout_content
spacing: 0
@ -333,9 +340,8 @@ Rectangle {
popup.close()
}
}
}
}
}
y:35
function showPopup() {
@ -373,12 +379,12 @@ Rectangle {
}
var pos = root.mapToItem(null, 0, 0)
if(window.height>pos.y+root.height+popup.height){
if(window.height>pos.y+root.height+container.height){
popup.y = root.height
} else if(pos.y>popup.height){
popup.y = -popup.height
} else if(pos.y>container.height){
popup.y = -container.height
} else {
popup.y = window.height-(pos.y+popup.height)
popup.y = window.height-(pos.y+container.height)
}
popup.open()
}

View File

@ -72,16 +72,32 @@ FluControl {
anchors.verticalCenter: parent.verticalCenter
color: selected ? "#FFFFFF" : "#666666"
Behavior on anchors.leftMargin {
NumberAnimation { duration: 150 }
NumberAnimation {
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 1, 0, 0, 0 ]
}
}
Behavior on anchors.rightMargin {
NumberAnimation { duration: 150 }
NumberAnimation {
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 1, 0, 0, 0 ]
}
}
Behavior on width {
NumberAnimation { duration: 150 }
NumberAnimation {
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 1, 0, 0, 0 ]
}
}
Behavior on scale {
NumberAnimation { duration: 150 }
NumberAnimation {
duration: 167
easing.type: Easing.Bezier
easing.bezierCurve: [ 1, 0, 0, 0 ]
}
}
}
}

View File

@ -51,7 +51,7 @@ ApplicationWindow {
onClosing:
(event)=>{
if(closeDestory){
helper.destoryWindow()
destoryWindow()
}else{
visible = false
event.accepted = false
@ -94,6 +94,10 @@ ApplicationWindow {
return helper.createRegister(window,path)
}
function destoryWindow(){
helper.destoryWindow()
}
function onResult(data){
if(pageRegister){
pageRegister.onResult(data)