From 0b158fcfc2ca8ea04a0dd07a711073217e19e68d Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Thu, 14 Jul 2022 13:43:33 +0300 Subject: [PATCH] Fix placeholder text margins (#1093) IB-7450 Signed-off-by: Raul Metsma --- .github/workflows/build.yml | 20 ++++++++++---------- CMakeLists.txt | 11 +++++------ RELEASE-NOTES.md | 6 ++++++ client/widgets/LineEdit.cpp | 12 ++++++++++-- 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6f4d6c17..d390eec85 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: MACOSX_DEPLOYMENT_TARGET: 10.14 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Download artifact @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: | HASH=($(shasum prepare_osx_build_environment.sh)) - curl -O -L -s https://installer.id.ee/media/github/opensc_0.20.0.2.pkg + curl -O -L -s https://installer.id.ee/media/github/opensc_0.22.0.pkg curl -O -L -s https://installer.id.ee/media/github/${HASH}.zip sudo installer -verboseR -pkg libdigidocpp-pkg/libdigidocpp*.pkg -target / sudo installer -verboseR -pkg opensc_*.pkg -target / @@ -40,7 +40,7 @@ jobs: -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -B build -S . cmake --build build --target zipdebug macdeployqt zip - name: Archive artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: pkgs path: build/qdigidoc4*.zip @@ -86,7 +86,7 @@ jobs: - name: Lintian run: lintian *.deb; - name: Archive artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: debs path: qdigidoc4*.* @@ -96,7 +96,7 @@ jobs: container: ${{ matrix.container }} strategy: matrix: - container: ['fedora:34'] + container: ['fedora:35'] env: MAKEFLAGS: -j3 steps: @@ -121,7 +121,7 @@ jobs: cmake -DCMAKE_INSTALL_PREFIX=/usr -B build -S . cmake --build build --target all package - name: Archive artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: rpms path: build/qdigidoc4*.rpm @@ -153,7 +153,7 @@ jobs: toolset: 14.29 - vcver: 142 arch: x64 - qtver: 6.3.0 + qtver: 6.3.1 qtmodules: qt5compat qt: win64_msvc2019_64 image: windows-2019 @@ -162,7 +162,7 @@ jobs: VER_SUFFIX: .VS${{ matrix.vcver }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Download artifact @@ -206,7 +206,7 @@ jobs: cmake --build build --target msi cmake --build build --target appx - name: Archive artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: msi path: | @@ -221,7 +221,7 @@ jobs: PROJECTNAME: open-eid/DigiDoc4-Client steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Install dependencies diff --git a/CMakeLists.txt b/CMakeLists.txt index f2a622288..e7f2c97bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,13 +24,12 @@ set_env( SMARTID_URL "https://dd-sid.ria.ee/v1" CACHE STRING "URL for Smart-ID" set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG NO) set(CPACK_PACKAGE_VERSION ${VERSION}) -set(CPACK_GENERATOR "RPM") -set(CPACK_PACKAGE_NAME "qdigidoc4") -set(CPACK_PACKAGE_RELEASE 1) +set(CPACK_GENERATOR RPM) set(CPACK_PACKAGE_CONTACT "RIA ") -set(CPACK_PACKAGE_VENDOR "RIA") -set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/") -set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}") +set(CPACK_PACKAGE_VENDOR RIA) +set(CPACK_PACKAGING_INSTALL_PREFIX /usr) +set(CPACK_RPM_FILE_NAME RPM-DEFAULT) +set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) include(CPack) if(APPLE) add_subdirectory(extensions/DigiDocQL) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index f63a17862..70a8312c4 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,9 @@ +DigiDoc4 version [4.2.12](https://github.com/open-eid/DigiDoc4-Client/releases/tag/v4.2.12) release notes +-------------------------------------- +- Code, Text and translation improvements and updates + +[Full Changelog](https://github.com/open-eid/DigiDoc4-Client/compare/v4.2.11...v4.2.12) + DigiDoc4 version [4.2.11](https://github.com/open-eid/DigiDoc4-Client/releases/tag/v4.2.11) release notes -------------------------------------- - Code, Text and translation improvements and updates diff --git a/client/widgets/LineEdit.cpp b/client/widgets/LineEdit.cpp index 2da21544d..36544a31d 100644 --- a/client/widgets/LineEdit.cpp +++ b/client/widgets/LineEdit.cpp @@ -20,6 +20,7 @@ #include "LineEdit.h" #include +#include LineEdit::LineEdit(QWidget *parent) : QLineEdit(parent) @@ -34,17 +35,24 @@ void LineEdit::paintEvent(QPaintEvent *event) if(!placeholderText().isEmpty()) { placeholder = placeholderText(); - setPlaceholderText(QString()); + setPlaceholderText({}); } QLineEdit::paintEvent(event); + QStyleOptionFrame opt; + initStyleOption(&opt); QPainter p(this); +#ifdef Q_OS_WIN + QRect lineRect = style()->subElementRect(QStyle::SE_LineEditContents, &opt, this); +#else + QRect lineRect = rect(); +#endif + p.setClipRect(lineRect); QColor color = palette().color(QPalette::PlaceholderText); color.setAlpha(63); p.setPen(color); QFontMetrics fm = fontMetrics(); int minLB = qMax(0, -fm.minLeftBearing()); - QRect lineRect = this->rect(); QRect ph = lineRect.adjusted(minLB + 3, 0, 0, 0); QString elidedText = fm.elidedText(placeholder, Qt::ElideRight, ph.width()); p.drawText(ph, Qt::AlignVCenter, elidedText);