Skip to content

Commit 0b158fc

Browse files
authored
Fix placeholder text margins (#1093)
IB-7450 Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent 3365785 commit 0b158fc

File tree

4 files changed

+31
-18
lines changed

4 files changed

+31
-18
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
MACOSX_DEPLOYMENT_TARGET: 10.14
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515
with:
1616
submodules: recursive
1717
- name: Download artifact
@@ -25,7 +25,7 @@ jobs:
2525
- name: Install dependencies
2626
run: |
2727
HASH=($(shasum prepare_osx_build_environment.sh))
28-
curl -O -L -s https://installer.id.ee/media/github/opensc_0.20.0.2.pkg
28+
curl -O -L -s https://installer.id.ee/media/github/opensc_0.22.0.pkg
2929
curl -O -L -s https://installer.id.ee/media/github/${HASH}.zip
3030
sudo installer -verboseR -pkg libdigidocpp-pkg/libdigidocpp*.pkg -target /
3131
sudo installer -verboseR -pkg opensc_*.pkg -target /
@@ -40,7 +40,7 @@ jobs:
4040
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -B build -S .
4141
cmake --build build --target zipdebug macdeployqt zip
4242
- name: Archive artifacts
43-
uses: actions/upload-artifact@v2
43+
uses: actions/upload-artifact@v3
4444
with:
4545
name: pkgs
4646
path: build/qdigidoc4*.zip
@@ -86,7 +86,7 @@ jobs:
8686
- name: Lintian
8787
run: lintian *.deb;
8888
- name: Archive artifacts
89-
uses: actions/upload-artifact@v2
89+
uses: actions/upload-artifact@v3
9090
with:
9191
name: debs
9292
path: qdigidoc4*.*
@@ -96,7 +96,7 @@ jobs:
9696
container: ${{ matrix.container }}
9797
strategy:
9898
matrix:
99-
container: ['fedora:34']
99+
container: ['fedora:35']
100100
env:
101101
MAKEFLAGS: -j3
102102
steps:
@@ -121,7 +121,7 @@ jobs:
121121
cmake -DCMAKE_INSTALL_PREFIX=/usr -B build -S .
122122
cmake --build build --target all package
123123
- name: Archive artifacts
124-
uses: actions/upload-artifact@v2
124+
uses: actions/upload-artifact@v3
125125
with:
126126
name: rpms
127127
path: build/qdigidoc4*.rpm
@@ -153,7 +153,7 @@ jobs:
153153
toolset: 14.29
154154
- vcver: 142
155155
arch: x64
156-
qtver: 6.3.0
156+
qtver: 6.3.1
157157
qtmodules: qt5compat
158158
qt: win64_msvc2019_64
159159
image: windows-2019
@@ -162,7 +162,7 @@ jobs:
162162
VER_SUFFIX: .VS${{ matrix.vcver }}
163163
steps:
164164
- name: Checkout
165-
uses: actions/checkout@v2
165+
uses: actions/checkout@v3
166166
with:
167167
submodules: recursive
168168
- name: Download artifact
@@ -206,7 +206,7 @@ jobs:
206206
cmake --build build --target msi
207207
cmake --build build --target appx
208208
- name: Archive artifacts
209-
uses: actions/upload-artifact@v2
209+
uses: actions/upload-artifact@v3
210210
with:
211211
name: msi
212212
path: |
@@ -221,7 +221,7 @@ jobs:
221221
PROJECTNAME: open-eid/DigiDoc4-Client
222222
steps:
223223
- name: Checkout
224-
uses: actions/checkout@v2
224+
uses: actions/checkout@v3
225225
with:
226226
submodules: recursive
227227
- name: Install dependencies

CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ set_env( SMARTID_URL "https://dd-sid.ria.ee/v1" CACHE STRING "URL for Smart-ID"
2424
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES)
2525
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG NO)
2626
set(CPACK_PACKAGE_VERSION ${VERSION})
27-
set(CPACK_GENERATOR "RPM")
28-
set(CPACK_PACKAGE_NAME "qdigidoc4")
29-
set(CPACK_PACKAGE_RELEASE 1)
27+
set(CPACK_GENERATOR RPM)
3028
set(CPACK_PACKAGE_CONTACT "RIA <info@ria.ee>")
31-
set(CPACK_PACKAGE_VENDOR "RIA")
32-
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/")
33-
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
29+
set(CPACK_PACKAGE_VENDOR RIA)
30+
set(CPACK_PACKAGING_INSTALL_PREFIX /usr)
31+
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
32+
set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
3433
include(CPack)
3534
if(APPLE)
3635
add_subdirectory(extensions/DigiDocQL)

RELEASE-NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
DigiDoc4 version [4.2.12](https://github.com/open-eid/DigiDoc4-Client/releases/tag/v4.2.12) release notes
2+
--------------------------------------
3+
- Code, Text and translation improvements and updates
4+
5+
[Full Changelog](https://github.com/open-eid/DigiDoc4-Client/compare/v4.2.11...v4.2.12)
6+
17
DigiDoc4 version [4.2.11](https://github.com/open-eid/DigiDoc4-Client/releases/tag/v4.2.11) release notes
28
--------------------------------------
39
- Code, Text and translation improvements and updates

client/widgets/LineEdit.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "LineEdit.h"
2121

2222
#include <QtGui/QPainter>
23+
#include <QtWidgets/QStyleOptionButton>
2324

2425
LineEdit::LineEdit(QWidget *parent)
2526
: QLineEdit(parent)
@@ -34,17 +35,24 @@ void LineEdit::paintEvent(QPaintEvent *event)
3435
if(!placeholderText().isEmpty())
3536
{
3637
placeholder = placeholderText();
37-
setPlaceholderText(QString());
38+
setPlaceholderText({});
3839
}
3940
QLineEdit::paintEvent(event);
4041

42+
QStyleOptionFrame opt;
43+
initStyleOption(&opt);
4144
QPainter p(this);
45+
#ifdef Q_OS_WIN
46+
QRect lineRect = style()->subElementRect(QStyle::SE_LineEditContents, &opt, this);
47+
#else
48+
QRect lineRect = rect();
49+
#endif
50+
p.setClipRect(lineRect);
4251
QColor color = palette().color(QPalette::PlaceholderText);
4352
color.setAlpha(63);
4453
p.setPen(color);
4554
QFontMetrics fm = fontMetrics();
4655
int minLB = qMax(0, -fm.minLeftBearing());
47-
QRect lineRect = this->rect();
4856
QRect ph = lineRect.adjusted(minLB + 3, 0, 0, 0);
4957
QString elidedText = fm.elidedText(placeholder, Qt::ElideRight, ph.width());
5058
p.drawText(ph, Qt::AlignVCenter, elidedText);

0 commit comments

Comments
 (0)