mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-23 11:17:15 +08:00
update
This commit is contained in:
parent
35d85aa801
commit
2f3ed2bd0f
@ -19,6 +19,9 @@ Item {
|
|||||||
function onVsyncChanged(){
|
function onVsyncChanged(){
|
||||||
SettingsHelper.saveVsync(FluApp.vsync)
|
SettingsHelper.saveVsync(FluApp.vsync)
|
||||||
}
|
}
|
||||||
|
function onUseSystemAppBarChanged(){
|
||||||
|
SettingsHelper.saveUseSystemAppBar(FluApp.useSystemAppBar)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluHttpInterceptor{
|
FluHttpInterceptor{
|
||||||
@ -39,6 +42,7 @@ Item {
|
|||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
FluApp.init(app)
|
FluApp.init(app)
|
||||||
|
FluApp.useSystemAppBar = SettingsHelper.getUseSystemAppBar()
|
||||||
FluApp.vsync = SettingsHelper.getVsync()
|
FluApp.vsync = SettingsHelper.getVsync()
|
||||||
FluTheme.darkMode = SettingsHelper.getDarkMode()
|
FluTheme.darkMode = SettingsHelper.getDarkMode()
|
||||||
FluTheme.enableAnimation = true
|
FluTheme.enableAnimation = true
|
||||||
|
@ -39,6 +39,7 @@ FluContentPage{
|
|||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
ScrollBar.vertical: FluScrollBar {}
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
contentHeight:layout_column.height
|
contentHeight:layout_column.height
|
||||||
Column{
|
Column{
|
||||||
|
@ -72,6 +72,22 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 50
|
||||||
|
paddings: 10
|
||||||
|
FluCheckBox{
|
||||||
|
text:"Use System AppBar"
|
||||||
|
checked: FluApp.useSystemAppBar
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onClicked: {
|
||||||
|
FluApp.useSystemAppBar = !FluApp.useSystemAppBar
|
||||||
|
dialog_restart.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -19,6 +19,9 @@ Item {
|
|||||||
function onVsyncChanged(){
|
function onVsyncChanged(){
|
||||||
SettingsHelper.saveVsync(FluApp.vsync)
|
SettingsHelper.saveVsync(FluApp.vsync)
|
||||||
}
|
}
|
||||||
|
function onUseSystemAppBarChanged(){
|
||||||
|
SettingsHelper.saveUseSystemAppBar(FluApp.useSystemAppBar)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluHttpInterceptor{
|
FluHttpInterceptor{
|
||||||
@ -39,6 +42,7 @@ Item {
|
|||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
FluApp.init(app)
|
FluApp.init(app)
|
||||||
|
FluApp.useSystemAppBar = SettingsHelper.getUseSystemAppBar()
|
||||||
FluApp.vsync = SettingsHelper.getVsync()
|
FluApp.vsync = SettingsHelper.getVsync()
|
||||||
FluTheme.darkMode = SettingsHelper.getDarkMode()
|
FluTheme.darkMode = SettingsHelper.getDarkMode()
|
||||||
FluTheme.enableAnimation = true
|
FluTheme.enableAnimation = true
|
||||||
|
@ -75,6 +75,21 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 50
|
||||||
|
paddings: 10
|
||||||
|
FluCheckBox{
|
||||||
|
text:"Use System AppBar"
|
||||||
|
checked: FluApp.useSystemAppBar
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onClicked: {
|
||||||
|
FluApp.useSystemAppBar = !FluApp.useSystemAppBar
|
||||||
|
dialog_restart.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -25,6 +25,8 @@ public:
|
|||||||
Q_INVOKABLE QVariant getDarkMode(){return get("darkMode",QVariant(0));}
|
Q_INVOKABLE QVariant getDarkMode(){return get("darkMode",QVariant(0));}
|
||||||
Q_INVOKABLE void saveVsync(bool vsync){save("vsync",vsync);}
|
Q_INVOKABLE void saveVsync(bool vsync){save("vsync",vsync);}
|
||||||
Q_INVOKABLE QVariant getVsync(){return get("vsync",QVariant(true));}
|
Q_INVOKABLE QVariant getVsync(){return get("vsync",QVariant(true));}
|
||||||
|
Q_INVOKABLE void saveUseSystemAppBar(bool useSystemAppBar){save("useSystemAppBar",useSystemAppBar);}
|
||||||
|
Q_INVOKABLE QVariant getUseSystemAppBar(){return get("useSystemAppBar",QVariant(false));}
|
||||||
private:
|
private:
|
||||||
void save(const QString& key,QVariant val);
|
void save(const QString& key,QVariant val);
|
||||||
QVariant get(const QString& key,QVariant def={});
|
QVariant get(const QString& key,QVariant def={});
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 694967e930d2dd9f15c5429674005cc0a4217060
|
Subproject commit 49c72fb4f85421f770a6a14657ba73a9912ee833
|
@ -14,8 +14,10 @@
|
|||||||
FRAMELESSHELPER_USE_NAMESPACE
|
FRAMELESSHELPER_USE_NAMESPACE
|
||||||
|
|
||||||
FluApp::FluApp(QObject *parent):QObject{parent}{
|
FluApp::FluApp(QObject *parent):QObject{parent}{
|
||||||
|
connect(this,&FluApp::useSystemAppBarChanged,this,[=]{FramelessConfig::instance()->set(Global::Option::UseSystemAppBar,_useSystemAppBar);});
|
||||||
vsync(true);
|
vsync(true);
|
||||||
httpInterceptor(nullptr);
|
httpInterceptor(nullptr);
|
||||||
|
useSystemAppBar(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
FluApp::~FluApp(){
|
FluApp::~FluApp(){
|
||||||
|
@ -23,6 +23,7 @@ class FluApp : public QObject
|
|||||||
Q_PROPERTY_AUTO(QString,initialRoute);
|
Q_PROPERTY_AUTO(QString,initialRoute);
|
||||||
Q_PROPERTY_AUTO(QJsonObject,routes);
|
Q_PROPERTY_AUTO(QJsonObject,routes);
|
||||||
Q_PROPERTY_AUTO(FluHttpInterceptor*,httpInterceptor);
|
Q_PROPERTY_AUTO(FluHttpInterceptor*,httpInterceptor);
|
||||||
|
Q_PROPERTY_AUTO(bool,useSystemAppBar);
|
||||||
QML_NAMED_ELEMENT(FluApp)
|
QML_NAMED_ELEMENT(FluApp)
|
||||||
QML_SINGLETON
|
QML_SINGLETON
|
||||||
private:
|
private:
|
||||||
|
@ -38,7 +38,7 @@ Window {
|
|||||||
property bool showMinimize: true
|
property bool showMinimize: true
|
||||||
property bool showMaximize: true
|
property bool showMaximize: true
|
||||||
property bool showStayTop: true
|
property bool showStayTop: true
|
||||||
property bool useSystemAppBar: false
|
property bool useSystemAppBar
|
||||||
property var closeListener: function(event){
|
property var closeListener: function(event){
|
||||||
if(closeDestory){
|
if(closeDestory){
|
||||||
destoryOnClose()
|
destoryOnClose()
|
||||||
@ -58,6 +58,7 @@ Window {
|
|||||||
d.changedStayTop()
|
d.changedStayTop()
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
useSystemAppBar = FluApp.useSystemAppBar
|
||||||
lifecycle.onCompleted(window)
|
lifecycle.onCompleted(window)
|
||||||
initArgument(argument)
|
initArgument(argument)
|
||||||
d.changedStayTop()
|
d.changedStayTop()
|
||||||
|
@ -37,7 +37,7 @@ Window {
|
|||||||
property bool showMinimize: true
|
property bool showMinimize: true
|
||||||
property bool showMaximize: true
|
property bool showMaximize: true
|
||||||
property bool showStayTop: true
|
property bool showStayTop: true
|
||||||
property bool useSystemAppBar: false
|
property bool useSystemAppBar
|
||||||
property var closeListener: function(event){
|
property var closeListener: function(event){
|
||||||
if(closeDestory){
|
if(closeDestory){
|
||||||
destoryOnClose()
|
destoryOnClose()
|
||||||
@ -57,6 +57,7 @@ Window {
|
|||||||
d.changedStayTop()
|
d.changedStayTop()
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
useSystemAppBar = FluApp.useSystemAppBar
|
||||||
lifecycle.onCompleted(window)
|
lifecycle.onCompleted(window)
|
||||||
initArgument(argument)
|
initArgument(argument)
|
||||||
d.changedStayTop()
|
d.changedStayTop()
|
||||||
|
Loading…
Reference in New Issue
Block a user