Commits

Anonymous committed 7d19c29

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

Comments (0)

Files changed (3)

sd/source/ui/slidesorter/controller/SlideSorterController.cxx

 
             case VCLEVENT_WINDOW_GETFOCUS:
                 if (pActiveWindow != NULL && pWindow == pActiveWindow)
-                    GetFocusManager().ShowFocus();
+                    GetFocusManager().ShowFocus(false);
                 break;
 
             case VCLEVENT_WINDOW_LOSEFOCUS:

sd/source/ui/slidesorter/controller/SlsFocusManager.cxx

         }
 
         if (mbPageIsFocused)
-            ShowFocusIndicator(GetFocusedPageDescriptor());
+            ShowFocusIndicator(GetFocusedPageDescriptor(), true);
     }
 }
 
 
 
 
-void FocusManager::ShowFocus (void)
+void FocusManager::ShowFocus (const bool bScrollToFocus)
 {
     mbPageIsFocused = true;
-    ShowFocusIndicator(GetFocusedPageDescriptor());
+    ShowFocusIndicator(GetFocusedPageDescriptor(), bScrollToFocus);
 }
 
 
 
 
 
-void FocusManager::ShowFocusIndicator (const model::SharedPageDescriptor& rpDescriptor)
+void FocusManager::ShowFocusIndicator (
+    const model::SharedPageDescriptor& rpDescriptor,
+    const bool bScrollToFocus)
 {
     if (rpDescriptor.get() != NULL)
     {
         rpDescriptor->SetFocus ();
-        
-        // Scroll the focused page object into the visible area and repaint
-        // it, so that the focus indicator becomes visible.
-        view::SlideSorterView& rView (mrSlideSorter.GetView());
-        mrSlideSorter.GetController().GetSelectionManager()->MakeRectangleVisible (
-            rView.GetPageBoundingBox (
-                GetFocusedPageDescriptor(),
-                view::SlideSorterView::CS_MODEL,
-                view::SlideSorterView::BBT_INFO));
+
+        if (bScrollToFocus)
+        {
+            // Scroll the focused page object into the visible area and repaint
+            // it, so that the focus indicator becomes visible.
+            view::SlideSorterView& rView (mrSlideSorter.GetView());
+            mrSlideSorter.GetController().GetSelectionManager()->MakeRectangleVisible (
+                rView.GetPageBoundingBox (
+                    GetFocusedPageDescriptor(),
+                    view::SlideSorterView::CS_MODEL,
+                    view::SlideSorterView::BBT_INFO));
+        }
 
         mrSlideSorter.GetView().RequestRepaint (rpDescriptor);
         NotifyFocusChangeListeners();

sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx

     void MoveFocus (FocusMoveDirection eDirection);
 
     /** 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.
     */
         made visible.
         @param pDescriptor
             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
         happended.  The focus may be hidden or shown or moved from one page