Kaydet (Commit) f6a04cb5 authored tarafından Caolán McNamara's avatar Caolán McNamara

gtk3: shiny native focus rectangles for listboxes

Change-Id: Id0ace0ae5e90877497834166c5e488a0f5caf0be
üst 994b9700
......@@ -600,6 +600,8 @@ public:
bool GetEdgeBlending() const { return mbEdgeBlending; }
void SetEdgeBlending(bool bNew) { mbEdgeBlending = bNew; }
virtual void ShowFocus(const Rectangle& rRect) SAL_OVERRIDE;
};
class ImplBtn : public PushButton
......
......@@ -2889,6 +2889,22 @@ void ImplWin::LoseFocus()
Control::LoseFocus();
}
void ImplWin::ShowFocus(const Rectangle& rRect)
{
bool bNativeOK;
if ((bNativeOK = IsNativeControlSupported(CTRL_LISTBOX, PART_FOCUS)))
{
ImplControlValue aControlValue;
vcl::Window *pWin = GetParent();
Rectangle aParentRect(Point(0, 0), pWin->GetSizePixel());
bNativeOK = pWin->DrawNativeControl(CTRL_LISTBOX, PART_FOCUS, aParentRect,
ControlState::FOCUSED, aControlValue, OUString());
}
if (!bNativeOK)
Control::ShowFocus(rRect);
}
ImplBtn::ImplBtn( vcl::Window* pParent, WinBits nWinStyle ) :
PushButton( pParent, nWinStyle ),
mbDown ( false )
......
......@@ -828,7 +828,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
break;
case CTRL_LISTBOX:
context = mpListboxStyle;
renderType = RENDER_COMBOBOX;
renderType = nPart == PART_FOCUS ? RENDER_FOCUS : RENDER_COMBOBOX;
break;
case CTRL_MENU_POPUP:
......@@ -1682,7 +1682,7 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
break;
case CTRL_LISTBOX:
if (nPart==PART_ENTIRE_CONTROL || nPart==PART_WINDOW || nPart==HAS_BACKGROUND_TEXTURE)
if (nPart==PART_ENTIRE_CONTROL || nPart==PART_WINDOW || nPart==HAS_BACKGROUND_TEXTURE || nPart == PART_FOCUS)
return true;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment