main
朱子楚\zhuzi 2023-03-09 13:23:39 +08:00
parent 88b15b92ea
commit f4cebb5c14
5 changed files with 27 additions and 6 deletions

View File

@ -66,7 +66,7 @@ jobs:
- name: package
id: package
env:
archiveName: ${{ matrix.qt_ver }}-${{ env.fileName }}-${{ matrix.qt_arch }}
archiveName: ${{ env.fileName }}-${{ matrix.qt_ver }}-${{ matrix.qt_arch }}
shell: pwsh
run: |
& scripts\windows-mingw-publish.ps1 ${env:archiveName} ${env:targetName}

View File

@ -67,7 +67,7 @@ jobs:
- name: package
id: package
env:
archiveName: ${{ matrix.qt_ver }}-${{ env.fileName }}-${{ matrix.qt_arch }}
archiveName: ${{ env.fileName }}-${{ matrix.qt_ver }}-${{ matrix.qt_arch }}
msvcArch: ${{ matrix.msvc_arch }}
shell: pwsh
run: |

View File

@ -2,6 +2,7 @@
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QDir>
#include <QQuickWindow>
#include <QProcess>
QMap<QString, QVariant> properties(){
@ -16,6 +17,7 @@ int main(int argc, char *argv[])
QCoreApplication::setOrganizationDomain("https://zhuzichu520.github.io");
QCoreApplication::setApplicationName("FluentUI");
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
// QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
QMapIterator<QString, QVariant> iterator(properties());

View File

@ -16,6 +16,7 @@ public:
FramelessView::FramelessView(QWindow *parent) : Super(parent), d(new FramelessViewPrivate)
{
setResizeMode(SizeRootObjectToView);
refreshWindow();
setIsMax(windowState() == Qt::WindowMaximized);
setIsFull(windowState() == Qt::WindowFullScreen);
@ -35,8 +36,6 @@ void FramelessView::refreshWindow(){
}else{
setFlags(Qt::Window);
}
setResizeMode(SizeViewToRootObject);
setResizeMode(SizeRootObjectToView);
}
FramelessView::~FramelessView()
@ -123,6 +122,17 @@ bool FramelessView::nativeEvent(const QByteArray &eventType, void *message, qint
bool FramelessView::nativeEvent(const QByteArray &eventType, void *message, long *result)
#endif
{
MSG* msg = static_cast<MSG*>(message);
if (msg->message == WM_WINDOWPOSCHANGING)
{
WINDOWPOS* wp = reinterpret_cast<WINDOWPOS*>(msg->lParam);
if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0)
{
wp->flags |= SWP_NOCOPYBITS;
*result = 0;
return true;
}
}
return Super::nativeEvent(eventType, message, result);
}

View File

@ -18,14 +18,17 @@ Item {
property color borderNormalColor: FluTheme.isDark ? Qt.rgba(160/255,160/255,160/255,1) : Qt.rgba(136/255,136/255,136/255,1)
property color borderCheckedColor: FluTheme.isDark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
property color borderHoverColor: FluTheme.isDark ? Qt.rgba(167/255,167/255,167/255,1) : Qt.rgba(135/255,135/255,135/255,1)
property color borderDisableColor: FluTheme.isDark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
property color normalColor: FluTheme.isDark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(247/255,247/255,247/255,1)
property color checkedColor: FluTheme.isDark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
property color hoverColor: FluTheme.isDark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(244/255,244/255,244/255,1)
property color checkedHoverColor: FluTheme.isDark ? Qt.darker(checkedColor,1.1) : Qt.lighter(checkedColor,1.1)
property color checkedDisableColor: FluTheme.isDark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
property color disableColor: FluTheme.isDark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
RowLayout{
spacing: 4
Rectangle{
@ -33,6 +36,9 @@ Item {
height: 22
radius: 4
border.color: {
if(disabled){
return borderDisableColor
}
if(checked){
return borderCheckedColor
}
@ -44,6 +50,9 @@ Item {
border.width: 1
color: {
if(checked){
if(disabled){
return checkedDisableColor
}
if(hovered){
return checkedHoverColor
}