Hello community, here is the log from the commit of package kColorPicker for openSUSE:Factory checked in at 2020-02-27 14:41:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kColorPicker (Old) and /work/SRC/openSUSE:Factory/.kColorPicker.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kColorPicker" Thu Feb 27 14:41:31 2020 rev:2 rq:779830 version:0.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/kColorPicker/kColorPicker.changes 2020-01-14 21:10:45.486859376 +0100 +++ /work/SRC/openSUSE:Factory/.kColorPicker.new.26092/kColorPicker.changes 2020-02-27 14:42:00.134609672 +0100 @@ -1,0 +2,6 @@ +Wed Feb 26 13:53:35 UTC 2020 - Martin Hauke <mar...@gmx.de> + +- Update to version 0.1.1 + * Fix scaling issue with hidpi + +------------------------------------------------------------------- Old: ---- kColorPicker-0.1.0.tar.gz New: ---- kColorPicker-0.1.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kColorPicker.spec ++++++ --- /var/tmp/diff_new_pack.FgL1m8/_old 2020-02-27 14:42:01.262611999 +0100 +++ /var/tmp/diff_new_pack.FgL1m8/_new 2020-02-27 14:42:01.270612016 +0100 @@ -1,7 +1,7 @@ # # spec file for package kColorPicker # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,10 +15,11 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # -%define sover 0_1_0 + +%define sover 0_1_1 %define libname libkColorPicker%{sover} Name: kColorPicker -Version: 0.1.0 +Version: 0.1.1 Release: 0 Summary: Qt based Color Picker with popup menu License: GPL-2.0-or-later @@ -29,8 +30,8 @@ BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig -BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5Test) +BuildRequires: pkgconfig(Qt5Widgets) %description QToolButton with color popup menu with lets you select a color. The popup ++++++ kColorPicker-0.1.0.tar.gz -> kColorPicker-0.1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kColorPicker-0.1.0/.github/FUNDING.yml new/kColorPicker-0.1.1/.github/FUNDING.yml --- old/kColorPicker-0.1.0/.github/FUNDING.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/kColorPicker-0.1.1/.github/FUNDING.yml 2020-02-21 21:54:56.000000000 +0100 @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +github: [DamirPorobic] +custom: paypal.me/damirporobic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kColorPicker-0.1.0/CMakeLists.txt new/kColorPicker-0.1.1/CMakeLists.txt --- old/kColorPicker-0.1.0/CMakeLists.txt 2019-10-01 22:03:40.000000000 +0200 +++ new/kColorPicker-0.1.1/CMakeLists.txt 2020-02-21 21:54:56.000000000 +0100 @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5) -project(kColorPicker LANGUAGES CXX VERSION 0.1.0) +project(kColorPicker LANGUAGES CXX VERSION 0.1.1) set(QT_MIN_VERSION "5.6.1") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kColorPicker-0.1.0/README.md new/kColorPicker-0.1.1/README.md --- old/kColorPicker-0.1.0/README.md 2019-10-01 22:03:40.000000000 +0200 +++ new/kColorPicker-0.1.1/README.md 2020-02-21 21:54:56.000000000 +0100 @@ -1,13 +1,13 @@ -# kColorPicker [![Build Status](https://travis-ci.org/DamirPorobic/kColorPicker.svg?branch=master)](https://travis-ci.org/DamirPorobic/kColorPicker) +# kColorPicker [![Build Status](https://travis-ci.org/ksnip/kColorPicker.svg?branch=master)](https://travis-ci.org/ksnip/kColorPicker) QToolButton with color popup menu with lets you select a color. The popup features a color dialog button which can be used to add custom colors to the popup menu. -Version 0.1.0 +Version 0.1.1 ![kColorPicker](https://i.imgur.com/VkhUvFa.png "kColorPicker") ### Building from source 1. Get latest release from GitHub by cloning the repo: - `$ git clone https://github.com/DamirPorobic/kColorPicker` + `$ git clone https://github.com/ksnip/kColorPicker` 2. Change to repo directory: `$ cd kColorPicker` 3. Make new build directory and enter it: @@ -33,4 +33,4 @@ `find_package(kColorPicker ${KCOLORPICKER_MIN_VERSION} REQUIRED)` 2. Link the library with your application - `target_link_libraries(myApp kColorPicker)` \ No newline at end of file + `target_link_libraries(myApp kColorPicker)` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kColorPicker-0.1.0/src/IconCreator.h new/kColorPicker-0.1.1/src/IconCreator.h --- old/kColorPicker-0.1.0/src/IconCreator.h 2019-10-01 22:03:40.000000000 +0200 +++ new/kColorPicker-0.1.1/src/IconCreator.h 2020-02-21 21:54:56.000000000 +0100 @@ -31,7 +31,7 @@ public: explicit IconCreator() = delete; ~IconCreator() = delete; - static QIcon createIcon(const QColor &color, const QSize &size = QSize(25, 25)); + static QIcon createIcon(const QColor &color, const QSize &size); }; } // namespace kColorPicker diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kColorPicker-0.1.0/src/PopupMenu.cpp new/kColorPicker-0.1.1/src/PopupMenu.cpp --- old/kColorPicker-0.1.0/src/PopupMenu.cpp 2019-10-01 22:03:40.000000000 +0200 +++ new/kColorPicker-0.1.1/src/PopupMenu.cpp 2020-02-21 21:54:56.000000000 +0100 @@ -76,10 +76,16 @@ ColorButton *PopupMenu::createButton(const QColor &color) { - auto icon = IconCreator::createIcon(color); + auto iconSize = getIconSize(); + auto icon = IconCreator::createIcon(color, iconSize); auto button = new ColorButton(icon, color); return button; } +QSize PopupMenu::getIconSize() const +{ auto xScaleFactor = logicalDpiX() / 96.0; + auto yScaleFactor = logicalDpiY() / 96.0; + return {static_cast<int>(25 * xScaleFactor), static_cast<int>(25 * yScaleFactor) }; +} void PopupMenu::addColorButton(const QColor &color) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kColorPicker-0.1.0/src/PopupMenu.h new/kColorPicker-0.1.1/src/PopupMenu.h --- old/kColorPicker-0.1.0/src/PopupMenu.h 2019-10-01 22:03:40.000000000 +0200 +++ new/kColorPicker-0.1.1/src/PopupMenu.h 2020-02-21 21:54:56.000000000 +0100 @@ -57,6 +57,7 @@ private slots: void colorSelected(const QColor &color); + QSize getIconSize() const; }; } // namespace kColorPicker diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kColorPicker-0.1.0/src/buttons/AbstractPopupMenuButton.cpp new/kColorPicker-0.1.1/src/buttons/AbstractPopupMenuButton.cpp --- old/kColorPicker-0.1.0/src/buttons/AbstractPopupMenuButton.cpp 2019-10-01 22:03:40.000000000 +0200 +++ new/kColorPicker-0.1.1/src/buttons/AbstractPopupMenuButton.cpp 2020-02-21 21:54:56.000000000 +0100 @@ -23,10 +23,16 @@ AbstractPopupMenuButton::AbstractPopupMenuButton(const QIcon &icon) { - setIcon(icon); - setFixedSize(iconSize() + QSize(4,4)); + setIcon(icon); + setFixedSize(getSizeBasedOnIcon()); connect(this, &QToolButton::clicked, this, &AbstractPopupMenuButton::buttonClicked); } +QSize AbstractPopupMenuButton::getSizeBasedOnIcon() const +{ + auto xScaleFactor = logicalDpiX() / 96.0; + auto yScaleFactor = logicalDpiY() / 96.0; + return iconSize() + QSize(static_cast<int>(4 * xScaleFactor), static_cast<int>(4 * yScaleFactor)); +} void AbstractPopupMenuButton::paintEvent(QPaintEvent *event) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kColorPicker-0.1.0/src/buttons/AbstractPopupMenuButton.h new/kColorPicker-0.1.1/src/buttons/AbstractPopupMenuButton.h --- old/kColorPicker-0.1.0/src/buttons/AbstractPopupMenuButton.h 2019-10-01 22:03:40.000000000 +0200 +++ new/kColorPicker-0.1.1/src/buttons/AbstractPopupMenuButton.h 2020-02-21 21:54:56.000000000 +0100 @@ -39,6 +39,7 @@ protected slots: void paintEvent(QPaintEvent *event) override; virtual void buttonClicked() = 0; + QSize getSizeBasedOnIcon() const; }; } // namespace kColorPicker