This commit is contained in:
朱子楚\zhuzi 2024-03-19 12:50:16 +08:00
parent 72cf0311c0
commit 89c183afd5
7 changed files with 60 additions and 59 deletions

View File

@ -535,104 +535,104 @@
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="321"/> <location filename="qml/window/MainWindow.qml" line="322"/>
<source>Dark Mode</source> <source>Dark Mode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="97"/> <location filename="qml/window/MainWindow.qml" line="98"/>
<location filename="qml/window/MainWindow.qml" line="105"/> <location filename="qml/window/MainWindow.qml" line="106"/>
<source>Quit</source> <source>Quit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="98"/> <location filename="qml/window/MainWindow.qml" line="99"/>
<source>Are you sure you want to exit the program?</source> <source>Are you sure you want to exit the program?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="99"/> <location filename="qml/window/MainWindow.qml" line="100"/>
<source>Minimize</source> <source>Minimize</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="102"/> <location filename="qml/window/MainWindow.qml" line="103"/>
<source>Friendly Reminder</source> <source>Friendly Reminder</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="102"/> <location filename="qml/window/MainWindow.qml" line="103"/>
<source>FluentUI is hidden from the tray, click on the tray to activate the window again</source> <source>FluentUI is hidden from the tray, click on the tray to activate the window again</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="106"/> <location filename="qml/window/MainWindow.qml" line="107"/>
<location filename="qml/window/MainWindow.qml" line="350"/> <location filename="qml/window/MainWindow.qml" line="351"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="117"/> <location filename="qml/window/MainWindow.qml" line="118"/>
<source>Open in Separate Window</source> <source>Open in Separate Window</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="214"/> <location filename="qml/window/MainWindow.qml" line="215"/>
<source>Click Time</source> <source>Click Time</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="224"/> <location filename="qml/window/MainWindow.qml" line="225"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="315"/> <location filename="qml/window/MainWindow.qml" line="316"/>
<source>Finish</source> <source>Finish</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="316"/> <location filename="qml/window/MainWindow.qml" line="317"/>
<source>Next</source> <source>Next</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="317"/> <location filename="qml/window/MainWindow.qml" line="318"/>
<source>Previous</source> <source>Previous</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="321"/> <location filename="qml/window/MainWindow.qml" line="322"/>
<source>Here you can switch to night mode.</source> <source>Here you can switch to night mode.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="323"/> <location filename="qml/window/MainWindow.qml" line="324"/>
<source>Hide Easter eggs</source> <source>Hide Easter eggs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="323"/> <location filename="qml/window/MainWindow.qml" line="324"/>
<source>Try a few more clicks!!</source> <source>Try a few more clicks!!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="347"/> <location filename="qml/window/MainWindow.qml" line="348"/>
<source>Upgrade Tips</source> <source>Upgrade Tips</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="348"/> <location filename="qml/window/MainWindow.qml" line="349"/>
<source>FluentUI is currently up to date </source> <source>FluentUI is currently up to date </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="348"/> <location filename="qml/window/MainWindow.qml" line="349"/>
<source> -- The current app version</source> <source> -- The current app version</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="348"/> <location filename="qml/window/MainWindow.qml" line="349"/>
<source> <source>
Now go and download the new version Now go and download the new version
@ -641,17 +641,17 @@ Updated content:
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="351"/> <location filename="qml/window/MainWindow.qml" line="352"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="378"/> <location filename="qml/window/MainWindow.qml" line="379"/>
<source>The current version is already the latest</source> <source>The current version is already the latest</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="385"/> <location filename="qml/window/MainWindow.qml" line="386"/>
<source>The network is abnormal</source> <source>The network is abnormal</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -535,104 +535,104 @@
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="321"/> <location filename="qml/window/MainWindow.qml" line="322"/>
<source>Dark Mode</source> <source>Dark Mode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="97"/> <location filename="qml/window/MainWindow.qml" line="98"/>
<location filename="qml/window/MainWindow.qml" line="105"/> <location filename="qml/window/MainWindow.qml" line="106"/>
<source>Quit</source> <source>Quit</source>
<translation type="unfinished">退</translation> <translation type="unfinished">退</translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="98"/> <location filename="qml/window/MainWindow.qml" line="99"/>
<source>Are you sure you want to exit the program?</source> <source>Are you sure you want to exit the program?</source>
<translation type="unfinished">退</translation> <translation type="unfinished">退</translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="99"/> <location filename="qml/window/MainWindow.qml" line="100"/>
<source>Minimize</source> <source>Minimize</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="102"/> <location filename="qml/window/MainWindow.qml" line="103"/>
<source>Friendly Reminder</source> <source>Friendly Reminder</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="102"/> <location filename="qml/window/MainWindow.qml" line="103"/>
<source>FluentUI is hidden from the tray, click on the tray to activate the window again</source> <source>FluentUI is hidden from the tray, click on the tray to activate the window again</source>
<translation type="unfinished">FluentUI </translation> <translation type="unfinished">FluentUI </translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="106"/> <location filename="qml/window/MainWindow.qml" line="107"/>
<location filename="qml/window/MainWindow.qml" line="350"/> <location filename="qml/window/MainWindow.qml" line="351"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="117"/> <location filename="qml/window/MainWindow.qml" line="118"/>
<source>Open in Separate Window</source> <source>Open in Separate Window</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="214"/> <location filename="qml/window/MainWindow.qml" line="215"/>
<source>Click Time</source> <source>Click Time</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="224"/> <location filename="qml/window/MainWindow.qml" line="225"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="315"/> <location filename="qml/window/MainWindow.qml" line="316"/>
<source>Finish</source> <source>Finish</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="316"/> <location filename="qml/window/MainWindow.qml" line="317"/>
<source>Next</source> <source>Next</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="317"/> <location filename="qml/window/MainWindow.qml" line="318"/>
<source>Previous</source> <source>Previous</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="321"/> <location filename="qml/window/MainWindow.qml" line="322"/>
<source>Here you can switch to night mode.</source> <source>Here you can switch to night mode.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="323"/> <location filename="qml/window/MainWindow.qml" line="324"/>
<source>Hide Easter eggs</source> <source>Hide Easter eggs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="323"/> <location filename="qml/window/MainWindow.qml" line="324"/>
<source>Try a few more clicks!!</source> <source>Try a few more clicks!!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="347"/> <location filename="qml/window/MainWindow.qml" line="348"/>
<source>Upgrade Tips</source> <source>Upgrade Tips</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="348"/> <location filename="qml/window/MainWindow.qml" line="349"/>
<source>FluentUI is currently up to date </source> <source>FluentUI is currently up to date </source>
<translation type="unfinished">FluentUI </translation> <translation type="unfinished">FluentUI </translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="348"/> <location filename="qml/window/MainWindow.qml" line="349"/>
<source> -- The current app version</source> <source> -- The current app version</source>
<translation type="unfinished"> -- </translation> <translation type="unfinished"> -- </translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="348"/> <location filename="qml/window/MainWindow.qml" line="349"/>
<source> <source>
Now go and download the new version Now go and download the new version
@ -645,17 +645,17 @@ Updated content:
</translation> </translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="351"/> <location filename="qml/window/MainWindow.qml" line="352"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="378"/> <location filename="qml/window/MainWindow.qml" line="379"/>
<source>The current version is already the latest</source> <source>The current version is already the latest</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="385"/> <location filename="qml/window/MainWindow.qml" line="386"/>
<source>The network is abnormal</source> <source>The network is abnormal</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -21,6 +21,7 @@ FluWindow {
launchMode: FluWindowType.SingleTask launchMode: FluWindowType.SingleTask
fitsAppBarWindows: true fitsAppBarWindows: true
appBar: FluAppBar { appBar: FluAppBar {
width: window.width
height: 30 height: 30
showDark: true showDark: true
darkClickListener:(button)=>handleDarkChanged(button) darkClickListener:(button)=>handleDarkChanged(button)

View File

@ -76,7 +76,6 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluWindow
if(windowRegister){ if(windowRegister){
windowRegister->to(win); windowRegister->to(win);
} }
win->setColor(QColor(Qt::transparent));
} }
void FluApp::exit(int retCode){ void FluApp::exit(int retCode){

View File

@ -340,7 +340,13 @@ void FluFramelessHelper::componentComplete(){
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME); ::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME);
}else{ }else{
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME); ::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME);
for (int i = 0; i < qApp->screens().count(); ++i) {
connect( qApp->screens().at(i),&QScreen::logicalDotsPerInchChanged,this,[=]{
SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED);
});
} }
}
SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
#else #else
window->setFlags((window->flags() & (~Qt::WindowMinMaxButtonsHint) & (~Qt::Dialog)) | Qt::FramelessWindowHint | Qt::Window); window->setFlags((window->flags() & (~Qt::WindowMinMaxButtonsHint) & (~Qt::Dialog)) | Qt::FramelessWindowHint | Qt::Window);
window->installEventFilter(this); window->installEventFilter(this);
@ -351,8 +357,7 @@ void FluFramelessHelper::componentComplete(){
window->setMaximumSize(QSize(w,h)); window->setMaximumSize(QSize(w,h));
window->setMinimumSize(QSize(w,h)); window->setMinimumSize(QSize(w,h));
} }
window->setWidth(w); window->resize(QSize(w,h));
window->setHeight(h);
_onStayTopChange(); _onStayTopChange();
_stayTop.connectNotifySignal(this,SLOT(_onStayTopChange())); _stayTop.connectNotifySignal(this,SLOT(_onStayTopChange()));
_screen.connectNotifySignal(this,SLOT(_onScreenChanged())); _screen.connectNotifySignal(this,SLOT(_onScreenChanged()));

View File

@ -16,6 +16,7 @@ Window {
property Item appBar: FluAppBar { property Item appBar: FluAppBar {
title: window.title title: window.title
height: 30 height: 30
width: window.width
showDark: window.showDark showDark: window.showDark
showClose: window.showClose showClose: window.showClose
showMinimize: window.showMinimize showMinimize: window.showMinimize
@ -101,9 +102,6 @@ Window {
} }
lifecycle.onVisible(visible) lifecycle.onVisible(visible)
} }
onWidthChanged: {
window.appBar.width = width
}
QtObject{ QtObject{
id:d id:d
property bool isFirstVisible: true property bool isFirstVisible: true

View File

@ -15,6 +15,7 @@ Window {
property Item appBar: FluAppBar { property Item appBar: FluAppBar {
title: window.title title: window.title
height: 30 height: 30
width: window.width
showDark: window.showDark showDark: window.showDark
showClose: window.showClose showClose: window.showClose
showMinimize: window.showMinimize showMinimize: window.showMinimize
@ -100,9 +101,6 @@ Window {
} }
lifecycle.onVisible(visible) lifecycle.onVisible(visible)
} }
onWidthChanged: {
window.appBar.width = width
}
QtObject{ QtObject{
id:d id:d
property bool isFirstVisible: true property bool isFirstVisible: true