Compare commits

..

2 Commits

13 changed files with 40 additions and 34 deletions

View File

@ -28,7 +28,7 @@ jobs:
targetName: RibbonUI-APP targetName: RibbonUI-APP
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
@ -40,7 +40,7 @@ jobs:
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats' modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- name: Set up Ninja - name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@v3 uses: seanmiddleditch/gha-setup-ninja@v4
with: with:
version: 1.10.2 version: 1.10.2
@ -59,7 +59,7 @@ jobs:
# 拷贝依赖 # 拷贝依赖
sudo macdeployqt /Users/runner/work/RibbonUI/RibbonUI/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg sudo macdeployqt /Users/runner/work/RibbonUI/RibbonUI/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v4
with: with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.zip name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.zip
path: /Users/runner/work/RibbonUI/RibbonUI/build/app/release/${{ env.targetName }}.dmg path: /Users/runner/work/RibbonUI/RibbonUI/build/app/release/${{ env.targetName }}.dmg

View File

@ -28,7 +28,7 @@ jobs:
targetName: RibbonUI-APP targetName: RibbonUI-APP
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
@ -40,7 +40,7 @@ jobs:
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats' modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- name: Set up Ninja - name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@v3 uses: seanmiddleditch/gha-setup-ninja@v4
with: with:
version: 1.10.2 version: 1.10.2
@ -59,7 +59,7 @@ jobs:
# 拷贝依赖 # 拷贝依赖
sudo macdeployqt /Users/runner/work/RibbonUI/RibbonUI/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg sudo macdeployqt /Users/runner/work/RibbonUI/RibbonUI/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v4
with: with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_static.zip name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_static.zip
path: /Users/runner/work/RibbonUI/RibbonUI/build/app/release/${{ env.targetName }}.dmg path: /Users/runner/work/RibbonUI/RibbonUI/build/app/release/${{ env.targetName }}.dmg

View File

@ -29,7 +29,7 @@ jobs:
targetName: RibbonUI-APP targetName: RibbonUI-APP
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
@ -41,7 +41,7 @@ jobs:
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats' modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- name: Set up Ninja - name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@v3 uses: seanmiddleditch/gha-setup-ninja@v4
with: with:
version: 1.10.2 version: 1.10.2
@ -76,7 +76,7 @@ jobs:
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/RibbonUI/RibbonUI/build/app/release/${targetName} --appdir /home/runner/work/RibbonUI/RibbonUI/build/app/release/ linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/RibbonUI/RibbonUI/build/app/release/${targetName} --appdir /home/runner/work/RibbonUI/RibbonUI/build/app/release/
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v4
with: with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared
path: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage path: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage

View File

@ -29,7 +29,7 @@ jobs:
targetName: RibbonUI-APP targetName: RibbonUI-APP
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
@ -41,7 +41,7 @@ jobs:
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats' modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- name: Set up Ninja - name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@v3 uses: seanmiddleditch/gha-setup-ninja@v4
with: with:
version: 1.10.2 version: 1.10.2
@ -76,7 +76,7 @@ jobs:
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/RibbonUI/RibbonUI/build/app/release/${targetName} --appdir /home/runner/work/RibbonUI/RibbonUI/build/app/release/ linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/RibbonUI/RibbonUI/build/app/release/${targetName} --appdir /home/runner/work/RibbonUI/RibbonUI/build/app/release/
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v4
with: with:
name: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static name: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static
path: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage path: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage

View File

@ -31,12 +31,12 @@ jobs:
fileName: RibbonUI-APP fileName: RibbonUI-APP
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Setup ninja - name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@master uses: seanmiddleditch/gha-setup-ninja@v4
with: with:
version: 1.10.2 version: 1.10.2
@ -79,7 +79,7 @@ jobs:
$name = ${env:archiveName} $name = ${env:archiveName}
echo "packageName=$name" >> $env:GITHUB_OUTPUT echo "packageName=$name" >> $env:GITHUB_OUTPUT
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v4
with: with:
name: ${{ steps.package.outputs.packageName }} name: ${{ steps.package.outputs.packageName }}
path: ${{ steps.package.outputs.packageName }} path: ${{ steps.package.outputs.packageName }}

View File

@ -31,12 +31,12 @@ jobs:
fileName: RibbonUI-APP fileName: RibbonUI-APP
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Setup ninja - name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@master uses: seanmiddleditch/gha-setup-ninja@v4
with: with:
version: 1.10.2 version: 1.10.2
@ -79,7 +79,7 @@ jobs:
$name = ${env:archiveName} $name = ${env:archiveName}
echo "packageName=$name" >> $env:GITHUB_OUTPUT echo "packageName=$name" >> $env:GITHUB_OUTPUT
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v4
with: with:
name: ${{ steps.package.outputs.packageName }} name: ${{ steps.package.outputs.packageName }}
path: ${{ steps.package.outputs.packageName }} path: ${{ steps.package.outputs.packageName }}

View File

@ -32,12 +32,12 @@ jobs:
fileName: RibbonUI-APP fileName: RibbonUI-APP
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Setup ninja - name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@master uses: seanmiddleditch/gha-setup-ninja@v4
with: with:
version: 1.10.2 version: 1.10.2
@ -73,7 +73,7 @@ jobs:
$name = ${env:archiveName} $name = ${env:archiveName}
echo "packageName=$name" >> $env:GITHUB_OUTPUT echo "packageName=$name" >> $env:GITHUB_OUTPUT
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v4
with: with:
name: ${{ steps.package.outputs.packageName }} name: ${{ steps.package.outputs.packageName }}
path: ${{ steps.package.outputs.packageName }} path: ${{ steps.package.outputs.packageName }}

View File

@ -32,12 +32,12 @@ jobs:
fileName: RibbonUI-APP fileName: RibbonUI-APP
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Setup ninja - name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@master uses: seanmiddleditch/gha-setup-ninja@v4
with: with:
version: 1.10.2 version: 1.10.2
@ -73,7 +73,7 @@ jobs:
$name = ${env:archiveName} $name = ${env:archiveName}
echo "packageName=$name" >> $env:GITHUB_OUTPUT echo "packageName=$name" >> $env:GITHUB_OUTPUT
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v4
with: with:
name: ${{ steps.package.outputs.packageName }} name: ${{ steps.package.outputs.packageName }}
path: ${{ steps.package.outputs.packageName }} path: ${{ steps.package.outputs.packageName }}

View File

@ -21,7 +21,7 @@ BEGIN
BEGIN BEGIN
VALUE "Comments", "Made by Mentalflow." VALUE "Comments", "Made by Mentalflow."
VALUE "CompanyName", "${PROJECT_COMPANY}" VALUE "CompanyName", "${PROJECT_COMPANY}"
VALUE "FileDescription", "${PROJECT_COPYRIGHT}" VALUE "FileDescription", "${PROJECT_BUNDLE_NAME}"
VALUE "FileVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}" VALUE "FileVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
VALUE "InternalName", "${PROJECT_BUNDLE_NAME}.exe" VALUE "InternalName", "${PROJECT_BUNDLE_NAME}.exe"
VALUE "LegalCopyright", "${PROJECT_COPYRIGHT}" VALUE "LegalCopyright", "${PROJECT_COPYRIGHT}"

View File

@ -7,8 +7,7 @@ RibbonWindow {
id: window id: window
width: Math.max(content.width, content.height + title_bar.height, title_bar.minimumWidth) + content.anchors.margins * 2 width: Math.max(content.width, content.height + title_bar.height, title_bar.minimumWidth) + content.anchors.margins * 2
minimumWidth: title_bar.minimumWidth minimumWidth: title_bar.minimumWidth
minimumHeight: content.height + title_bar.height minimumHeight: content.height + title_bar.height + content.anchors.margins * 2
height: width
title: qsTr("About") title: qsTr("About")
title_bar.show_darkmode_btn: false title_bar.show_darkmode_btn: false
title_bar.show_style_switch: false title_bar.show_style_switch: false

View File

@ -21,6 +21,9 @@ if(APPLE)
endif() endif()
if (RIBBONUI_BUILD_QWINDOWKIT) if (RIBBONUI_BUILD_QWINDOWKIT)
if(WIN32)
set(QWINDOWKIT_ENABLE_WINDOWS_SYSTEM_BORDERS OFF)
endif()
set(QWINDOWKIT_BUILD_STATIC ON) set(QWINDOWKIT_BUILD_STATIC ON)
set(QWINDOWKIT_BUILD_EXAMPLES OFF) set(QWINDOWKIT_BUILD_EXAMPLES OFF)
set(QWINDOWKIT_BUILD_QUICK ON) set(QWINDOWKIT_BUILD_QUICK ON)

View File

@ -16,7 +16,7 @@ Window {
property alias title_bar: titleBar property alias title_bar: titleBar
property alias popup: pop property alias popup: pop
property bool comfirmed_quit: false property bool comfirmed_quit: false
property bool blurBehindWindow: false property bool blurBehindWindow: true
visible: false visible: false
color: { color: {
if (blurBehindWindow) { if (blurBehindWindow) {
@ -29,7 +29,7 @@ Window {
} }
onBlurBehindWindowChanged: { onBlurBehindWindowChanged: {
if (Qt.platform.os === 'windows') if (Qt.platform.os === 'windows')
windowAgent.setWindowAttribute("acrylic-material", blurBehindWindow) windowAgent.setWindowAttribute("mica", blurBehindWindow)
else if (Qt.platform.os === 'osx') else if (Qt.platform.os === 'osx')
windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.dark_mode ? "dark" : "light" : "none") windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.dark_mode ? "dark" : "light" : "none")
} }
@ -38,22 +38,23 @@ Window {
windowAgent.setup(window) windowAgent.setup(window)
if (Qt.platform.os === 'windows') if (Qt.platform.os === 'windows')
{ {
windowAgent.setWindowAttribute("acrylic-material", blurBehindWindow) windowAgent.setWindowAttribute("mica", blurBehindWindow)
windowAgent.setSystemButton(WindowAgent.Minimize, titleBar.minimizeBtn); windowAgent.setSystemButton(WindowAgent.Minimize, titleBar.minimizeBtn);
windowAgent.setSystemButton(WindowAgent.Maximize, titleBar.maximizeBtn); windowAgent.setSystemButton(WindowAgent.Maximize, titleBar.maximizeBtn);
windowAgent.setSystemButton(WindowAgent.Close, titleBar.closeBtn); windowAgent.setSystemButton(WindowAgent.Close, titleBar.closeBtn);
} }
if(Qt.platform.os === "osx") if(Qt.platform.os === "osx")
{ {
blurBehindWindow = true
windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.dark_mode ? "dark" : "light" : "none") windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.dark_mode ? "dark" : "light" : "none")
PlatformSupport.showSystemTitleBtns(window, true) PlatformSupport.showSystemTitleBtns(window, true)
} }
windowAgent.setHitTestVisible(titleBar.left_container) windowAgent.setHitTestVisible(titleBar.left_container)
windowAgent.setHitTestVisible(titleBar.right_container) windowAgent.setHitTestVisible(titleBar.right_container)
windowAgent.setTitleBar(titleBar); windowAgent.setTitleBar(titleBar)
windowAgent.centralize() windowAgent.centralize()
window.visible = true; window.flags ^= Qt.WA_AlwaysShowToolTips // It's a trick for Windows
window.visible = true
window.flags ^= Qt.WA_AlwaysShowToolTips // It's a trick for Windows
} }
Item{ Item{
id: window_items id: window_items
@ -98,7 +99,7 @@ Window {
color: 'transparent' color: 'transparent'
border.color: RibbonTheme.dark_mode ? "#7A7A7A" : "#2C59B7" border.color: RibbonTheme.dark_mode ? "#7A7A7A" : "#2C59B7"
border.width: RibbonTheme.modern_style ? 1 : 0 border.width: RibbonTheme.modern_style ? 1 : 0
radius: Qt.platform.os === 'windows' ? 8 : 10 radius: Qt.platform.os === 'windows' ? 7 : 10
visible: RibbonTheme.modern_style visible: RibbonTheme.modern_style
} }
RibbonPopup{ RibbonPopup{

View File

@ -32,6 +32,9 @@ void RibbonUI::init()
qputenv("QT_QUICK_CONTROLS_STYLE", "Basic"); qputenv("QT_QUICK_CONTROLS_STYLE", "Basic");
#else #else
qputenv("QT_QUICK_CONTROLS_STYLE", "Default"); qputenv("QT_QUICK_CONTROLS_STYLE", "Default");
#endif
#ifdef Q_OS_WIN
qputenv("QSG_RHI_BACKEND", "opengl");
#endif #endif
QQuickWindow::setDefaultAlphaBuffer(true); QQuickWindow::setDefaultAlphaBuffer(true);
} }