From 49237ebf032909f3ab0ddfd08838e8db04238d2a Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sun, 19 Nov 2023 16:41:36 +0800 Subject: [PATCH] - change: Use qt.conf to use freetype font engine. User can use the windows default font engine by remove this file. --- NEWS.md | 1 + RedPandaIDE/main.cpp | 10 +++++----- libs/qsynedit/qsynedit/qsynedit.cpp | 4 ++-- packages/msys/build-clang.sh | 2 ++ packages/msys/build-i686.sh | 2 ++ packages/msys/build-x64.sh | 4 +++- packages/msys/build-xp.sh | 2 ++ platform/windows/installer-scripts/redpanda-clang.nsi | 2 ++ .../installer-scripts/redpanda-i686-nocompiler.nsi | 2 ++ platform/windows/installer-scripts/redpanda-i686.nsi | 3 +++ .../windows/installer-scripts/redpanda-nocompiler.nsi | 2 ++ platform/windows/installer-scripts/redpanda-x64.nsi | 2 ++ 12 files changed, 28 insertions(+), 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index a0cbbe07..714ee169 100644 --- a/NEWS.md +++ b/NEWS.md @@ -29,6 +29,7 @@ Red Panda C++ Version 2.26 - fix: Line numbers for problem case input/output/expected texteditors are not vertically centered. - enhancement: E-ink color scheme. - fix: Use the system default encoding for input when running problem cases. + - change: Use qt.conf to set the font engine. User can use the windows default font engine by remove this file. Red Panda C++ Version 2.25 diff --git a/RedPandaIDE/main.cpp b/RedPandaIDE/main.cpp index 64a82488..e54bc137 100644 --- a/RedPandaIDE/main.cpp +++ b/RedPandaIDE/main.cpp @@ -250,11 +250,11 @@ void setTheme(const QString& theme) { int main(int argc, char *argv[]) { -#ifdef Q_OS_WINDOWS - // Make title bar and palette follow system-wide dark mode setting on recent Windows releases. - // Use freetype as the fontengine - qputenv("QT_QPA_PLATFORM", "windows:darkmode=2:fontengine=freetype"); -#endif +//#ifdef Q_OS_WINDOWS +// // Make title bar and palette follow system-wide dark mode setting on recent Windows releases. +// // Use freetype as the fontengine +// qputenv("QT_QPA_PLATFORM", "windows:darkmode=2:fontengine=freetype"); +//#endif #ifdef Q_OS_MACOS // in macOS GUI apps, `/usr/local/bin` is not in PATH by default diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index 29af1fa4..fe81de51 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -6239,7 +6239,7 @@ void QSynEdit::mouseReleaseEvent(QMouseEvent *event) int X=event->pos().x(); /* int Y=event->pos().y(); */ - if (!mMouseMoved && (X < mGutterWidth + 2)) { + if (!mMouseMoved && (X <= mGutterWidth )) { processGutterClick(event); } @@ -6295,7 +6295,7 @@ void QSynEdit::mouseDoubleClickEvent(QMouseEvent *event) { QAbstractScrollArea::mouseDoubleClickEvent(event); QPoint ptMouse = event->pos(); - if (ptMouse.x() >= mGutterWidth + 2) { + if (ptMouse.x() >= mGutterWidth) { if (mOptions.testFlag(EditorOption::eoSelectWordByDblClick)) setSelWord(); mStateFlags.setFlag(StateFlag::sfDblClicked); diff --git a/packages/msys/build-clang.sh b/packages/msys/build-clang.sh index 774d8130..8a6f510f 100644 --- a/packages/msys/build-clang.sh +++ b/packages/msys/build-clang.sh @@ -57,6 +57,8 @@ pushd . cd "${PACKAGE_DIR}" ln -s "${MINGW}" $MinGW_NAME +cp "${SOURCE_DIR}/platform/windows/qt.conf" . + cp "${SOURCE_DIR}/windows/installer-scripts/lang.nsh" . cp "${SOURCE_DIR}/windows/installer-scripts/redpanda-clang.nsi" . diff --git a/packages/msys/build-i686.sh b/packages/msys/build-i686.sh index 5a6b4a79..2d8a3384 100644 --- a/packages/msys/build-i686.sh +++ b/packages/msys/build-i686.sh @@ -29,6 +29,8 @@ echo "Making no-compiler installer ..." pushd . cd "${PACKAGE_DIR}" +cp "${SOURCE_DIR}/platform/windows/qt.conf" . + cp "${SOURCE_DIR}/platform/windows/installer-scripts/lang.nsh" . cp "${SOURCE_DIR}/platform/windows/installer-scripts/redpanda-i686-nocompiler.nsi" . diff --git a/packages/msys/build-x64.sh b/packages/msys/build-x64.sh index 3d2b9835..c782c537 100644 --- a/packages/msys/build-x64.sh +++ b/packages/msys/build-x64.sh @@ -1,6 +1,6 @@ #!/bin/bash -TARGET_DIR="/r/" +TARGET_DIR="/z/" BUILD_DIR="${TEMP}/redpandacpp-build" PACKAGE_DIR="${TEMP}/RedPanda-CPP" GCC_DIR="/mingw64" @@ -29,6 +29,8 @@ echo "Making no-compiler installer ..." pushd . cd "${PACKAGE_DIR}" +cp "${SOURCE_DIR}/platform/windows/qt.conf" . + cp "${SOURCE_DIR}/platform/windows/installer-scripts/lang.nsh" . cp "${SOURCE_DIR}/platform/windows/installer-scripts/redpanda-nocompiler.nsi" . diff --git a/packages/msys/build-xp.sh b/packages/msys/build-xp.sh index da08822b..4fd5b7fd 100644 --- a/packages/msys/build-xp.sh +++ b/packages/msys/build-xp.sh @@ -33,6 +33,8 @@ echo "Making no-compiler installer ..." pushd . cd "${PACKAGE_DIR}" +cp "${SOURCE_DIR}/platform/windows/qt.conf" . + cp "${SOURCE_DIR}/platform/windows/installer-scripts/lang.nsh" . cp "${SOURCE_DIR}/platform/windows/installer-scripts/redpanda-i686-nocompiler.nsi" . diff --git a/platform/windows/installer-scripts/redpanda-clang.nsi b/platform/windows/installer-scripts/redpanda-clang.nsi index e1b734f7..dcb4c56a 100644 --- a/platform/windows/installer-scripts/redpanda-clang.nsi +++ b/platform/windows/installer-scripts/redpanda-clang.nsi @@ -93,6 +93,7 @@ Section "$(SectionMainName)" SectionMain File "LICENSE" File "NEWS.md" File "README.md" + File "qt.conf" ; Write required paths SetOutPath $INSTDIR\Templates @@ -464,6 +465,7 @@ Section "Uninstall" Delete "$INSTDIR\astyle.exe" Delete "$INSTDIR\LICENSE" Delete "$INSTDIR\README.md" + Delete "$INSTDIR\qt.conf" RMDir /r "$INSTDIR\Lang" RMDir /r "$INSTDIR\Templates" diff --git a/platform/windows/installer-scripts/redpanda-i686-nocompiler.nsi b/platform/windows/installer-scripts/redpanda-i686-nocompiler.nsi index 95bc6e96..620ec87f 100644 --- a/platform/windows/installer-scripts/redpanda-i686-nocompiler.nsi +++ b/platform/windows/installer-scripts/redpanda-i686-nocompiler.nsi @@ -93,6 +93,7 @@ Section "$(SectionMainName)" SectionMain File "LICENSE" File "NEWS.md" File "README.md" + File "qt.conf" ; Write required paths SetOutPath $INSTDIR\Templates @@ -456,6 +457,7 @@ Section "Uninstall" Delete "$INSTDIR\astyle.exe" Delete "$INSTDIR\LICENSE" Delete "$INSTDIR\README.md" + Delete "$INSTDIR\qt.conf" RMDir /r "$INSTDIR\Lang" RMDir /r "$INSTDIR\Templates" diff --git a/platform/windows/installer-scripts/redpanda-i686.nsi b/platform/windows/installer-scripts/redpanda-i686.nsi index 26040c82..6ef00e16 100644 --- a/platform/windows/installer-scripts/redpanda-i686.nsi +++ b/platform/windows/installer-scripts/redpanda-i686.nsi @@ -93,6 +93,7 @@ Section "$(SectionMainName)" SectionMain File "LICENSE" File "NEWS.md" File "README.md" + File "qt.conf" ; Write required paths SetOutPath $INSTDIR\Templates @@ -462,6 +463,8 @@ Section "Uninstall" Delete "$INSTDIR\astyle.exe" Delete "$INSTDIR\LICENSE" Delete "$INSTDIR\README.md" + Delete "$INSTDIR\qt.conf" + RMDir /r "$INSTDIR\Lang" RMDir /r "$INSTDIR\Templates" diff --git a/platform/windows/installer-scripts/redpanda-nocompiler.nsi b/platform/windows/installer-scripts/redpanda-nocompiler.nsi index 9f1e9d67..334838b0 100644 --- a/platform/windows/installer-scripts/redpanda-nocompiler.nsi +++ b/platform/windows/installer-scripts/redpanda-nocompiler.nsi @@ -92,6 +92,7 @@ Section "$(SectionMainName)" SectionMain File "LICENSE" File "NEWS.md" File "README.md" + File "qt.conf" ; Write required paths SetOutPath $INSTDIR\Templates @@ -455,6 +456,7 @@ Section "Uninstall" Delete "$INSTDIR\astyle.exe" Delete "$INSTDIR\LICENSE" Delete "$INSTDIR\README.md" + Delete "$INSTDIR\qt.conf" RMDir /r "$INSTDIR\Lang" RMDir /r "$INSTDIR\Templates" diff --git a/platform/windows/installer-scripts/redpanda-x64.nsi b/platform/windows/installer-scripts/redpanda-x64.nsi index e74940cd..83891f2a 100644 --- a/platform/windows/installer-scripts/redpanda-x64.nsi +++ b/platform/windows/installer-scripts/redpanda-x64.nsi @@ -94,6 +94,7 @@ Section "$(SectionMainName)" SectionMain File "LICENSE" File "NEWS.md" File "README.md" + File "qt.conf" ; Write required paths SetOutPath $INSTDIR\Templates @@ -465,6 +466,7 @@ Section "Uninstall" Delete "$INSTDIR\astyle.exe" Delete "$INSTDIR\LICENSE" Delete "$INSTDIR\README.md" + Delete "$INSTDIR\qt.conf" RMDir /r "$INSTDIR\Lang" RMDir /r "$INSTDIR\Templates"