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>2013-10-09 11:59:46 +0000
commit143bb92761f54cb7b8e41e5ac83bd274d4f7079b (patch)
tree5b6d962dc9c0b14fc918929032762ddd9384fe92 /svtools
parent9685d20f2a0526a4c454cea1bd947eccbaeefa84 (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>
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 0685bc3ecf77..74d7fe5e0e02 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2704,18 +2704,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