From 1e0b92fdfb10da0458d24383ae31956a9bf373f6 Mon Sep 17 00:00:00 2001 From: octaeder <102688820+octaeder@users.noreply.github.com> Date: Mon, 27 May 2024 11:56:31 +0200 Subject: [PATCH] fix line number visibility in Orion dark and alignment QLineEdit vs. QTextEdit --- src/pdfviewer/PDFDocument.cpp | 8 ++++---- utilities/stylesheet_francesco.qss | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pdfviewer/PDFDocument.cpp b/src/pdfviewer/PDFDocument.cpp index 723509b69d..0ff4ed7f11 100644 --- a/src/pdfviewer/PDFDocument.cpp +++ b/src/pdfviewer/PDFDocument.cpp @@ -3714,12 +3714,12 @@ void PDFDocument::loadCurrentFile(bool fillCache) pdfWidget->setFocus(); // set page viewer only once - int maxDigits = 1 + qFloor(log10(pdfWidget->realNumPages())); - //if (maxDigits < 2) maxDigits = 2; + int maxDigits = 1 + qFloor(log10(pdfWidget->realNumPages())); leCurrentPage->setMaxLength(maxDigits); - leCurrentPage->setFixedWidth(UtilsUi::getFmWidth(leCurrentPage->fontMetrics(), QString(maxDigits + 1, '#'))); + int numWidth = UtilsUi::getFmWidth(leCurrentPage->fontMetrics(), QString(maxDigits, '#')) + 8; + leCurrentPage->setFixedWidth(numWidth); leCurrentPageValidator->setTop(pdfWidget->realNumPages()); - //qDebug() << pdfWidget->realNumPages() << maxDigits << UtilsUi::getFmWidth(leCurrentPage->fontMetrics(), QString(maxDigits + 1, '#'))<realNumPages() << maxDigits << numWidth; loadSyncData(); if (fillCache) { diff --git a/utilities/stylesheet_francesco.qss b/utilities/stylesheet_francesco.qss index 946912c44f..b29d3f3ed0 100644 --- a/utilities/stylesheet_francesco.qss +++ b/utilities/stylesheet_francesco.qss @@ -270,7 +270,7 @@ QSlider:focus { QLineEdit { background-color: #232629; - padding: 5px; + padding: 2px; border-style: solid; border: 1px solid #76797C; border-radius: 2px;