Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
856d2597df | ||
![]() |
44a0d75996 | ||
![]() |
62f6b7f3c5 | ||
![]() |
6150d327da | ||
![]() |
522ccfecc4 | ||
![]() |
4788ae4ccf | ||
![]() |
c3191e8f88 | ||
![]() |
4952c88b2e | ||
![]() |
ebd4489adf | ||
![]() |
d9aee037ad | ||
![]() |
87e87619fb | ||
![]() |
8494a714cd | ||
![]() |
3ec78f4c36 | ||
![]() |
a27485c021 |
4
.github/workflows/ci-linux.yml
vendored
@ -16,7 +16,7 @@ on:
|
|||||||
default: false
|
default: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
VNOTE_VER: 3.19.0
|
VNOTE_VER: 3.19.2
|
||||||
CMAKE_VER: 3.24.3
|
CMAKE_VER: 3.24.3
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -64,7 +64,7 @@ jobs:
|
|||||||
id: cache-qt
|
id: cache-qt
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ../Qt
|
path: ${{runner.workspace}}/Qt
|
||||||
key: ${{ runner.os }}-QtCache-6.8
|
key: ${{ runner.os }}-QtCache-6.8
|
||||||
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
|
96
.github/workflows/ci-macos.yml
vendored
@ -16,11 +16,12 @@ on:
|
|||||||
default: false
|
default: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
VNOTE_VER: 3.19.0
|
VNOTE_VER: 3.19.2
|
||||||
CMAKE_VER: 3.24.3
|
CMAKE_VER: 3.24.3
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
environment: Mac-code-sign
|
||||||
name: Build On MacOS
|
name: Build On MacOS
|
||||||
timeout-minutes: 120
|
timeout-minutes: 120
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ jobs:
|
|||||||
id: cache-qt
|
id: cache-qt
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ../Qt
|
path: ${{runner.workspace}}/Qt
|
||||||
key: ${{ runner.os }}-QtCache-6.8
|
key: ${{ runner.os }}-QtCache-6.8
|
||||||
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
@ -107,18 +108,101 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Project
|
- name: Build Project
|
||||||
run: |
|
run: |
|
||||||
|
# Keep only required SQL drivers
|
||||||
|
rm ${{env.Qt6_DIR}}/plugins/sqldrivers/libqsqlmimer.dylib
|
||||||
|
rm ${{env.Qt6_DIR}}/plugins/sqldrivers/libqsqlodbc.dylib
|
||||||
|
rm ${{env.Qt6_DIR}}/plugins/sqldrivers/libqsqlpsql.dylib
|
||||||
|
|
||||||
|
# Build the project
|
||||||
cmake --build . --target pack
|
cmake --build . --target pack
|
||||||
ls -ls .
|
|
||||||
ls -ls src
|
# Fix Qt frameworks
|
||||||
mv src/VNote.dmg VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
|
python3 ${{runner.workspace}}/macdeployqtfix/macdeployqtfix.py ./src/VNote.app/Contents/MacOS/VNote ${{env.Qt6_DIR}}/../..
|
||||||
|
|
||||||
|
# Only delete rpaths that exist to avoid errors
|
||||||
|
for rpath in $(otool -l ./src/VNote.app/Contents/MacOS/VNote | awk '/LC_RPATH/ {getline; getline; print $2}' | grep 'vnote'); do
|
||||||
|
echo "Checking rpath: $rpath"
|
||||||
|
if otool -l ./src/VNote.app/Contents/MacOS/VNote | grep -q "$rpath"; then
|
||||||
|
echo "Deleting rpath: $rpath"
|
||||||
|
install_name_tool -delete_rpath "$rpath" ./src/VNote.app/Contents/MacOS/VNote
|
||||||
|
else
|
||||||
|
echo "Rpath not found: $rpath"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
for rpath in $(otool -l ./src/VNote.app/Contents/Frameworks/libVTextEdit.dylib | awk '/LC_RPATH/ {getline; getline; print $2}' | grep 'vnote'); do
|
||||||
|
echo "Checking rpath: $rpath"
|
||||||
|
if otool -l ./src/VNote.app/Contents/Frameworks/libVTextEdit.dylib | grep -q "$rpath"; then
|
||||||
|
echo "Deleting rpath: $rpath"
|
||||||
|
install_name_tool -delete_rpath "$rpath" ./src/VNote.app/Contents/Frameworks/libVTextEdit.dylib
|
||||||
|
else
|
||||||
|
echo "Rpath not found: $rpath"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Run macdeployqtfix again to ensure all dependencies are properly fixed
|
||||||
|
python3 ${{runner.workspace}}/macdeployqtfix/macdeployqtfix.py ./src/VNote.app/Contents/MacOS/VNote ${{env.Qt6_DIR}}/../..
|
||||||
working-directory: ${{runner.workspace}}/build
|
working-directory: ${{runner.workspace}}/build
|
||||||
|
|
||||||
|
- name: Codesign Bundle
|
||||||
|
# Extract the secrets we defined earlier as environment variables
|
||||||
|
env:
|
||||||
|
MACOS_CERTIFICATE: ${{ secrets.CLI_MACOS_CERTIFICATE }}
|
||||||
|
MACOS_CERTIFICATE_PWD: ${{ secrets.CLI_MACOS_CERTIFICATE_PWD }}
|
||||||
|
MACOS_CERTIFICATE_NAME: ${{ secrets.CLI_MACOS_CERTIFICATE_NAME }}
|
||||||
|
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.CLI_MACOS_CERTIFICATE }}
|
||||||
|
run: |
|
||||||
|
# Turn our base64-encoded certificate back to a regular .p12 file
|
||||||
|
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
|
||||||
|
|
||||||
|
# We need to create a new keychain, otherwise using the certificate will prompt
|
||||||
|
# with a UI dialog asking for the certificate password, which we can't
|
||||||
|
# use in a headless CI environment
|
||||||
|
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
||||||
|
security default-keychain -s build.keychain
|
||||||
|
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
||||||
|
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
|
||||||
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
||||||
|
|
||||||
|
echo "Codesigning main app bundle"
|
||||||
|
codesign --force --deep -s "$MACOS_CERTIFICATE_NAME" --entitlements ${{github.workspace}}/package/entitlements.xml --options runtime ./src/VNote.app
|
||||||
|
codesign -v -vvv ./src/VNote.app
|
||||||
|
|
||||||
|
hdiutil create -volname "VNote" -srcfolder ./src/VNote.app -ov -format UDZO VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
|
||||||
|
codesign --force --deep -s "$MACOS_CERTIFICATE_NAME" --entitlements ${{github.workspace}}/package/entitlements.xml --options runtime ./VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
|
||||||
|
codesign -v -vvv ./VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
|
||||||
|
|
||||||
|
working-directory: ${{runner.workspace}}/build
|
||||||
|
|
||||||
|
- name: "Notarize Bundle"
|
||||||
|
# Extract the secrets we defined earlier as environment variables
|
||||||
|
env:
|
||||||
|
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.CLI_MACOS_NOTARY_USER }}
|
||||||
|
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.CLI_MACOS_TEAM_ID }}
|
||||||
|
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.CLI_MACOS_NOTARY_PWD }}
|
||||||
|
run: |
|
||||||
|
# Store the notarization credentials so that we can prevent a UI password dialog
|
||||||
|
# from blocking the CI
|
||||||
|
echo "Create keychain profile"
|
||||||
|
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
|
||||||
|
|
||||||
|
# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
|
||||||
|
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
|
||||||
|
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
|
||||||
|
# you're curious
|
||||||
|
echo "Notarize app"
|
||||||
|
xcrun notarytool submit "${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg" --keychain-profile "notarytool-profile" --wait
|
||||||
|
|
||||||
|
# Finally, we need to "attach the staple" to our executable, which will allow our app to be
|
||||||
|
# validated by macOS even when an internet connection is not available.
|
||||||
|
echo "Attach staple"
|
||||||
|
xcrun stapler staple "${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg"
|
||||||
|
|
||||||
# Enable tmate debugging of manually-triggered workflows if the input option was provided
|
# Enable tmate debugging of manually-triggered workflows if the input option was provided
|
||||||
- name: Setup tmate session
|
- name: Setup tmate session
|
||||||
uses: mxschmitt/action-tmate@v3
|
uses: mxschmitt/action-tmate@v3
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
|
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
|
||||||
|
|
||||||
- name: Archive Artifacts
|
- name: Archive DMG
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}
|
name: VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}
|
||||||
|
4
.github/workflows/ci-win.yml
vendored
@ -16,7 +16,7 @@ on:
|
|||||||
default: false
|
default: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
VNOTE_VER: 3.19.0
|
VNOTE_VER: 3.19.2
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -64,7 +64,7 @@ jobs:
|
|||||||
id: cache-qt
|
id: cache-qt
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ../Qt
|
path: ${{runner.workspace}}/Qt
|
||||||
key: ${{runner.os}}-${{matrix.config.arch}}-QtCache-${{matrix.config.qt}}
|
key: ${{runner.os}}-${{matrix.config.arch}}-QtCache-${{matrix.config.qt}}
|
||||||
|
|
||||||
- name: Install Qt Official Build
|
- name: Install Qt Official Build
|
||||||
|
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
|||||||
*.pro.user.*
|
*.pro.user.*
|
||||||
.ccls
|
.ccls
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
|
compile_commands.json.*
|
||||||
compile_flags.txt
|
compile_flags.txt
|
||||||
.cache
|
.cache
|
||||||
.tasks
|
.tasks
|
||||||
|
@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 3.20)
|
|||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.1" CACHE STRING "Minimum OS X deployment version")
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.1" CACHE STRING "Minimum OS X deployment version")
|
||||||
|
|
||||||
project(VNote
|
project(VNote
|
||||||
VERSION 3.19.0
|
VERSION 3.19.2
|
||||||
DESCRIPTION "A pleasant note-taking platform"
|
DESCRIPTION "A pleasant note-taking platform"
|
||||||
HOMEPAGE_URL "https://app.vnote.fun"
|
HOMEPAGE_URL "https://app.vnote.fun"
|
||||||
LANGUAGES C CXX)
|
LANGUAGES C CXX)
|
||||||
|
@ -3,9 +3,11 @@
|
|||||||
|
|
||||||
[简体中文](README_zh_CN.md)
|
[简体中文](README_zh_CN.md)
|
||||||
|
|
||||||
|
[Project on Gitee](https://gitee.com/vnotex/vnote)
|
||||||
|
|
||||||
A pleasant note-taking platform.
|
A pleasant note-taking platform.
|
||||||
|
|
||||||
For more information, please visit [**VNote's Home Page**](https://vnotex.github.io/vnote) or [Home Page on Gitee](https://tamlok.gitee.io/vnote).
|
For more information, please visit [**VNote's Home Page**](https://vnotex.github.io/vnote).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -26,7 +28,7 @@ Continuous builds on `master` branch could be found at the [Continuous Build](ht
|
|||||||
Latest stable builds could be found at the [latest release](https://github.com/vnotex/vnote/releases/latest). Alternative download services are available:
|
Latest stable builds could be found at the [latest release](https://github.com/vnotex/vnote/releases/latest). Alternative download services are available:
|
||||||
|
|
||||||
* [Tianyi Netdisk](https://cloud.189.cn/t/Av67NvmEJVBv)
|
* [Tianyi Netdisk](https://cloud.189.cn/t/Av67NvmEJVBv)
|
||||||
* [Baidu Netdisk](https://pan.baidu.com/s/1Fou1flmBsQUQ8Qs9V_M6Aw) with the code `note`
|
* [Baidu Netdisk](https://pan.baidu.com/s/1lX69oMBw8XuJshQDN3HiHw?pwd=f8fk)
|
||||||
|
|
||||||
## Supports
|
## Supports
|
||||||
* [GitHub Issues](https://github.com/vnotex/vnote/issues);
|
* [GitHub Issues](https://github.com/vnotex/vnote/issues);
|
||||||
|
@ -3,9 +3,11 @@
|
|||||||
|
|
||||||
[English](README.md)
|
[English](README.md)
|
||||||
|
|
||||||
|
[Gitee托管项目](https://gitee.com/vnotex/vnote)
|
||||||
|
|
||||||
一个舒适的笔记平台!
|
一个舒适的笔记平台!
|
||||||
|
|
||||||
更多信息,请访问[VNote主页](https://vnotex.github.io/vnote)或者[由Gitee托管的主页](https://tamlok.gitee.io/vnote)。
|
更多信息,请访问[VNote主页](https://vnotex.github.io/vnote)。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -26,7 +28,7 @@ VNote不是一个简单的Markdown编辑器。通过提供强大的笔记管理
|
|||||||
最新的[稳定版本发布](https://github.com/vnotex/vnote/releases/latest)。其他下载选项:
|
最新的[稳定版本发布](https://github.com/vnotex/vnote/releases/latest)。其他下载选项:
|
||||||
|
|
||||||
* [天翼云盘](https://cloud.189.cn/t/Av67NvmEJVBv)
|
* [天翼云盘](https://cloud.189.cn/t/Av67NvmEJVBv)
|
||||||
* [百度云盘](https://pan.baidu.com/s/1Fou1flmBsQUQ8Qs9V_M6Aw) 提取码`note`
|
* [百度云盘](https://pan.baidu.com/s/1lX69oMBw8XuJshQDN3HiHw?pwd=f8fk)
|
||||||
|
|
||||||
## 支持
|
## 支持
|
||||||
* [GitHub Issues](https://github.com/vnotex/vnote/issues);
|
* [GitHub Issues](https://github.com/vnotex/vnote/issues);
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
## v3.19.2
|
||||||
|
* Codesign MacOS Bundle
|
||||||
|
* Fix toolbar expansion button style
|
||||||
|
* Support hot-reloading of theme via --watch-themes option
|
||||||
|
|
||||||
|
## v3.19.1
|
||||||
|
* Fix toolbar button in Qt 6.8
|
||||||
|
|
||||||
## v3.19.0
|
## v3.19.0
|
||||||
* Add VSCode-sytle editor shortcuts
|
* Add VSCode-sytle editor shortcuts
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit aaf3b097ac3ae0eed7324efae6ddce23a0130402
|
Subproject commit 50b1421793af3882ddc62ad4e6cf5537e1d7906f
|
24
package/QtWebEngineProcess.entitlements.xml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.disable-library-validation</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.disable-executable-page-protection</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.files.user-selected.read-write</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.network.client</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.get-task-allow</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.debugger</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.inherit</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
24
package/entitlements.xml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.files.user-selected.read-write</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.network.client</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.disable-library-validation</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.disable-executable-page-protection</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.get-task-allow</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.debugger</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.inherit</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
26
privacy_policy.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Privacy Policy
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
Welcome to VNote! We value your privacy and are committed to protecting your personal information. This Privacy Policy explains how we handle your information when you use our application.
|
||||||
|
|
||||||
|
## Information We Collect
|
||||||
|
VNote does not collect any personal or usage data from its users. Your interactions with the app remain private and are not stored or shared.
|
||||||
|
|
||||||
|
## How We Use Your Information
|
||||||
|
Since VNote does not collect any user data, we do not use, store, or process any personal information.
|
||||||
|
|
||||||
|
## Sharing Your Information
|
||||||
|
As VNote does not collect any user data, we do not share any personal information with third parties.
|
||||||
|
|
||||||
|
## Security
|
||||||
|
While VNote does not collect any user data, we still implement security measures to ensure the integrity and safety of the application itself.
|
||||||
|
|
||||||
|
## Your Choices
|
||||||
|
Since no data is collected, there are no choices or actions required from users regarding their personal information.
|
||||||
|
|
||||||
|
## Children's Privacy
|
||||||
|
Our services are not intended for children under the age of 13. We do not knowingly collect personal information from children under 13.
|
||||||
|
|
||||||
|
## Changes to This Privacy Policy
|
||||||
|
We may update this Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on our app. You are advised to review this Privacy Policy periodically for any changes.
|
||||||
|
|
@ -139,7 +139,7 @@ elseif(APPLE)
|
|||||||
OUTPUT_NAME "${PROJECT_NAME}"
|
OUTPUT_NAME "${PROJECT_NAME}"
|
||||||
MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}"
|
MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}"
|
||||||
MACOSX_BUNDLE_INFO_STRING "${PROJECT_DESCRIPTION}"
|
MACOSX_BUNDLE_INFO_STRING "${PROJECT_DESCRIPTION}"
|
||||||
MACOSX_BUNDLE_GUI_IDENTIFIER "fun.vnote.app"
|
MACOSX_BUNDLE_GUI_IDENTIFIER "fun.vnote.vnote"
|
||||||
MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}"
|
MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}"
|
||||||
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
|
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
|
||||||
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
|
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
execute_process(COMMAND "optool" strip -t ${CMAKE_CURRENT_BINARY_DIR}/VNote.app
|
execute_process(COMMAND "optool" strip -t ${CMAKE_CURRENT_BINARY_DIR}/VNote.app
|
||||||
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}
|
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}
|
||||||
)
|
)
|
||||||
execute_process(COMMAND "${MACDEPLOYQT_EXECUTABLE}" ${CMAKE_CURRENT_BINARY_DIR}/VNote.app -dmg
|
execute_process(COMMAND "${MACDEPLOYQT_EXECUTABLE}" ${CMAKE_CURRENT_BINARY_DIR}/VNote.app -always-overwrite -verbose=1
|
||||||
-always-overwrite -verbose=1
|
|
||||||
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}
|
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}
|
||||||
)
|
)
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
#include <QFileOpenEvent>
|
#include <QFileOpenEvent>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QStyle>
|
||||||
|
#include <QFileSystemWatcher>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <core/vnotex.h>
|
||||||
|
|
||||||
using namespace vnotex;
|
using namespace vnotex;
|
||||||
|
|
||||||
@ -10,6 +15,53 @@ Application::Application(int &p_argc, char **p_argv)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Application::watchThemeFolder(const QString &p_themeFolderPath)
|
||||||
|
{
|
||||||
|
if (p_themeFolderPath.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize watchers only when needed
|
||||||
|
if (!m_styleWatcher) {
|
||||||
|
m_styleWatcher = new QFileSystemWatcher(this);
|
||||||
|
}
|
||||||
|
if (!m_reloadTimer) {
|
||||||
|
m_reloadTimer = new QTimer(this);
|
||||||
|
m_reloadTimer->setSingleShot(true);
|
||||||
|
m_reloadTimer->setInterval(500); // 500ms debounce delay
|
||||||
|
connect(m_reloadTimer, &QTimer::timeout,
|
||||||
|
this, &Application::reloadThemeResources);
|
||||||
|
|
||||||
|
// Connect file watcher to timer
|
||||||
|
connect(m_styleWatcher, &QFileSystemWatcher::directoryChanged,
|
||||||
|
m_reloadTimer, qOverload<>(&QTimer::start));
|
||||||
|
connect(m_styleWatcher, &QFileSystemWatcher::fileChanged,
|
||||||
|
m_reloadTimer, qOverload<>(&QTimer::start));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Watch the theme folder and its files
|
||||||
|
m_styleWatcher->addPath(p_themeFolderPath);
|
||||||
|
|
||||||
|
// Also watch individual files in the theme folder
|
||||||
|
QDir themeDir(p_themeFolderPath);
|
||||||
|
QStringList files = themeDir.entryList(QDir::Files);
|
||||||
|
for (const QString &file : files) {
|
||||||
|
m_styleWatcher->addPath(themeDir.filePath(file));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Application::reloadThemeResources()
|
||||||
|
{
|
||||||
|
VNoteX::getInst().getThemeMgr().refreshCurrentTheme();
|
||||||
|
|
||||||
|
auto stylesheet = VNoteX::getInst().getThemeMgr().fetchQtStyleSheet();
|
||||||
|
if (!stylesheet.isEmpty()) {
|
||||||
|
setStyleSheet(stylesheet);
|
||||||
|
style()->unpolish(this);
|
||||||
|
style()->polish(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Application::event(QEvent *p_event)
|
bool Application::event(QEvent *p_event)
|
||||||
{
|
{
|
||||||
// On macOS, we need this to open file from Finder.
|
// On macOS, we need this to open file from Finder.
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
#ifndef APPLICATION_H
|
#ifndef APPLICATION_H
|
||||||
#define APPLICATION_H
|
#define APPLICATION_H
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
|
class QFileSystemWatcher;
|
||||||
|
class QTimer;
|
||||||
|
|
||||||
namespace vnotex
|
namespace vnotex
|
||||||
{
|
{
|
||||||
class Application : public QApplication
|
class Application : public QApplication
|
||||||
@ -11,11 +13,21 @@ namespace vnotex
|
|||||||
public:
|
public:
|
||||||
Application(int &p_argc, char **p_argv);
|
Application(int &p_argc, char **p_argv);
|
||||||
|
|
||||||
|
// Set up theme folder watcher for hot-reload
|
||||||
|
void watchThemeFolder(const QString &p_themeFolderPath);
|
||||||
|
|
||||||
|
// Reload the theme resources (stylesheet, icons, etc)
|
||||||
|
void reloadThemeResources();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void openFileRequested(const QString &p_filePath);
|
void openFileRequested(const QString &p_filePath);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool event(QEvent *p_event) Q_DECL_OVERRIDE;
|
bool event(QEvent *p_event) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QFileSystemWatcher *m_styleWatcher = nullptr;
|
||||||
|
QTimer *m_reloadTimer = nullptr;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,9 @@ CommandLineOptions::ParseResult CommandLineOptions::parse(const QStringList &p_a
|
|||||||
const QCommandLineOption logStderrOpt("log-stderr", MainWindow::tr("Log to stderr."));
|
const QCommandLineOption logStderrOpt("log-stderr", MainWindow::tr("Log to stderr."));
|
||||||
parser.addOption(logStderrOpt);
|
parser.addOption(logStderrOpt);
|
||||||
|
|
||||||
|
const QCommandLineOption watchThemesOpt("watch-themes", MainWindow::tr("Watch theme folder for changes."));
|
||||||
|
parser.addOption(watchThemesOpt);
|
||||||
|
|
||||||
// WebEngine options.
|
// WebEngine options.
|
||||||
// No need to handle them. Just add them to the parser to avoid parse error.
|
// No need to handle them. Just add them to the parser to avoid parse error.
|
||||||
{
|
{
|
||||||
@ -70,5 +73,9 @@ CommandLineOptions::ParseResult CommandLineOptions::parse(const QStringList &p_a
|
|||||||
m_logToStderr = true;
|
m_logToStderr = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parser.isSet(watchThemesOpt)) {
|
||||||
|
m_watchThemes = true;
|
||||||
|
}
|
||||||
|
|
||||||
return ParseResult::Ok;
|
return ParseResult::Ok;
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,9 @@ public:
|
|||||||
bool m_verbose = false;
|
bool m_verbose = false;
|
||||||
|
|
||||||
bool m_logToStderr = false;
|
bool m_logToStderr = false;
|
||||||
|
|
||||||
|
// Whether to watch theme folder for changes
|
||||||
|
bool m_watchThemes = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COMMANDLINEOPTIONS_H
|
#endif // COMMANDLINEOPTIONS_H
|
||||||
|
@ -24,6 +24,11 @@ Theme::Theme(const QString &p_themeFolderPath,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString vnotex::Theme::getThemeFolder() const
|
||||||
|
{
|
||||||
|
return m_themeFolderPath;
|
||||||
|
}
|
||||||
|
|
||||||
bool Theme::isValidThemeFolder(const QString &p_folder)
|
bool Theme::isValidThemeFolder(const QString &p_folder)
|
||||||
{
|
{
|
||||||
QDir dir(p_folder);
|
QDir dir(p_folder);
|
||||||
|
@ -47,6 +47,8 @@ namespace vnotex
|
|||||||
|
|
||||||
QString name() const;
|
QString name() const;
|
||||||
|
|
||||||
|
QString getThemeFolder() const;
|
||||||
|
|
||||||
static bool isValidThemeFolder(const QString &p_folder);
|
static bool isValidThemeFolder(const QString &p_folder);
|
||||||
|
|
||||||
static Theme *fromFolder(const QString &p_folder);
|
static Theme *fromFolder(const QString &p_folder);
|
||||||
|
@ -24,8 +24,6 @@ ThemeMgr::ThemeMgr(const QString &p_currentThemeName, QObject *p_parent)
|
|||||||
loadAvailableThemes();
|
loadAvailableThemes();
|
||||||
|
|
||||||
loadCurrentTheme(p_currentThemeName);
|
loadCurrentTheme(p_currentThemeName);
|
||||||
|
|
||||||
IconUtils::setDefaultIconForeground(paletteColor("base#icon#fg"), paletteColor("base#icon#disabled#fg"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ThemeMgr::getIconFile(const QString &p_icon) const
|
QString ThemeMgr::getIconFile(const QString &p_icon) const
|
||||||
@ -91,6 +89,7 @@ const Theme &ThemeMgr::getCurrentTheme() const
|
|||||||
|
|
||||||
void ThemeMgr::loadCurrentTheme(const QString &p_themeName)
|
void ThemeMgr::loadCurrentTheme(const QString &p_themeName)
|
||||||
{
|
{
|
||||||
|
m_currentTheme.reset();
|
||||||
auto themeFolder = findThemeFolder(p_themeName);
|
auto themeFolder = findThemeFolder(p_themeName);
|
||||||
if (themeFolder.isNull()) {
|
if (themeFolder.isNull()) {
|
||||||
qWarning() << "failed to locate theme" << p_themeName;
|
qWarning() << "failed to locate theme" << p_themeName;
|
||||||
@ -104,6 +103,8 @@ void ThemeMgr::loadCurrentTheme(const QString &p_themeName)
|
|||||||
qWarning() << "fall back to default theme" << defaultTheme;
|
qWarning() << "fall back to default theme" << defaultTheme;
|
||||||
m_currentTheme.reset(loadTheme(findThemeFolder(defaultTheme)));
|
m_currentTheme.reset(loadTheme(findThemeFolder(defaultTheme)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IconUtils::setDefaultIconForeground(paletteColor("base#icon#fg"), paletteColor("base#icon#disabled#fg"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Theme *ThemeMgr::loadTheme(const QString &p_themeFolder)
|
Theme *ThemeMgr::loadTheme(const QString &p_themeFolder)
|
||||||
@ -211,6 +212,14 @@ QPixmap ThemeMgr::getThemePreview(const QString &p_name) const
|
|||||||
void ThemeMgr::refresh()
|
void ThemeMgr::refresh()
|
||||||
{
|
{
|
||||||
loadAvailableThemes();
|
loadAvailableThemes();
|
||||||
|
refreshCurrentTheme();
|
||||||
|
}
|
||||||
|
|
||||||
|
void vnotex::ThemeMgr::refreshCurrentTheme()
|
||||||
|
{
|
||||||
|
if (m_currentTheme) {
|
||||||
|
loadCurrentTheme(m_currentTheme->name());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThemeMgr::addWebStylesSearchPath(const QString &p_path)
|
void ThemeMgr::addWebStylesSearchPath(const QString &p_path)
|
||||||
|
@ -60,10 +60,11 @@ namespace vnotex
|
|||||||
|
|
||||||
const ThemeInfo *findTheme(const QString &p_name) const;
|
const ThemeInfo *findTheme(const QString &p_name) const;
|
||||||
|
|
||||||
// Refresh the themes list.
|
// Refresh the themes list and reload current theme.
|
||||||
// Won't affect current theme since we do not support changing theme real time for now.
|
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
|
void refreshCurrentTheme();
|
||||||
|
|
||||||
// Return all web stylesheets available, including those from themes and web styles search paths.
|
// Return all web stylesheets available, including those from themes and web styles search paths.
|
||||||
// <DisplayName, FilePath>.
|
// <DisplayName, FilePath>.
|
||||||
QVector<QPair<QString, QString>> getWebStyles() const;
|
QVector<QPair<QString, QString>> getWebStyles() const;
|
||||||
|
@ -16,26 +16,28 @@
|
|||||||
<string>public.plain-text</string>
|
<string>public.plain-text</string>
|
||||||
<string>net.daringfireball.markdown</string>
|
<string>net.daringfireball.markdown</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>LSHandlerRank</key>
|
||||||
|
<string>Owner</string>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>com.apple.security.cs.disable-library-validation</key>
|
|
||||||
<true/>
|
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>VNote</string>
|
<string>VNote</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>vnote</string>
|
<string>VNote</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.19</string>
|
<string>3.19</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>3.19.0</string>
|
<string>3.19.2</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>Distributed under LGPL-3.0 license. Copyright (c) 2024 app.vnote.fun</string>
|
<string>Distributed under LGPL-3.0 license. Copyright (c) 2025 app.vnote.fun</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
<string>vnote.icns</string>
|
<string>vnote.icns</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>fun.vnote.app</string>
|
<string>fun.vnote.vnote</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
|
<key>LSApplicationCategoryType</key>
|
||||||
|
<string>public.app-category.productivity</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>10.15</string>
|
<string>10.15</string>
|
||||||
<key>NOTE</key>
|
<key>NOTE</key>
|
||||||
|
BIN
src/data/core/logo/icon.iconset/icon_512x512.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
src/data/core/logo/icon.iconset/icon_512x512@2x.png
Normal file
After Width: | Height: | Size: 26 KiB |
@ -3,7 +3,7 @@
|
|||||||
"metadata" : {
|
"metadata" : {
|
||||||
"//comment": "When releasing new version, please go through the following configs to check if override is needed.",
|
"//comment": "When releasing new version, please go through the following configs to check if override is needed.",
|
||||||
"//Comment": "markdown_editor#override_viewer_resource",
|
"//Comment": "markdown_editor#override_viewer_resource",
|
||||||
"version" : "3.19.0"
|
"version" : "3.19.2"
|
||||||
},
|
},
|
||||||
"core" : {
|
"core" : {
|
||||||
"theme" : "pure",
|
"theme" : "pure",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Welcome to VNote
|
# Welcome to VNote
|
||||||
A pleasant note-taking platform.
|
A pleasant note-taking platform.
|
||||||
|
|
||||||
For more information, please visit [**VNote's Home Page**](https://vnotex.github.io/vnote) or [Home Page on Gitee](https://tamlok.gitee.io/vnote).
|
For more information, please visit [**VNote's Home Page**](https://vnotex.github.io/vnote).
|
||||||
|
|
||||||
## FAQs
|
## FAQs
|
||||||
* Hover the mouse over buttons to get detailed information.
|
* Hover the mouse over buttons to get detailed information.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# 欢迎使用 VNote
|
# 欢迎使用 VNote
|
||||||
一个舒适的笔记平台。
|
一个舒适的笔记平台。
|
||||||
|
|
||||||
更多信息,请访问[VNote主页](https://vnotex.github.io/vnote)或者[由Gitee托管的主页](https://tamlok.gitee.io/vnote)。
|
更多信息,请访问[VNote主页](https://vnotex.github.io/vnote)。
|
||||||
|
|
||||||
## 常见问题
|
## 常见问题
|
||||||
* 将鼠标悬停在按钮上可以获取详细信息。
|
* 将鼠标悬停在按钮上可以获取详细信息。
|
||||||
|
@ -349,6 +349,7 @@
|
|||||||
<file>themes/moonlight/checkbox_unchecked.svg</file>
|
<file>themes/moonlight/checkbox_unchecked.svg</file>
|
||||||
<file>themes/moonlight/checkbox_unchecked_disabled.svg</file>
|
<file>themes/moonlight/checkbox_unchecked_disabled.svg</file>
|
||||||
<file>themes/moonlight/close.svg</file>
|
<file>themes/moonlight/close.svg</file>
|
||||||
|
<file>themes/moonlight/expand_toolbar.svg</file>
|
||||||
<file>themes/moonlight/close_grey.svg</file>
|
<file>themes/moonlight/close_grey.svg</file>
|
||||||
<file>themes/moonlight/cover.png</file>
|
<file>themes/moonlight/cover.png</file>
|
||||||
<file>themes/moonlight/down.svg</file>
|
<file>themes/moonlight/down.svg</file>
|
||||||
@ -381,6 +382,7 @@
|
|||||||
<file>themes/pure/checkbox_unchecked.svg</file>
|
<file>themes/pure/checkbox_unchecked.svg</file>
|
||||||
<file>themes/pure/checkbox_unchecked_disabled.svg</file>
|
<file>themes/pure/checkbox_unchecked_disabled.svg</file>
|
||||||
<file>themes/pure/close.svg</file>
|
<file>themes/pure/close.svg</file>
|
||||||
|
<file>themes/pure/expand_toolbar.svg</file>
|
||||||
<file>themes/pure/close_grey.svg</file>
|
<file>themes/pure/close_grey.svg</file>
|
||||||
<file>themes/pure/cover.png</file>
|
<file>themes/pure/cover.png</file>
|
||||||
<file>themes/pure/down.svg</file>
|
<file>themes/pure/down.svg</file>
|
||||||
@ -413,6 +415,7 @@
|
|||||||
<file>themes/solarized-dark/checkbox_unchecked.svg</file>
|
<file>themes/solarized-dark/checkbox_unchecked.svg</file>
|
||||||
<file>themes/solarized-dark/checkbox_unchecked_disabled.svg</file>
|
<file>themes/solarized-dark/checkbox_unchecked_disabled.svg</file>
|
||||||
<file>themes/solarized-dark/close.svg</file>
|
<file>themes/solarized-dark/close.svg</file>
|
||||||
|
<file>themes/solarized-dark/expand_toolbar.svg</file>
|
||||||
<file>themes/solarized-dark/close_grey.svg</file>
|
<file>themes/solarized-dark/close_grey.svg</file>
|
||||||
<file>themes/solarized-dark/cover.png</file>
|
<file>themes/solarized-dark/cover.png</file>
|
||||||
<file>themes/solarized-dark/down.svg</file>
|
<file>themes/solarized-dark/down.svg</file>
|
||||||
@ -445,6 +448,7 @@
|
|||||||
<file>themes/solarized-light/checkbox_unchecked.svg</file>
|
<file>themes/solarized-light/checkbox_unchecked.svg</file>
|
||||||
<file>themes/solarized-light/checkbox_unchecked_disabled.svg</file>
|
<file>themes/solarized-light/checkbox_unchecked_disabled.svg</file>
|
||||||
<file>themes/solarized-light/close.svg</file>
|
<file>themes/solarized-light/close.svg</file>
|
||||||
|
<file>themes/solarized-light/expand_toolbar.svg</file>
|
||||||
<file>themes/solarized-light/close_grey.svg</file>
|
<file>themes/solarized-light/close_grey.svg</file>
|
||||||
<file>themes/solarized-light/cover.png</file>
|
<file>themes/solarized-light/cover.png</file>
|
||||||
<file>themes/solarized-light/down.svg</file>
|
<file>themes/solarized-light/down.svg</file>
|
||||||
@ -804,6 +808,7 @@
|
|||||||
<file>themes/vscode-dark/checkbox_unchecked.svg</file>
|
<file>themes/vscode-dark/checkbox_unchecked.svg</file>
|
||||||
<file>themes/vscode-dark/checkbox_unchecked_disabled.svg</file>
|
<file>themes/vscode-dark/checkbox_unchecked_disabled.svg</file>
|
||||||
<file>themes/vscode-dark/close.svg</file>
|
<file>themes/vscode-dark/close.svg</file>
|
||||||
|
<file>themes/vscode-dark/expand_toolbar.svg</file>
|
||||||
<file>themes/vscode-dark/close_grey.svg</file>
|
<file>themes/vscode-dark/close_grey.svg</file>
|
||||||
<file>themes/vscode-dark/cover.png</file>
|
<file>themes/vscode-dark/cover.png</file>
|
||||||
<file>themes/vscode-dark/down.svg</file>
|
<file>themes/vscode-dark/down.svg</file>
|
||||||
@ -837,6 +842,7 @@
|
|||||||
<file>themes/vue-light/checkbox_unchecked.svg</file>
|
<file>themes/vue-light/checkbox_unchecked.svg</file>
|
||||||
<file>themes/vue-light/checkbox_unchecked_disabled.svg</file>
|
<file>themes/vue-light/checkbox_unchecked_disabled.svg</file>
|
||||||
<file>themes/vue-light/close.svg</file>
|
<file>themes/vue-light/close.svg</file>
|
||||||
|
<file>themes/vue-light/expand_toolbar.svg</file>
|
||||||
<file>themes/vue-light/close_grey.svg</file>
|
<file>themes/vue-light/close_grey.svg</file>
|
||||||
<file>themes/vue-light/cover.png</file>
|
<file>themes/vue-light/cover.png</file>
|
||||||
<file>themes/vue-light/down.svg</file>
|
<file>themes/vue-light/down.svg</file>
|
||||||
@ -869,6 +875,7 @@
|
|||||||
<file>themes/vue-dark/checkbox_unchecked.svg</file>
|
<file>themes/vue-dark/checkbox_unchecked.svg</file>
|
||||||
<file>themes/vue-dark/checkbox_unchecked_disabled.svg</file>
|
<file>themes/vue-dark/checkbox_unchecked_disabled.svg</file>
|
||||||
<file>themes/vue-dark/close.svg</file>
|
<file>themes/vue-dark/close.svg</file>
|
||||||
|
<file>themes/vue-dark/expand_toolbar.svg</file>
|
||||||
<file>themes/vue-dark/close_grey.svg</file>
|
<file>themes/vue-dark/close_grey.svg</file>
|
||||||
<file>themes/vue-dark/cover.png</file>
|
<file>themes/vue-dark/cover.png</file>
|
||||||
<file>themes/vue-dark/down.svg</file>
|
<file>themes/vue-dark/down.svg</file>
|
||||||
@ -905,6 +912,7 @@
|
|||||||
<file>themes/vx-idea/checkbox_unchecked.svg</file>
|
<file>themes/vx-idea/checkbox_unchecked.svg</file>
|
||||||
<file>themes/vx-idea/checkbox_unchecked_disabled.svg</file>
|
<file>themes/vx-idea/checkbox_unchecked_disabled.svg</file>
|
||||||
<file>themes/vx-idea/close.svg</file>
|
<file>themes/vx-idea/close.svg</file>
|
||||||
|
<file>themes/vx-idea/expand_toolbar.svg</file>
|
||||||
<file>themes/vx-idea/close_grey.svg</file>
|
<file>themes/vx-idea/close_grey.svg</file>
|
||||||
<file>themes/vx-idea/cover.png</file>
|
<file>themes/vx-idea/cover.png</file>
|
||||||
<file>themes/vx-idea/down.svg</file>
|
<file>themes/vx-idea/down.svg</file>
|
||||||
|
1
src/data/extra/themes/moonlight/expand_toolbar.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1747190112225" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2510" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M798.165333 524.501333a42.666667 42.666667 0 0 0-60.330666 0L512 750.336l-225.834667-225.834667a42.666667 42.666667 0 0 0-60.330666 60.330667l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330667z" p-id="2511" fill="#9EA5B4"></path><path d="M798.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 0L512 451.669333 286.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 60.330666l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330666z" p-id="2512" fill="#9EA5B4"></path></svg>
|
After Width: | Height: | Size: 891 B |
@ -147,13 +147,16 @@ QToolBar::separator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button {
|
QToolBarExtension#qt_toolbar_ext_button {
|
||||||
background-color: @widgets#qtoolbar#extension#bg;
|
qproperty-icon: url(expand_toolbar.svg);
|
||||||
margin: 30px;
|
background-color: @widgets#qtoolbutton#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button:hover {
|
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||||
background-color: @widgets#qtoolbar#extension#hover#bg;
|
background-color: @widgets#qtoolbutton#hover#bg;
|
||||||
margin: 30px;
|
}
|
||||||
|
|
||||||
|
QToolBarExtension#qt_toolbar_ext_button:pressed {
|
||||||
|
background-color: @widgets#qtoolbutton#pressed#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QToolButton */
|
/* QToolButton */
|
||||||
|
1
src/data/extra/themes/pure/expand_toolbar.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1747190112225" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2510" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M798.165333 524.501333a42.666667 42.666667 0 0 0-60.330666 0L512 750.336l-225.834667-225.834667a42.666667 42.666667 0 0 0-60.330666 60.330667l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330667z" p-id="2511" fill="#222222"></path><path d="M798.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 0L512 451.669333 286.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 60.330666l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330666z" p-id="2512" fill="#222222"></path></svg>
|
After Width: | Height: | Size: 891 B |
@ -166,13 +166,16 @@ QToolBar::separator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button {
|
QToolBarExtension#qt_toolbar_ext_button {
|
||||||
background-color: @widgets#qtoolbar#extension#bg;
|
qproperty-icon: url(expand_toolbar.svg);
|
||||||
margin: 30px;
|
background-color: @widgets#qtoolbutton#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button:hover {
|
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||||
background-color: @widgets#qtoolbar#extension#hover#bg;
|
background-color: @widgets#qtoolbutton#hover#bg;
|
||||||
margin: 30px;
|
}
|
||||||
|
|
||||||
|
QToolBarExtension#qt_toolbar_ext_button:pressed {
|
||||||
|
background-color: @widgets#qtoolbutton#pressed#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QToolButton */
|
/* QToolButton */
|
||||||
|
1
src/data/extra/themes/solarized-dark/expand_toolbar.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1747190112225" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2510" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M798.165333 524.501333a42.666667 42.666667 0 0 0-60.330666 0L512 750.336l-225.834667-225.834667a42.666667 42.666667 0 0 0-60.330666 60.330667l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330667z" p-id="2511" fill="#9EA5B4"></path><path d="M798.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 0L512 451.669333 286.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 60.330666l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330666z" p-id="2512" fill="#9EA5B4"></path></svg>
|
After Width: | Height: | Size: 891 B |
@ -143,13 +143,16 @@ QToolBar::separator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button {
|
QToolBarExtension#qt_toolbar_ext_button {
|
||||||
background-color: @widgets#qtoolbar#extension#bg;
|
qproperty-icon: url(expand_toolbar.svg);
|
||||||
margin: 30px;
|
background-color: @widgets#qtoolbutton#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button:hover {
|
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||||
background-color: @widgets#qtoolbar#extension#hover#bg;
|
background-color: @widgets#qtoolbutton#hover#bg;
|
||||||
margin: 30px;
|
}
|
||||||
|
|
||||||
|
QToolBarExtension#qt_toolbar_ext_button:pressed {
|
||||||
|
background-color: @widgets#qtoolbutton#pressed#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QToolButton */
|
/* QToolButton */
|
||||||
|
1
src/data/extra/themes/solarized-light/expand_toolbar.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1747190112225" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2510" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M798.165333 524.501333a42.666667 42.666667 0 0 0-60.330666 0L512 750.336l-225.834667-225.834667a42.666667 42.666667 0 0 0-60.330666 60.330667l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330667z" p-id="2511" fill="#9EA5B4"></path><path d="M798.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 0L512 451.669333 286.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 60.330666l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330666z" p-id="2512" fill="#9EA5B4"></path></svg>
|
After Width: | Height: | Size: 891 B |
@ -143,13 +143,16 @@ QToolBar::separator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button {
|
QToolBarExtension#qt_toolbar_ext_button {
|
||||||
background-color: @widgets#qtoolbar#extension#bg;
|
qproperty-icon: url(expand_toolbar.svg);
|
||||||
margin: 30px;
|
background-color: @widgets#qtoolbutton#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button:hover {
|
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||||
background-color: @widgets#qtoolbar#extension#hover#bg;
|
background-color: @widgets#qtoolbutton#hover#bg;
|
||||||
margin: 30px;
|
}
|
||||||
|
|
||||||
|
QToolBarExtension#qt_toolbar_ext_button:pressed {
|
||||||
|
background-color: @widgets#qtoolbutton#pressed#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QToolButton */
|
/* QToolButton */
|
||||||
|
1
src/data/extra/themes/vscode-dark/expand_toolbar.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1747190112225" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2510" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M798.165333 524.501333a42.666667 42.666667 0 0 0-60.330666 0L512 750.336l-225.834667-225.834667a42.666667 42.666667 0 0 0-60.330666 60.330667l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330667z" p-id="2511" fill="#9EA5B4"></path><path d="M798.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 0L512 451.669333 286.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 60.330666l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330666z" p-id="2512" fill="#9EA5B4"></path></svg>
|
After Width: | Height: | Size: 891 B |
@ -143,13 +143,16 @@ QToolBar::separator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button {
|
QToolBarExtension#qt_toolbar_ext_button {
|
||||||
background-color: @widgets#qtoolbar#extension#bg;
|
qproperty-icon: url(expand_toolbar.svg);
|
||||||
margin: 30px;
|
background-color: @widgets#qtoolbutton#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button:hover {
|
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||||
background-color: @widgets#qtoolbar#extension#hover#bg;
|
background-color: @widgets#qtoolbutton#hover#bg;
|
||||||
margin: 30px;
|
}
|
||||||
|
|
||||||
|
QToolBarExtension#qt_toolbar_ext_button:pressed {
|
||||||
|
background-color: @widgets#qtoolbutton#pressed#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QToolButton */
|
/* QToolButton */
|
||||||
|
1
src/data/extra/themes/vue-dark/expand_toolbar.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1747190112225" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2510" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M798.165333 524.501333a42.666667 42.666667 0 0 0-60.330666 0L512 750.336l-225.834667-225.834667a42.666667 42.666667 0 0 0-60.330666 60.330667l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330667z" p-id="2511" fill="#4d5765"></path><path d="M798.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 0L512 451.669333 286.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 60.330666l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330666z" p-id="2512" fill="#4d5765"></path></svg>
|
After Width: | Height: | Size: 891 B |
@ -148,13 +148,16 @@ QToolBar::separator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button {
|
QToolBarExtension#qt_toolbar_ext_button {
|
||||||
background-color: @widgets#qtoolbar#extension#bg;
|
qproperty-icon: url(expand_toolbar.svg);
|
||||||
margin: 30px;
|
background-color: @widgets#qtoolbutton#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button:hover {
|
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||||
background-color: @widgets#qtoolbar#extension#hover#bg;
|
background-color: @widgets#qtoolbutton#hover#bg;
|
||||||
margin: 30px;
|
}
|
||||||
|
|
||||||
|
QToolBarExtension#qt_toolbar_ext_button:pressed {
|
||||||
|
background-color: @widgets#qtoolbutton#pressed#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QToolButton */
|
/* QToolButton */
|
||||||
|
1
src/data/extra/themes/vue-light/expand_toolbar.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1747190112225" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2510" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M798.165333 524.501333a42.666667 42.666667 0 0 0-60.330666 0L512 750.336l-225.834667-225.834667a42.666667 42.666667 0 0 0-60.330666 60.330667l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330667z" p-id="2511" fill="#222222"></path><path d="M798.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 0L512 451.669333 286.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 60.330666l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330666z" p-id="2512" fill="#222222"></path></svg>
|
After Width: | Height: | Size: 891 B |
@ -166,13 +166,16 @@ QToolBar::separator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button {
|
QToolBarExtension#qt_toolbar_ext_button {
|
||||||
background-color: @widgets#qtoolbar#extension#bg;
|
qproperty-icon: url(expand_toolbar.svg);
|
||||||
margin: 30px;
|
background-color: @widgets#qtoolbutton#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button:hover {
|
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||||
background-color: @widgets#qtoolbar#extension#hover#bg;
|
background-color: @widgets#qtoolbutton#hover#bg;
|
||||||
margin: 30px;
|
}
|
||||||
|
|
||||||
|
QToolBarExtension#qt_toolbar_ext_button:pressed {
|
||||||
|
background-color: @widgets#qtoolbutton#pressed#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QToolButton */
|
/* QToolButton */
|
||||||
|
1
src/data/extra/themes/vx-idea/expand_toolbar.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1747190112225" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2510" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M798.165333 524.501333a42.666667 42.666667 0 0 0-60.330666 0L512 750.336l-225.834667-225.834667a42.666667 42.666667 0 0 0-60.330666 60.330667l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330667z" p-id="2511" fill="#222222"></path><path d="M798.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 0L512 451.669333 286.165333 225.834667a42.666667 42.666667 0 0 0-60.330666 60.330666l256 256a42.666667 42.666667 0 0 0 60.330666 0l256-256a42.666667 42.666667 0 0 0 0-60.330666z" p-id="2512" fill="#222222"></path></svg>
|
After Width: | Height: | Size: 891 B |
@ -167,13 +167,16 @@ QToolBar::separator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button {
|
QToolBarExtension#qt_toolbar_ext_button {
|
||||||
background-color: @widgets#qtoolbar#extension#bg;
|
qproperty-icon: url(expand_toolbar.svg);
|
||||||
margin: 30px;
|
background-color: @widgets#qtoolbutton#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension#qt_toolbar_ext_button:hover {
|
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||||
background-color: @widgets#qtoolbar#extension#hover#bg;
|
background-color: @widgets#qtoolbutton#hover#bg;
|
||||||
margin: 30px;
|
}
|
||||||
|
|
||||||
|
QToolBarExtension#qt_toolbar_ext_button:pressed {
|
||||||
|
background-color: @widgets#qtoolbutton#pressed#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QToolButton */
|
/* QToolButton */
|
||||||
|
@ -161,6 +161,11 @@ int main(int argc, char *argv[])
|
|||||||
auto style = VNoteX::getInst().getThemeMgr().fetchQtStyleSheet();
|
auto style = VNoteX::getInst().getThemeMgr().fetchQtStyleSheet();
|
||||||
if (!style.isEmpty()) {
|
if (!style.isEmpty()) {
|
||||||
app.setStyleSheet(style);
|
app.setStyleSheet(style);
|
||||||
|
// Set up hot-reload for the theme folder if enabled via command line
|
||||||
|
if (cmdOptions.m_watchThemes) {
|
||||||
|
const auto themeFolderPath = VNoteX::getInst().getThemeMgr().getCurrentTheme().getThemeFolder();
|
||||||
|
app.watchThemeFolder(themeFolderPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QWidgetAction>
|
||||||
|
|
||||||
#include "propertydefs.h"
|
#include "propertydefs.h"
|
||||||
|
|
||||||
@ -28,8 +29,7 @@
|
|||||||
using namespace vnotex;
|
using namespace vnotex;
|
||||||
|
|
||||||
AttachmentPopup::AttachmentPopup(QToolButton *p_btn, QWidget *p_parent)
|
AttachmentPopup::AttachmentPopup(QToolButton *p_btn, QWidget *p_parent)
|
||||||
: QMenu(p_parent),
|
: ButtonPopup(p_btn, p_parent)
|
||||||
m_button(p_btn)
|
|
||||||
{
|
{
|
||||||
setupUI();
|
setupUI();
|
||||||
|
|
||||||
@ -46,7 +46,8 @@ AttachmentPopup::AttachmentPopup(QToolButton *p_btn, QWidget *p_parent)
|
|||||||
|
|
||||||
void AttachmentPopup::setupUI()
|
void AttachmentPopup::setupUI()
|
||||||
{
|
{
|
||||||
auto mainLayout = new QVBoxLayout(this);
|
QWidget *widget = new QWidget{};
|
||||||
|
auto mainLayout = new QVBoxLayout(widget);
|
||||||
|
|
||||||
const auto &themeMgr = VNoteX::getInst().getThemeMgr();
|
const auto &themeMgr = VNoteX::getInst().getThemeMgr();
|
||||||
|
|
||||||
@ -66,7 +67,7 @@ void AttachmentPopup::setupUI()
|
|||||||
const auto destFolderPath = getDestFolderPath();
|
const auto destFolderPath = getDestFolderPath();
|
||||||
|
|
||||||
auto &sessionConfig = ConfigMgr::getInst().getSessionConfig();
|
auto &sessionConfig = ConfigMgr::getInst().getSessionConfig();
|
||||||
auto files = QFileDialog::getOpenFileNames(this,
|
auto files = QFileDialog::getOpenFileNames(nullptr,
|
||||||
tr("Select Files As Attachments"),
|
tr("Select Files As Attachments"),
|
||||||
sessionConfig.getExternalMediaDefaultPath());
|
sessionConfig.getExternalMediaDefaultPath());
|
||||||
if (files.isEmpty()) {
|
if (files.isEmpty()) {
|
||||||
@ -202,7 +203,9 @@ void AttachmentPopup::setupUI()
|
|||||||
});
|
});
|
||||||
mainLayout->addWidget(m_viewer);
|
mainLayout->addWidget(m_viewer);
|
||||||
|
|
||||||
setMinimumSize(320, 384);
|
widget->setMinimumSize(320, 384);
|
||||||
|
|
||||||
|
addWidget(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolButton *AttachmentPopup::createButton()
|
QToolButton *AttachmentPopup::createButton()
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
#ifndef ATTACHMENTPOPUP_H
|
#ifndef ATTACHMENTPOPUP_H
|
||||||
#define ATTACHMENTPOPUP_H
|
#define ATTACHMENTPOPUP_H
|
||||||
|
|
||||||
#include <QMenu>
|
#include "buttonpopup.h"
|
||||||
|
|
||||||
class QToolButton;
|
|
||||||
|
|
||||||
namespace vnotex
|
namespace vnotex
|
||||||
{
|
{
|
||||||
class FileSystemViewer;
|
class FileSystemViewer;
|
||||||
class Buffer;
|
class Buffer;
|
||||||
|
|
||||||
class AttachmentPopup : public QMenu
|
class AttachmentPopup : public ButtonPopup
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@ -43,9 +41,6 @@ namespace vnotex
|
|||||||
FileSystemViewer *m_viewer = nullptr;
|
FileSystemViewer *m_viewer = nullptr;
|
||||||
|
|
||||||
bool m_needUpdateAttachmentFolder = true;
|
bool m_needUpdateAttachmentFolder = true;
|
||||||
|
|
||||||
// Button for this menu.
|
|
||||||
QToolButton *m_button = nullptr;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "buttonpopup.h"
|
#include "buttonpopup.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QWidgetAction>
|
||||||
|
|
||||||
#include <utils/widgetutils.h>
|
#include <utils/widgetutils.h>
|
||||||
|
|
||||||
@ -10,8 +10,6 @@ ButtonPopup::ButtonPopup(QToolButton *p_btn, QWidget *p_parent)
|
|||||||
: QMenu(p_parent),
|
: QMenu(p_parent),
|
||||||
m_button(p_btn)
|
m_button(p_btn)
|
||||||
{
|
{
|
||||||
setupUI();
|
|
||||||
|
|
||||||
#if defined(Q_OS_MACOS) || defined(Q_OS_MAC)
|
#if defined(Q_OS_MACOS) || defined(Q_OS_MAC)
|
||||||
// Qt::Popup on macOS does not work well with input method.
|
// Qt::Popup on macOS does not work well with input method.
|
||||||
setWindowFlags(Qt::Tool | Qt::NoDropShadowWindowHint);
|
setWindowFlags(Qt::Tool | Qt::NoDropShadowWindowHint);
|
||||||
@ -19,16 +17,10 @@ ButtonPopup::ButtonPopup(QToolButton *p_btn, QWidget *p_parent)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ButtonPopup::setupUI()
|
void ButtonPopup::addWidget(QWidget *p_widget)
|
||||||
{
|
{
|
||||||
auto mainLayout = new QVBoxLayout(this);
|
auto act = new QWidgetAction(this);
|
||||||
WidgetUtils::setContentsMargins(mainLayout);
|
// @act will own @p_widget.
|
||||||
}
|
act->setDefaultWidget(p_widget);
|
||||||
|
addAction(act);
|
||||||
void ButtonPopup::setCentralWidget(QWidget *p_widget)
|
|
||||||
{
|
|
||||||
Q_ASSERT(p_widget);
|
|
||||||
auto mainLayout = layout();
|
|
||||||
Q_ASSERT(mainLayout->count() == 0);
|
|
||||||
mainLayout->addWidget(p_widget);
|
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,7 @@ namespace vnotex
|
|||||||
ButtonPopup(QToolButton *p_btn, QWidget *p_parent = nullptr);
|
ButtonPopup(QToolButton *p_btn, QWidget *p_parent = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setCentralWidget(QWidget *p_widget);
|
void addWidget(QWidget *p_widget);
|
||||||
|
|
||||||
private:
|
|
||||||
void setupUI();
|
|
||||||
|
|
||||||
// Button for this menu.
|
// Button for this menu.
|
||||||
QToolButton *m_button = nullptr;
|
QToolButton *m_button = nullptr;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "outlinepopup.h"
|
#include "outlinepopup.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
#include <core/global.h>
|
#include <core/global.h>
|
||||||
@ -10,8 +9,7 @@
|
|||||||
using namespace vnotex;
|
using namespace vnotex;
|
||||||
|
|
||||||
OutlinePopup::OutlinePopup(QToolButton *p_btn, QWidget *p_parent)
|
OutlinePopup::OutlinePopup(QToolButton *p_btn, QWidget *p_parent)
|
||||||
: QMenu(p_parent),
|
: ButtonPopup(p_btn, p_parent)
|
||||||
m_button(p_btn)
|
|
||||||
{
|
{
|
||||||
setupUI();
|
setupUI();
|
||||||
|
|
||||||
@ -23,13 +21,9 @@ OutlinePopup::OutlinePopup(QToolButton *p_btn, QWidget *p_parent)
|
|||||||
|
|
||||||
void OutlinePopup::setupUI()
|
void OutlinePopup::setupUI()
|
||||||
{
|
{
|
||||||
auto mainLayout = new QVBoxLayout(this);
|
|
||||||
WidgetUtils::setContentsMargins(mainLayout);
|
|
||||||
|
|
||||||
m_viewer = new OutlineViewer(tr("Outline"), this);
|
m_viewer = new OutlineViewer(tr("Outline"), this);
|
||||||
mainLayout->addWidget(m_viewer);
|
m_viewer->setMinimumSize(320, 384);
|
||||||
|
addWidget(m_viewer);
|
||||||
setMinimumSize(320, 384);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutlinePopup::setOutlineProvider(const QSharedPointer<OutlineProvider> &p_provider)
|
void OutlinePopup::setOutlineProvider(const QSharedPointer<OutlineProvider> &p_provider)
|
||||||
@ -39,7 +33,7 @@ void OutlinePopup::setOutlineProvider(const QSharedPointer<OutlineProvider> &p_p
|
|||||||
|
|
||||||
void OutlinePopup::showEvent(QShowEvent* p_event)
|
void OutlinePopup::showEvent(QShowEvent* p_event)
|
||||||
{
|
{
|
||||||
QMenu::showEvent(p_event);
|
ButtonPopup::showEvent(p_event);
|
||||||
|
|
||||||
// Move it to be right-aligned.
|
// Move it to be right-aligned.
|
||||||
if (m_button->isVisible()) {
|
if (m_button->isVisible()) {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#ifndef OUTLINEPOPUP_H
|
#ifndef OUTLINEPOPUP_H
|
||||||
#define OUTLINEPOPUP_H
|
#define OUTLINEPOPUP_H
|
||||||
|
|
||||||
#include <QMenu>
|
#include "buttonpopup.h"
|
||||||
|
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
||||||
class QToolButton;
|
class QToolButton;
|
||||||
@ -11,7 +12,7 @@ namespace vnotex
|
|||||||
class OutlineProvider;
|
class OutlineProvider;
|
||||||
class OutlineViewer;
|
class OutlineViewer;
|
||||||
|
|
||||||
class OutlinePopup : public QMenu
|
class OutlinePopup : public ButtonPopup
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@ -27,9 +28,6 @@ namespace vnotex
|
|||||||
|
|
||||||
// Managed by QObject.
|
// Managed by QObject.
|
||||||
OutlineViewer *m_viewer = nullptr;
|
OutlineViewer *m_viewer = nullptr;
|
||||||
|
|
||||||
// Button with this menu.
|
|
||||||
QToolButton *m_button = nullptr;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
#include "tagpopup.h"
|
#include "tagpopup.h"
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
|
|
||||||
#include <utils/widgetutils.h>
|
#include <utils/widgetutils.h>
|
||||||
#include <buffer/buffer.h>
|
#include <buffer/buffer.h>
|
||||||
|
|
||||||
@ -30,9 +27,8 @@ TagPopup::TagPopup(QToolButton *p_btn, QWidget *p_parent)
|
|||||||
void TagPopup::setupUI()
|
void TagPopup::setupUI()
|
||||||
{
|
{
|
||||||
m_tagViewer = new TagViewer(true, this);
|
m_tagViewer = new TagViewer(true, this);
|
||||||
setCentralWidget(m_tagViewer);
|
m_tagViewer->setMinimumSize(256, 320);
|
||||||
|
addWidget(m_tagViewer);
|
||||||
setMinimumSize(256, 320);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TagPopup::setBuffer(Buffer *p_buffer)
|
void TagPopup::setBuffer(Buffer *p_buffer)
|
||||||
|
@ -70,11 +70,6 @@ void WordCountPopup::updateCount(const ViewWindow::WordCountInfo &p_info)
|
|||||||
|
|
||||||
void WordCountPopup::setupUI()
|
void WordCountPopup::setupUI()
|
||||||
{
|
{
|
||||||
QWidget *mainWidget = new QWidget(this);
|
m_panel = new WordCountPanel(this);
|
||||||
setCentralWidget(mainWidget);
|
addWidget(m_panel);
|
||||||
|
|
||||||
auto mainLayout = new QVBoxLayout(mainWidget);
|
|
||||||
|
|
||||||
m_panel = new WordCountPanel(mainWidget);
|
|
||||||
mainLayout->addWidget(m_panel);
|
|
||||||
}
|
}
|
||||||
|