[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [breeze/Plasma/5.8] kstyle: The combobox needs to be 2 pixels wider for contents to fit
From:       Hugo Pereira Da Costa <hugo.pereira.da.costa () gmail ! com>
Date:       2016-10-31 17:24:06
Message-ID: E1c1GJa-0001Bm-5K () code ! kde ! org
[Download RAW message or body]

Git commit 3c7fd5a87e2e176f480b9bb67b594f59a08c9551 by Hugo Pereira Da Costa, on behalf of Antonio Larrosa.
Committed on 31/10/2016 at 17:23.
Pushed by hpereiradacosta into branch 'Plasma/5.8'.

The combobox needs to be 2 pixels wider for contents to fit

Summary:
When the size of the combo box adjusts to its contents, the dropdown
listbox isn't large enough to fit the contents and a vertical scrollbar
so instead of using Metrics::MenuButton_IndicatorWidth. I defined
a new Metrics::ComboBox_IndicatorWidth which is two pixels larger than
Metrics::MenuButton_IndicatorWidth.

To test this I used "kcmshell5 kcm_kscreen -style breeze" and opened
the resolutions QComboBox (If there are less than 15 possible
resolutions, a slider will appear instead of a QComboBox, so in that
case it's possible to use a virtual machine with QXL video that for
me shows plenty of possible resolutions).

Before this patch, most of the larger resolutions are shortened to
something like "192...200" or "160...200" and can't be read (in the
dropdown listbox, when selected they can be read correctly in the
closed combobox), after applying this patch, all the contents of the
listbox can be read correctly.

Reviewers: #plasma, #plasma:_design, hpereiradacosta

Reviewed By: hpereiradacosta

Subscribers: hpereiradacosta, davidedmundson, plasma-devel

Tags: #plasma, #plasma:_design

Differential Revision: https://phabricator.kde.org/D3192

M  +1    -1    kstyle/breezestyle.cpp

http://commits.kde.org/breeze/3c7fd5a87e2e176f480b9bb67b594f59a08c9551

diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp
index 8a02d75..d3f6d46 100644
--- a/kstyle/breezestyle.cpp
+++ b/kstyle/breezestyle.cpp
@@ -2507,7 +2507,7 @@ namespace Breeze
         size.setHeight( qMax( size.height(), int(Metrics::MenuButton_IndicatorWidth) ) );
 
         // add button width and spacing
-        size.rwidth() += Metrics::MenuButton_IndicatorWidth;
+        size.rwidth() += Metrics::MenuButton_IndicatorWidth+2;
 
         return size;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic