Kaydet (Commit) eaa648fe authored tarafından Andre Fischer's avatar Andre Fischer

#i107049# Do not scroll focus indicator into view when slide sorter is focused.

üst 4f667eb7
...@@ -604,7 +604,7 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent) ...@@ -604,7 +604,7 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent)
case VCLEVENT_WINDOW_GETFOCUS: case VCLEVENT_WINDOW_GETFOCUS:
if (pActiveWindow != NULL && pWindow == pActiveWindow) if (pActiveWindow != NULL && pWindow == pActiveWindow)
GetFocusManager().ShowFocus(); GetFocusManager().ShowFocus(false);
break; break;
case VCLEVENT_WINDOW_LOSEFOCUS: case VCLEVENT_WINDOW_LOSEFOCUS:
......
...@@ -133,17 +133,17 @@ void FocusManager::MoveFocus (FocusMoveDirection eDirection) ...@@ -133,17 +133,17 @@ void FocusManager::MoveFocus (FocusMoveDirection eDirection)
} }
if (mbPageIsFocused) if (mbPageIsFocused)
ShowFocusIndicator(GetFocusedPageDescriptor()); ShowFocusIndicator(GetFocusedPageDescriptor(), true);
} }
} }
void FocusManager::ShowFocus (void) void FocusManager::ShowFocus (const bool bScrollToFocus)
{ {
mbPageIsFocused = true; mbPageIsFocused = true;
ShowFocusIndicator(GetFocusedPageDescriptor()); ShowFocusIndicator(GetFocusedPageDescriptor(), bScrollToFocus);
} }
...@@ -254,20 +254,25 @@ void FocusManager::HideFocusIndicator (const model::SharedPageDescriptor& rpDesc ...@@ -254,20 +254,25 @@ void FocusManager::HideFocusIndicator (const model::SharedPageDescriptor& rpDesc
void FocusManager::ShowFocusIndicator (const model::SharedPageDescriptor& rpDescriptor) void FocusManager::ShowFocusIndicator (
const model::SharedPageDescriptor& rpDescriptor,
const bool bScrollToFocus)
{ {
if (rpDescriptor.get() != NULL) if (rpDescriptor.get() != NULL)
{ {
rpDescriptor->SetFocus (); rpDescriptor->SetFocus ();
// Scroll the focused page object into the visible area and repaint if (bScrollToFocus)
// it, so that the focus indicator becomes visible. {
view::SlideSorterView& rView (mrSlideSorter.GetView()); // Scroll the focused page object into the visible area and repaint
mrSlideSorter.GetController().GetSelectionManager()->MakeRectangleVisible ( // it, so that the focus indicator becomes visible.
rView.GetPageBoundingBox ( view::SlideSorterView& rView (mrSlideSorter.GetView());
GetFocusedPageDescriptor(), mrSlideSorter.GetController().GetSelectionManager()->MakeRectangleVisible (
view::SlideSorterView::CS_MODEL, rView.GetPageBoundingBox (
view::SlideSorterView::BBT_INFO)); GetFocusedPageDescriptor(),
view::SlideSorterView::CS_MODEL,
view::SlideSorterView::BBT_INFO));
}
mrSlideSorter.GetView().RequestRepaint (rpDescriptor); mrSlideSorter.GetView().RequestRepaint (rpDescriptor);
NotifyFocusChangeListeners(); NotifyFocusChangeListeners();
......
...@@ -87,8 +87,11 @@ public: ...@@ -87,8 +87,11 @@ public:
void MoveFocus (FocusMoveDirection eDirection); void MoveFocus (FocusMoveDirection eDirection);
/** Show the focus indicator of the current slide. /** Show the focus indicator of the current slide.
@param bScrollToFocus
When <TRUE/> (the default) then the view is scrolled so that the
focus rectangle lies inside its visible area.
*/ */
void ShowFocus (void); void ShowFocus (const bool bScrollToFocus = true);
/** Hide the focus indicator. /** Hide the focus indicator.
*/ */
...@@ -215,8 +218,13 @@ private: ...@@ -215,8 +218,13 @@ private:
made visible. made visible.
@param pDescriptor @param pDescriptor
When NULL is given then the call is ignored. When NULL is given then the call is ignored.
@param bScrollToFocus
When <TRUE/> (the default) then the view is scrolled so that the
focus rectangle lies inside its visible area.
*/ */
void ShowFocusIndicator (const model::SharedPageDescriptor& rpDescriptor); void ShowFocusIndicator (
const model::SharedPageDescriptor& rpDescriptor,
const bool bScrollToFocus);
/** Call all currently registered listeners that a focus change has /** Call all currently registered listeners that a focus change has
happended. The focus may be hidden or shown or moved from one page happended. The focus may be hidden or shown or moved from one page
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment