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

Katarina Behrens Katarina.Behrens at cib.de
Wed Jul 4 08:30:13 UTC 2018


 vcl/source/control/button.cxx             |   12 ------------
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx |    8 +++++++-
 2 files changed, 7 insertions(+), 13 deletions(-)

New commits:
commit b6af8a05ee5ab4b7051fd1d26b9b5f4f4dff58a2
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Wed Jul 4 10:22:23 2018 +0200

    Try to move adjusting focus rect down to gtk3 code
    
    as it makes the focus rect look oddly shifted for kde5 widgets
    
    Change-Id: Ia42ccf30207a8c804d23ba45870d839f94c3f858

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 6facf9159838..50b62c50b020 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2918,12 +2918,6 @@ void RadioButton::ShowFocus(const tools::Rectangle& rRect)
 
         aInRect.SetLeft( rRect.Left() );  // exclude the radio element itself from the focusrect
 
-        //to-do, figure out a better solution here
-        aInRect.AdjustLeft( -2 );
-        aInRect.AdjustRight(2 );
-        aInRect.AdjustTop( -2 );
-        aInRect.AdjustBottom(2 );
-
         DrawNativeControl(ControlType::Radiobutton, ControlPart::Focus, aInRect,
                           ControlState::FOCUSED, aControlValue, OUString());
     }
@@ -3743,12 +3737,6 @@ void CheckBox::ShowFocus(const tools::Rectangle& rRect)
 
         aInRect.SetLeft( rRect.Left() );  // exclude the checkbox itself from the focusrect
 
-        //to-do, figure out a better solution here
-        aInRect.AdjustLeft( -2 );
-        aInRect.AdjustRight(2 );
-        aInRect.AdjustTop( -2 );
-        aInRect.AdjustBottom(2 );
-
         DrawNativeControl(ControlType::Checkbox, ControlPart::Focus, aInRect,
                           ControlState::FOCUSED, aControlValue, OUString());
     }
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 9ed8d7c96dc3..180a050ebc59 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -2499,7 +2499,13 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
         break;
     case RenderType::Focus:
     {
-        if (nType != ControlType::Checkbox)
+        if (nType == ControlType::Checkbox ||
+            nType == ControlType::Radiobutton)
+        {
+            nX -= 2; nY -=2;
+            nHeight += 4; nWidth += 4;
+        }
+        else
         {
             GtkBorder border;
 


More information about the Libreoffice-commits mailing list