summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-02 21:21:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-03 21:55:59 +0200
commit2d45f87330ef7011711767cc736829e4082b236b (patch)
tree4b678332797429c19a7b55ee8cae6d01fd416181 /svx
parent7e64aaebce8667f7ab173ea3807c62f81138b4af (diff)
support native focus for drawing sub region
Change-Id: I9862f060b9d5b2c3015c084060887f2d66f1ed01 Reviewed-on: https://gerrit.libreoffice.org/53768 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/dlgctrl.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index a4d31925d242..d091a121023d 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -684,6 +684,7 @@ RectCtl::RectCtl(weld::Builder& rBuilder, const OString& rDrawingId, SvxTabPage*
m_xControl->connect_key_press(LINK(this, RectCtl, DoKeyDown));
m_xControl->connect_focus_in(LINK(this, RectCtl, DoGetFocus));
m_xControl->connect_focus_out(LINK(this, RectCtl, DoLoseFocus));
+ m_xControl->connect_focus_rect(LINK(this, RectCtl, DoFocusRect));
m_xControl->set_size_request(m_xControl->get_approximate_digit_width() * 25, m_xControl->get_text_height() * 5);
Resize_Impl();
@@ -976,12 +977,14 @@ IMPL_LINK(RectCtl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
rRenderContext.DrawBitmap(aCenterPt, aDstBtnSize, aBtnPnt2, aBtnSize, rBitmap.GetBitmap());
}
}
+}
- if (m_xControl->has_focus())
- {
- tools::Rectangle aFocusRect(CalculateFocusRectangle());
- rRenderContext.Invert(aFocusRect, InvertFlags(0xffff));
- }
+IMPL_LINK(RectCtl, DoFocusRect, weld::Widget&, rControl, tools::Rectangle)
+{
+ tools::Rectangle aRet;
+ if (rControl.has_focus())
+ aRet = CalculateFocusRectangle();
+ return aRet;
}
// Convert RectPoint Point