[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/unx

Katarina Behrens Katarina.Behrens at cib.de
Wed May 2 14:45:25 UTC 2018


 vcl/unx/kde5/KDE5SalGraphics.cxx |   24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

New commits:
commit 4a04579cac010c1082ee368233be1bfb6722424a
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Wed May 2 16:42:56 2018 +0200

    Native focus rectangles for push buttons
    
    far from perfect, they also hide the button text (but at least focus
    frame in contrast colour is visible)
    
    Change-Id: I9a7c2b429ae14b8604f894de64a7328cde6cb270

diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx
index e110c0b04722..13b791943199 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.cxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.cxx
@@ -80,7 +80,6 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa
 {
     switch (type)
     {
-        case ControlType::Pushbutton:
         case ControlType::Tooltip:
         case ControlType::Progress:
         case ControlType::ListNode:
@@ -88,6 +87,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa
 
         case ControlType::Radiobutton:
         case ControlType::Checkbox:
+        case ControlType::Pushbutton:
             return (part == ControlPart::Entire) || (part == ControlPart::Focus);
 
         case ControlType::Menubar:
@@ -203,7 +203,10 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
             m_image->fill(QApplication::palette().color(QPalette::ToolTipBase).rgb());
             break;
         case ControlType::Pushbutton:
-            m_image->fill(QApplication::palette().color(QPalette::Button).rgb());
+            if ( nControlState & ControlState::FOCUSED )
+                m_image->fill(QApplication::palette().color(QPalette::Highlight).rgb());
+            else
+                m_image->fill(QApplication::palette().color(QPalette::Button).rgb());
             break;
         case ControlType::Scrollbar:
             if ((part == ControlPart::DrawBackgroundVert)
commit 39ac3dc45013ef2c8397a208f0f37e794e8c57f3
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Wed May 2 14:00:01 2018 +0200

    Native focus rectangles for radiobuttons
    
    that suffer from the same problem (lack of transparency) as those
    of checkboxes
    
    Change-Id: I4bb81c5f95b07e57a7d6cdb86ba4e31ec7660f5a

diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx
index 849865641fb1..e110c0b04722 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.cxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.cxx
@@ -81,12 +81,12 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa
     switch (type)
     {
         case ControlType::Pushbutton:
-        case ControlType::Radiobutton:
         case ControlType::Tooltip:
         case ControlType::Progress:
         case ControlType::ListNode:
             return (part == ControlPart::Entire);
 
+        case ControlType::Radiobutton:
         case ControlType::Checkbox:
             return (part == ControlPart::Entire) || (part == ControlPart::Focus);
 
@@ -501,9 +501,18 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if (type == ControlType::Radiobutton)
     {
-        QStyleOptionButton option;
-        draw( QStyle::CE_RadioButton, &option, m_image.get(),
-              vclStateValue2StateFlag(nControlState, value) );
+        if (part == ControlPart::Entire)
+        {
+            QStyleOptionButton option;
+            draw( QStyle::CE_RadioButton, &option, m_image.get(),
+                  vclStateValue2StateFlag(nControlState, value) );
+        }
+        else if (part == ControlPart::Focus)
+        {
+            QStyleOptionFocusRect option;
+            draw( QStyle::PE_FrameFocusRect, &option, m_image.get(),
+                  vclStateValue2StateFlag(nControlState, value) );
+        }
     }
     else if (type == ControlType::Tooltip)
     {


More information about the Libreoffice-commits mailing list