Rebased ref, commits from common ancestor: commit 1152f6d90e2e3a5e3e9dcb5d2440652a022d98fa Author: Katarina Behrens <katarina.behr...@cib.de> Date: Wed Apr 25 15:42:59 2018 +0200
Render tooltips natively with this, all widgets that used to be rendered natively with kde4 are rendered natively also in kde5 Change-Id: If814b121e928a9d743c74836f000b3230b946caf diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 931b6a2d23b8..1685a772a88b 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -83,7 +83,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Pushbutton: case ControlType::Radiobutton: case ControlType::Checkbox: - /*case ControlType::Tooltip:*/ + case ControlType::Tooltip: case ControlType::Progress: case ControlType::ListNode: return (part == ControlPart::Entire); @@ -528,12 +528,12 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CE_RadioButton, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - /*else if (type == ControlType::Tooltip) + else if (type == ControlType::Tooltip) { QStyleOption option; draw( QStyle::PE_PanelTipLabel, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); - }*/ + } else if (type == ControlType::Frame) { lcl_drawFrame( QStyle::PE_Frame, m_image.get(), commit d685cb23f72de6e619bda68d7d1a557e2562eaab Author: Katarina Behrens <katarina.behr...@cib.de> Date: Wed Apr 25 15:19:28 2018 +0200 Render scrollbars natively Change-Id: I7f7e5bb8cf6e7307b0563a9ef84845a99dc54e1e diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 4c5a70a89a77..931b6a2d23b8 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -95,7 +95,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Combobox: case ControlType::Toolbar: case ControlType::Frame: - /*case ControlType::Scrollbar:*/ + case ControlType::Scrollbar: case ControlType::WindowBackground: case ControlType::Fixedline: return true; @@ -457,7 +457,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, vclStateValue2StateFlag(nControlState, value) ); //m_image->save("/tmp/checkbox.png"); } - /*else if (type == ControlType::Scrollbar) + else if (type == ControlType::Scrollbar) { if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz)) { @@ -495,7 +495,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, { returnVal = false; } - }*/ + } else if (type == ControlType::Spinbox) { QStyleOptionSpinBox option; @@ -857,7 +857,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } break; } - /*case ControlType::Scrollbar: + case ControlType::Scrollbar: { // core can't handle 3-button scrollbars well, so we fix that in hitTestNativeControl(), // for the rest also provide the track area (i.e. area not taken by buttons) @@ -889,7 +889,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part retVal = true; } break; - }*/ + } default: break; } @@ -910,7 +910,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } /** Test whether the position is in the native widget. - If the return value is TRUE, bIsInside contains information whether + If the return value is true, bIsInside contains information whether aPos was or was not inside the native widget specified by the nType/nPart combination. */ @@ -918,15 +918,15 @@ bool KDE5SalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart const tools::Rectangle& rControlRegion, const Point& rPos, bool& rIsInside ) { - /*if ( nType == ControlType::Scrollbar ) + if ( nType == ControlType::Scrollbar ) { if( nPart != ControlPart::ButtonUp && nPart != ControlPart::ButtonDown && nPart != ControlPart::ButtonLeft && nPart != ControlPart::ButtonRight ) { // we adjust only for buttons (because some scrollbars have 3 buttons, // and LO core doesn't handle such scrollbars well) - return FALSE; + return false; } - rIsInside = FALSE; + rIsInside = false; bool bHorizontal = ( nPart == ControlPart::ButtonLeft || nPart == ControlPart::ButtonRight ); QRect rect = toQRect( rControlRegion ); QPoint pos( rPos.X(), rPos.Y()); @@ -952,8 +952,8 @@ bool KDE5SalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart rIsInside = ( control == QStyle::SC_ScrollBarSubLine ); else // DOWN, RIGHT rIsInside = ( control == QStyle::SC_ScrollBarAddLine ); - return TRUE; - }*/ + return true; + } return false; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits