summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/salvtables.cxx2
-rw-r--r--vcl/source/window/window2.cxx7
2 files changed, 8 insertions, 1 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 260e6c056c4c..065818715ff4 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1853,7 +1853,7 @@ IMPL_LINK(SalInstanceDrawingArea, PaintHdl, target_and_area, aPayload, void)
m_aDrawHdl.Call(aPayload);
tools::Rectangle aFocusRect(m_aGetFocusRectHdl.Call(*this));
if (!aFocusRect.IsEmpty())
- aPayload.first.Invert(aFocusRect, InvertFlags(0xffff));
+ DrawFocusRect(aPayload.first, aFocusRect);
}
IMPL_LINK(SalInstanceDrawingArea, ResizeHdl, const Size&, rSize, void)
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 8b7e07dbc19e..bdef8b58c215 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -2006,5 +2006,12 @@ const std::vector<VclPtr<FixedText> >& Window::list_mnemonic_labels() const
} /* namespace vcl */
+void DrawFocusRect(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect, int nBorder)
+{
+ rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Top()), Size(rRect.GetWidth(), nBorder)), InvertFlags::N50);
+ rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Bottom()-nBorder+1), Size(rRect.GetWidth(), nBorder)), InvertFlags::N50);
+ rRenderContext.Invert(tools::Rectangle(Point(rRect.Left(), rRect.Top()+nBorder), Size(nBorder, rRect.GetHeight()-(nBorder*2))), InvertFlags::N50);
+ rRenderContext.Invert(tools::Rectangle(Point(rRect.Right()-nBorder+1, rRect.Top()+nBorder), Size(nBorder, rRect.GetHeight()-(nBorder*2))), InvertFlags::N50);
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */