https://bugs.kde.org/show_bug.cgi?id=394963

--- Comment #10 from Hugo Pereira Da Costa <hugo.pereira.da.co...@gmail.com> ---
(In reply to Vlad Zagorodniy from comment #6)
> After taking a look at Fusion widget style source code, here's a patch
> to "fix" this bug in some part:
> 
> ```
> From 8a1b11a4ed6fdd639259d7eea1c04bc926b78483 Mon Sep 17 00:00:00 2001
> From: Vlad Zagorodniy <vladz...@gmail.com>
> Date: Sat, 2 Jun 2018 23:42:38 +0300
> Subject: [PATCH] Fix SpinBox frame rendering with Qt 5.11
> 
> ---
>  kstyle/breezestyle.cpp | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp
> index 28746216..88042362 100644
> --- a/kstyle/breezestyle.cpp
> +++ b/kstyle/breezestyle.cpp
> @@ -6200,13 +6200,11 @@ namespace Breeze
>          const auto& palette( option->palette );
>          const auto& rect( option->rect );
>  
> -
> -        if( option->subControls & SC_SpinBoxFrame )
> +        if( spinBoxOption->frame )
>          {
>  
>              // detect flat spinboxes
> -            bool flat( !spinBoxOption->frame );
> -            flat |= ( rect.height() < 2*Metrics::Frame_FrameWidth +
> Metrics::SpinBox_ArrowButtonWidth );
> +            const bool flat = ( rect.height() < 2*Metrics::Frame_FrameWidth
> + Metrics::SpinBox_ArrowButtonWidth );
>              if( flat )
>              {
>  

Ok. Fix looks "sensible", but if I read the patch right, it would indicate 
that SC_SpinBoxFrame has become deprecated, in the sense that it is never set
as option subcontrols anymore. Correct ? 

If so, I must still check that it does not break things agains past version of
Qt (5.10 or even 4.xx), or add #ifdefs. 

Concerning arrows vs plus-minus signs, well right now we just ignore this
setting (of which I was not aware), but thats a completely different issue :)

Thanks for the investigation  !

> ```
> 
> Also, Fusion checks whether it should draw arrows or plus/minus as follows:
> if (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) { ... }
> else if (spinBox->buttonSymbols == QAbstractSpinBox::UpDownArrows) { ... }
> 
> I hope this will help you.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to