summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2019-07-15 21:49:34 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2019-07-15 22:51:57 +0200
commitbdf9052b496d97f1e0d6f882dfa7fcf160397d70 (patch)
tree1d5c8757da25fbd82cbe4a5233d86ff84f8115d1
parentkde-misc/krusader: Drop 2.7.1 (r0) (diff)
downloadgentoo-bdf9052b496d97f1e0d6f882dfa7fcf160397d70.tar.gz
gentoo-bdf9052b496d97f1e0d6f882dfa7fcf160397d70.tar.bz2
gentoo-bdf9052b496d97f1e0d6f882dfa7fcf160397d70.zip
kde-misc/skanlite: EAPI-7 bump, HiDPI fix
Package-Manager: Portage-2.3.69, Repoman-2.3.16 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
-rw-r--r--kde-misc/skanlite/files/skanlite-2.1.0.1-hidpi.patch67
-rw-r--r--kde-misc/skanlite/skanlite-2.1.0.1-r1.ebuild37
2 files changed, 104 insertions, 0 deletions
diff --git a/kde-misc/skanlite/files/skanlite-2.1.0.1-hidpi.patch b/kde-misc/skanlite/files/skanlite-2.1.0.1-hidpi.patch
new file mode 100644
index 000000000000..563f5950063a
--- /dev/null
+++ b/kde-misc/skanlite/files/skanlite-2.1.0.1-hidpi.patch
@@ -0,0 +1,67 @@
+From cb382f87d63bdc3736696ee289875bde2ecee9e5 Mon Sep 17 00:00:00 2001
+From: Alexander Volkov <a.volkov@rusbitech.ru>
+Date: Thu, 25 Apr 2019 18:09:59 +0300
+Subject: Add HiDPI support
+
+Reviewers: sars, davidedmundson, ngraham
+
+Reviewed By: sars
+
+Differential Revision: https://phabricator.kde.org/D20821
+---
+ src/ImageViewer.cpp | 14 +++++++++++---
+ src/main.cpp | 1 +
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/src/ImageViewer.cpp b/src/ImageViewer.cpp
+index 09f9b3d..5cf1439 100644
+--- a/src/ImageViewer.cpp
++++ b/src/ImageViewer.cpp
+@@ -87,14 +87,19 @@ void ImageViewer::setQImage(QImage *img)
+ }
+
+ d->img = img;
+- d->scene->setSceneRect(0, 0, img->width(), img->height());
++ const auto dpr = devicePixelRatioF();
++ d->img->setDevicePixelRatio(dpr);
++ d->scene->setSceneRect(0, 0, img->width() / dpr, img->height() / dpr);
+ }
+
+ // ------------------------------------------------------------------------
+ void ImageViewer::drawBackground(QPainter *painter, const QRectF &rect)
+ {
+ painter->fillRect(rect, QColor(0x70, 0x70, 0x70));
+- painter->drawImage(rect, *d->img, rect);
++ QRectF r = rect & sceneRect();
++ const auto dpr = d->img->devicePixelRatio();
++ QRectF srcRect = QRectF(r.topLeft() * dpr, r.size() * dpr);
++ painter->drawImage(r, *d->img, srcRect);
+ }
+
+ // ------------------------------------------------------------------------
+@@ -118,7 +123,10 @@ void ImageViewer::zoomActualSize()
+ // ------------------------------------------------------------------------
+ void ImageViewer::zoom2Fit()
+ {
+- fitInView(d->img->rect(), Qt::KeepAspectRatio);
++ QRectF r = d->img->rect();
++ const auto dpr = d->img->devicePixelRatio();
++ r = QRectF(r.topLeft() / dpr, r.size() / dpr);
++ fitInView(r, Qt::KeepAspectRatio);
+ }
+
+ // ------------------------------------------------------------------------
+diff --git a/src/main.cpp b/src/main.cpp
+index aa704be..ae0d9b6 100644
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -34,6 +34,7 @@
+
+ int main(int argc, char *argv[])
+ {
++ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+ QApplication app(argc, argv);
+
+ Kdelibs4ConfigMigrator migrate(QLatin1String("Skanlite"));
+--
+cgit v1.1
diff --git a/kde-misc/skanlite/skanlite-2.1.0.1-r1.ebuild b/kde-misc/skanlite/skanlite-2.1.0.1-r1.ebuild
new file mode 100644
index 000000000000..dec84c60dfe1
--- /dev/null
+++ b/kde-misc/skanlite/skanlite-2.1.0.1-r1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+KDE_HANDBOOK="forceoptional"
+KDE_TEST="forceoptional"
+inherit kde5
+
+DESCRIPTION="KDE image scanning application"
+HOMEPAGE="https://kde.org/applications/graphics/skanlite"
+SRC_URI="mirror://kde/stable/${PN}/2.1/${P}.tar.xz"
+
+LICENSE="|| ( GPL-2 GPL-3 ) handbook? ( FDL-1.2+ )"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="
+ $(add_frameworks_dep kconfig)
+ $(add_frameworks_dep kconfigwidgets)
+ $(add_frameworks_dep kcoreaddons)
+ $(add_frameworks_dep ki18n)
+ $(add_frameworks_dep kio)
+ $(add_frameworks_dep kjobwidgets)
+ $(add_frameworks_dep kwidgetsaddons)
+ $(add_frameworks_dep kxmlgui)
+ $(add_kdeapps_dep libksane)
+ $(add_qt_dep qtgui)
+ $(add_qt_dep qtwidgets)
+ media-libs/libpng:0=
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-cmake.patch"
+ "${FILESDIR}/${P}-hidpi.patch"
+)