[Libreoffice-commits] core.git: include/vcl svtools/source vcl/source
Caolán McNamara
caolanm at redhat.com
Thu May 31 15:46:52 UTC 2018
include/vcl/outdev.hxx | 2 ++
svtools/source/control/valueset.cxx | 4 ++++
vcl/source/app/salvtables.cxx | 2 +-
vcl/source/window/window2.cxx | 7 +++++++
4 files changed, 14 insertions(+), 1 deletion(-)
New commits:
commit 9447068e261c4d0e7852a2c0147a17407561c302
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed May 30 21:28:41 2018 +0100
focus rect for value set
Change-Id: I208cf42db4256bb7286222781cf2bf29f843c673
Reviewed-on: https://gerrit.libreoffice.org/55101
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index bd4af96456aa..174987e51757 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -308,6 +308,8 @@ namespace vcl {
typedef OutputDevice RenderContext;
}
+VCL_DLLPUBLIC void DrawFocusRect(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect, int nBorder = 1);
+
/**
* Some things multiple-inherit from VclAbstractDialog and OutputDevice,
* so we need to use virtual inheritance to keep the referencing counting
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 3c8e5cbcc753..dc5e52896641 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -3244,6 +3244,8 @@ void SvtValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16
WinBits nStyle = GetStyle();
if (nStyle & WB_MENUSTYLEVALUESET)
{
+ if (bFocus)
+ DrawFocusRect(rRenderContext, aRect);
if (bDrawSel)
{
rRenderContext.SetLineColor(mbBlackSel ? COL_BLACK : aDoubleColor);
@@ -3296,6 +3298,8 @@ void SvtValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16
rRenderContext.SetLineColor(COL_LIGHTGRAY);
}
rRenderContext.DrawRect(aRect2);
+ if (bFocus)
+ DrawFocusRect(rRenderContext, aRect2);
}
ImplDrawItemText(rRenderContext, pItem->maText);
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: */
More information about the Libreoffice-commits
mailing list