mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-02-02 19:27:38 +08:00
update
This commit is contained in:
parent
661529f1f4
commit
35921ed900
@ -26,14 +26,6 @@ void FluApp::init(QObject *application){
|
|||||||
FramelessHelper::Quick::initialize();
|
FramelessHelper::Quick::initialize();
|
||||||
FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
|
FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
|
||||||
FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
|
FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
|
||||||
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur);
|
|
||||||
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow,false);
|
|
||||||
#endif
|
|
||||||
#ifdef Q_OS_MACOS
|
|
||||||
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur,false);
|
|
||||||
#endif
|
|
||||||
QQmlEngine *engine = qmlEngine(_application);
|
QQmlEngine *engine = qmlEngine(_application);
|
||||||
FramelessHelper::Quick::registerTypes(engine);
|
FramelessHelper::Quick::registerTypes(engine);
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,20 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QtQml/qqml.h>
|
#include <QtQml/qqml.h>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QJsonValue>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
class HttpRequest : public QObject{
|
class HttpRequest : public QObject{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY_AUTO(QString,url);
|
Q_PROPERTY_AUTO(QString,url);
|
||||||
|
# if (QT_VERSION == QT_VERSION_CHECK(6, 4, 3))
|
||||||
|
Q_PROPERTY_AUTO(QJsonValue,params);
|
||||||
|
Q_PROPERTY_AUTO(QJsonValue,headers);
|
||||||
|
# else
|
||||||
Q_PROPERTY_AUTO(QVariant,params);
|
Q_PROPERTY_AUTO(QVariant,params);
|
||||||
Q_PROPERTY_AUTO(QVariant,headers);
|
Q_PROPERTY_AUTO(QVariant,headers);
|
||||||
|
# endif
|
||||||
Q_PROPERTY_AUTO(QString,method);
|
Q_PROPERTY_AUTO(QString,method);
|
||||||
Q_PROPERTY_AUTO(QString,downloadSavePath);
|
Q_PROPERTY_AUTO(QString,downloadSavePath);
|
||||||
QML_NAMED_ELEMENT(HttpRequest)
|
QML_NAMED_ELEMENT(HttpRequest)
|
||||||
|
@ -35,10 +35,9 @@ TextArea{
|
|||||||
return placeholderNormalColor
|
return placeholderNormalColor
|
||||||
}
|
}
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
width: background.implicitWidth
|
width: 240
|
||||||
background: FluTextBoxBackground{
|
background: FluTextBoxBackground{
|
||||||
inputItem: control
|
inputItem: control
|
||||||
implicitWidth: 240
|
|
||||||
}
|
}
|
||||||
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
||||||
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
||||||
|
@ -37,9 +37,9 @@ TextField{
|
|||||||
return placeholderNormalColor
|
return placeholderNormalColor
|
||||||
}
|
}
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
|
width: 240
|
||||||
background: FluTextBoxBackground{
|
background: FluTextBoxBackground{
|
||||||
inputItem: control
|
inputItem: control
|
||||||
implicitWidth: 240
|
|
||||||
}
|
}
|
||||||
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
||||||
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
||||||
|
@ -46,9 +46,9 @@ TextField{
|
|||||||
w = 0
|
w = 0
|
||||||
return icon_end.visible ? w+36 : w+10
|
return icon_end.visible ? w+36 : w+10
|
||||||
}
|
}
|
||||||
|
width: 240
|
||||||
background: FluTextBoxBackground{
|
background: FluTextBoxBackground{
|
||||||
inputItem: control
|
inputItem: control
|
||||||
implicitWidth: 240
|
|
||||||
}
|
}
|
||||||
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
||||||
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
||||||
|
@ -46,8 +46,8 @@ Button {
|
|||||||
layoutDirection:control.textRight ? Qt.LeftToRight : Qt.RightToLeft
|
layoutDirection:control.textRight ? Qt.LeftToRight : Qt.RightToLeft
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id:control_backgound
|
id:control_backgound
|
||||||
width: background.width
|
implicitWidth: background.implicitWidth
|
||||||
height: background.height
|
implicitHeight: background.implicitHeight
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.activeFocus
|
visible: control.activeFocus
|
||||||
|
@ -38,7 +38,6 @@ Window {
|
|||||||
}
|
}
|
||||||
signal initArgument(var argument)
|
signal initArgument(var argument)
|
||||||
id:window
|
id:window
|
||||||
flags: Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
|
|
||||||
color:"transparent"
|
color:"transparent"
|
||||||
onStayTopChanged: {
|
onStayTopChanged: {
|
||||||
d.changedStayTop()
|
d.changedStayTop()
|
||||||
@ -201,6 +200,7 @@ Window {
|
|||||||
FramelessHelper{
|
FramelessHelper{
|
||||||
id:framless_helper
|
id:framless_helper
|
||||||
onReady: {
|
onReady: {
|
||||||
|
flags = flags | Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
|
||||||
if(appBar){
|
if(appBar){
|
||||||
var title_bar = loader_title_bar.item
|
var title_bar = loader_title_bar.item
|
||||||
setTitleBarItem(title_bar)
|
setTitleBarItem(title_bar)
|
||||||
@ -222,6 +222,19 @@ Window {
|
|||||||
}
|
}
|
||||||
WindowBorder{
|
WindowBorder{
|
||||||
z:999
|
z:999
|
||||||
|
visible: !FluTools.isLinux()
|
||||||
|
}
|
||||||
|
Rectangle{
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "#00000000"
|
||||||
|
border.width: 1
|
||||||
|
visible: FluTools.isLinux()
|
||||||
|
border.color: {
|
||||||
|
if(window.active){
|
||||||
|
return "#333333"
|
||||||
|
}
|
||||||
|
return "#999999"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function destoryOnClose(){
|
function destoryOnClose(){
|
||||||
lifecycle.onDestoryOnClose()
|
lifecycle.onDestoryOnClose()
|
||||||
|
@ -36,10 +36,9 @@ TextArea{
|
|||||||
return placeholderNormalColor
|
return placeholderNormalColor
|
||||||
}
|
}
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
width: background.implicitWidth
|
width: 240
|
||||||
background: FluTextBoxBackground{
|
background: FluTextBoxBackground{
|
||||||
inputItem: control
|
inputItem: control
|
||||||
implicitWidth: 240
|
|
||||||
}
|
}
|
||||||
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
||||||
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
||||||
|
@ -38,9 +38,9 @@ TextField{
|
|||||||
return placeholderNormalColor
|
return placeholderNormalColor
|
||||||
}
|
}
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
|
width: 240
|
||||||
background: FluTextBoxBackground{
|
background: FluTextBoxBackground{
|
||||||
inputItem: control
|
inputItem: control
|
||||||
implicitWidth: 240
|
|
||||||
}
|
}
|
||||||
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
||||||
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
||||||
|
@ -11,13 +11,6 @@ Popup {
|
|||||||
anchors.centerIn: Overlay.overlay
|
anchors.centerIn: Overlay.overlay
|
||||||
closePolicy: Popup.CloseOnEscape
|
closePolicy: Popup.CloseOnEscape
|
||||||
enter: Transition {
|
enter: Transition {
|
||||||
NumberAnimation {
|
|
||||||
properties: "scale"
|
|
||||||
from:1.2
|
|
||||||
to:1
|
|
||||||
duration: FluTheme.enableAnimation ? 83 : 0
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
duration: FluTheme.enableAnimation ? 83 : 0
|
duration: FluTheme.enableAnimation ? 83 : 0
|
||||||
@ -26,13 +19,6 @@ Popup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit:Transition {
|
exit:Transition {
|
||||||
NumberAnimation {
|
|
||||||
properties: "scale"
|
|
||||||
from:1
|
|
||||||
to:1.2
|
|
||||||
duration: FluTheme.enableAnimation ? 83 : 0
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
duration: FluTheme.enableAnimation ? 83 : 0
|
duration: FluTheme.enableAnimation ? 83 : 0
|
||||||
|
@ -47,9 +47,9 @@ TextField{
|
|||||||
w = 0
|
w = 0
|
||||||
return icon_end.visible ? w+36 : w+10
|
return icon_end.visible ? w+36 : w+10
|
||||||
}
|
}
|
||||||
|
width: 240
|
||||||
background: FluTextBoxBackground{
|
background: FluTextBoxBackground{
|
||||||
inputItem: control
|
inputItem: control
|
||||||
implicitWidth: 240
|
|
||||||
}
|
}
|
||||||
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
||||||
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
||||||
|
@ -47,8 +47,8 @@ Button {
|
|||||||
layoutDirection:control.textRight ? Qt.LeftToRight : Qt.RightToLeft
|
layoutDirection:control.textRight ? Qt.LeftToRight : Qt.RightToLeft
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id:control_backgound
|
id:control_backgound
|
||||||
width: background.width
|
implicitWidth: background.implicitWidth
|
||||||
height: background.height
|
implicitHeight: background.implicitHeight
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.activeFocus
|
visible: control.activeFocus
|
||||||
|
@ -37,7 +37,6 @@ Window {
|
|||||||
}
|
}
|
||||||
signal initArgument(var argument)
|
signal initArgument(var argument)
|
||||||
id:window
|
id:window
|
||||||
flags: Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
|
|
||||||
color:"transparent"
|
color:"transparent"
|
||||||
onStayTopChanged: {
|
onStayTopChanged: {
|
||||||
d.changedStayTop()
|
d.changedStayTop()
|
||||||
@ -200,6 +199,7 @@ Window {
|
|||||||
FramelessHelper{
|
FramelessHelper{
|
||||||
id:framless_helper
|
id:framless_helper
|
||||||
onReady: {
|
onReady: {
|
||||||
|
flags = flags | Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
|
||||||
if(appBar){
|
if(appBar){
|
||||||
var title_bar = loader_title_bar.item
|
var title_bar = loader_title_bar.item
|
||||||
setTitleBarItem(title_bar)
|
setTitleBarItem(title_bar)
|
||||||
@ -221,6 +221,19 @@ Window {
|
|||||||
}
|
}
|
||||||
WindowBorder{
|
WindowBorder{
|
||||||
z:999
|
z:999
|
||||||
|
visible: !FluTools.isLinux()
|
||||||
|
}
|
||||||
|
Rectangle{
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "#00000000"
|
||||||
|
border.width: 1
|
||||||
|
visible: FluTools.isLinux()
|
||||||
|
border.color: {
|
||||||
|
if(window.active){
|
||||||
|
return "#333333"
|
||||||
|
}
|
||||||
|
return "#999999"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function destoryOnClose(){
|
function destoryOnClose(){
|
||||||
lifecycle.onDestoryOnClose()
|
lifecycle.onDestoryOnClose()
|
||||||
|
Loading…
Reference in New Issue
Block a user