summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-10-09 12:06:41 +0200
committerEike Rathke <erack@redhat.com>2014-01-02 22:38:02 +0100
commitbfb51322f2bee76d7e70588050c38655a432aef0 (patch)
treed82b04c624331c3affbe21ef78806ff8c009d1df /svtools
parentb8303a3e58f0b8d50574126998228d7d71c94728 (diff)
Make CalcFocusRect look right
...at least for its (only, it appears) uses at the left of the "Insert - Hyperlink" dialog and at the left of a Database window. As aBmpRect and aTextRect never extend aBoundRect (and aTextRect always leaving a gap left and right towards aBoundRect, it appears, with the text abbreviated with an ellipsis if it would be too wide), there should be no need to eventually adjust "the focus rectangle [to] not touch the text," and for calculating the top of the focus rect aBoundRect can be used just as well as aBmpRect. (Though for calculating the bottom, aBoundRect apparently stretches "too far" compareed to aTextRect; whatever... The offsets look somewhat "magic" anyway, but appear to produce the desired visual results.) Change-Id: Ic324561294fb6172c0d02a697fc261717e01c87c Reviewed-on: https://gerrit.libreoffice.org/6165 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 143bb92761f54cb7b8e41e5ac83bd274d4f7079b) Signed-off-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/contnr/imivctl1.cxx13
1 files changed, 3 insertions, 10 deletions
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 01f733db1462..b0ea08268d15 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2703,18 +2703,11 @@ const Size& SvxIconChoiceCtrl_Impl::GetItemSize( SvxIconChoiceCtrlEntry*,
Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( SvxIconChoiceCtrlEntry* pEntry )
{
- Rectangle aBmpRect( CalcBmpRect( pEntry ) );
Rectangle aTextRect( CalcTextRect( pEntry ) );
Rectangle aBoundRect( GetEntryBoundRect( pEntry ) );
- Rectangle aFocusRect( aBoundRect.Left(), aBmpRect.Top() - 1,
- aBoundRect.Right() - 4, aTextRect.Bottom() + 1 );
- // the focus rectangle should not touch the text
- if( aFocusRect.Left() > ::std::numeric_limits<long>::min() && aFocusRect.Left() - 1 >= pEntry->aRect.Left() )
- aFocusRect.Left()--;
- if( aFocusRect.Right() < ::std::numeric_limits<long>::max() && aFocusRect.Right() + 1 <= pEntry->aRect.Right() )
- aFocusRect.Right()++;
-
- return aFocusRect;
+ return Rectangle(
+ aBoundRect.Left(), aBoundRect.Top() - 1, aBoundRect.Right() - 1,
+ aTextRect.Bottom() + 1);
}
// the hot spot is the inner 50 % of the rectangle