mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-27 05:38:37 +08:00
update
This commit is contained in:
parent
2acb3c34bd
commit
cd984fddf5
@ -63,14 +63,14 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegist
|
|||||||
}
|
}
|
||||||
properties.insert("argument",argument);
|
properties.insert("argument",argument);
|
||||||
QQuickWindow *view = qobject_cast<QQuickWindow*>(component.createWithInitialProperties(properties));
|
QQuickWindow *view = qobject_cast<QQuickWindow*>(component.createWithInitialProperties(properties));
|
||||||
|
if(FluTheme::getInstance()->frameless()){
|
||||||
|
view->setFlag(Qt::FramelessWindowHint,true);
|
||||||
|
}
|
||||||
wnds.insert(view->winId(),view);
|
wnds.insert(view->winId(),view);
|
||||||
if(fluRegister){
|
if(fluRegister){
|
||||||
fluRegister->to(view);
|
fluRegister->to(view);
|
||||||
}
|
}
|
||||||
view->setColor(QColor(Qt::transparent));
|
view->setColor(QColor(Qt::transparent));
|
||||||
if(view->maximumWidth()==view->minimumWidth()&&view->maximumHeight()==view->minimumHeight()){
|
|
||||||
view->resize(view->minimumSize());
|
|
||||||
}
|
|
||||||
view->show();
|
view->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,16 +23,24 @@ WindowHelper::WindowHelper(QObject *parent)
|
|||||||
|
|
||||||
void WindowHelper::initWindow(QQuickWindow* window){
|
void WindowHelper::initWindow(QQuickWindow* window){
|
||||||
this->window = window;
|
this->window = window;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowHelper::firstUpdate(){
|
||||||
|
if(isFisrt){
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
if(FluTheme::getInstance()->frameless()){
|
if(FluTheme::getInstance()->frameless()){
|
||||||
HWND wnd = (HWND)window->winId();
|
HWND wnd = (HWND)window->winId();
|
||||||
SetWindowLongPtr(wnd, GWL_STYLE, static_cast<LONG>(Style::aero_borderless));
|
SetWindowLongPtr(wnd, GWL_STYLE, static_cast<LONG>(Style::aero_borderless));
|
||||||
const MARGINS shadow_on = { 1, 1, 1, 1 };
|
const MARGINS shadow_on = { 1, 1, 1, 1 };
|
||||||
DwmExtendFrameIntoClientArea(wnd, &shadow_on);
|
DwmExtendFrameIntoClientArea(wnd, &shadow_on);
|
||||||
SetWindowPos(wnd, Q_NULLPTR, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE);
|
SetWindowPos(wnd, Q_NULLPTR, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE);
|
||||||
ShowWindow(wnd, SW_SHOW);
|
ShowWindow(wnd, SW_SHOW);
|
||||||
}
|
window->setFlag(Qt::FramelessWindowHint,false);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
isFisrt = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant WindowHelper::createRegister(const QString& path){
|
QVariant WindowHelper::createRegister(const QString& path){
|
||||||
|
@ -18,8 +18,11 @@ public:
|
|||||||
Q_INVOKABLE void destoryWindow();
|
Q_INVOKABLE void destoryWindow();
|
||||||
Q_INVOKABLE QVariant createRegister(const QString& path);
|
Q_INVOKABLE QVariant createRegister(const QString& path);
|
||||||
|
|
||||||
|
Q_INVOKABLE void firstUpdate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QQuickWindow* window;
|
QQuickWindow* window;
|
||||||
|
bool isFisrt=true;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WINDOWHELPER_H
|
#endif // WINDOWHELPER_H
|
||||||
|
@ -32,6 +32,12 @@ ApplicationWindow {
|
|||||||
clip: true
|
clip: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onActiveChanged: {
|
||||||
|
if(active){
|
||||||
|
helper.firstUpdate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onClosing:
|
onClosing:
|
||||||
(event)=>{
|
(event)=>{
|
||||||
//销毁窗口,释放资源
|
//销毁窗口,释放资源
|
||||||
|
Loading…
Reference in New Issue
Block a user