[Libreoffice-commits] .: 2 commits - sd/source vcl/unx

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Thu Aug 2 10:55:43 PDT 2012


 sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx |    6 --
 sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx    |    5 --
 sd/source/ui/slidesorter/view/SlideSorterView.cxx     |   14 +----
 sd/source/ui/slidesorter/view/SlsButtonBar.cxx        |   45 +++---------------
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx         |    4 +
 5 files changed, 19 insertions(+), 55 deletions(-)

New commits:
commit e995824285cf6697a355d567abc8cd2df2b38b72
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Thu Aug 2 21:53:58 2012 +0400

    fdo#51231 Revert "Slidesorter: Show the buttons on the opposite side..."
    
    This reverts commit 4866b20ec6205b04cd21077fd00d68c4d4bb2c1b.

diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
index db0cd65..30208ef 100644
--- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
@@ -225,15 +225,13 @@ public:
         const bool bAnimate = true);
     void SetPageUnderMouse (
         const model::SharedPageDescriptor& rpDescriptor,
-        const bool bAnimate = true,
-        const Point& rMousePosition = Point());
+        const bool bAnimate = true);
 
     bool SetState (
         const model::SharedPageDescriptor& rpDescriptor,
         const model::PageDescriptor::State eState,
         const bool bStateValue,
-        const bool bAnimate = true,
-        const Point& rMousePosition = Point());
+        const bool bAnimate = true);
 
     void UpdateOrientation (void);
 
diff --git a/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx b/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx
index 6bb273f..c08c328 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx
@@ -69,11 +69,6 @@ public:
         const Point aMouseModelLocation,
         const bool bIsMouseButtonDown);
 
-    /// Decide whether the button should be drawn at the top, or the bottom.
-    void UpdateButtonPosition(
-        const model::SharedPageDescriptor& rpDescriptor,
-        const Point& rMousePosition);
-
     void ResetPage (void);
 
     bool IsMouseOverBar (void) const;
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index 711a0f6..c403162 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -956,7 +956,7 @@ void SlideSorterView::UpdatePageUnderMouse (
     const bool bAnimate)
 {
     // Update the page under the mouse.
-    SetPageUnderMouse(rpDescriptor, bAnimate, rMousePosition);
+    SetPageUnderMouse(rpDescriptor, bAnimate);
 
     // Tell the button bar about the new mouse position.
     SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
@@ -984,8 +984,7 @@ void SlideSorterView::UpdatePageUnderMouse (
 
 void SlideSorterView::SetPageUnderMouse (
     const model::SharedPageDescriptor& rpDescriptor,
-    const bool bAnimate,
-    const Point& rMousePosition)
+    const bool bAnimate)
 {
     if (mpPageUnderMouse != rpDescriptor)
     {
@@ -995,7 +994,7 @@ void SlideSorterView::SetPageUnderMouse (
         mpPageUnderMouse = rpDescriptor;
 
         if (mpPageUnderMouse)
-            SetState(mpPageUnderMouse, PageDescriptor::ST_MouseOver, true, bAnimate, rMousePosition);
+            SetState(mpPageUnderMouse, PageDescriptor::ST_MouseOver, true, bAnimate);
 
         // Change the quick help text to display the name of the page under
         // the mouse.
@@ -1010,8 +1009,7 @@ bool SlideSorterView::SetState (
     const model::SharedPageDescriptor& rpDescriptor,
     const PageDescriptor::State eState,
     const bool bStateValue,
-    const bool bAnimate,
-    const Point& rMousePosition)
+    const bool bAnimate)
 {
     model::SharedPageDescriptor pDescriptor (rpDescriptor);
     if ( ! pDescriptor)
@@ -1039,11 +1037,7 @@ bool SlideSorterView::SetState (
         if (eState == PageDescriptor::ST_MouseOver)
         {
             if (bStateValue)
-            {
-                if (bAnimate)
-                    GetButtonBar().UpdateButtonPosition(rpDescriptor, rMousePosition);
                 GetButtonBar().RequestFadeIn(rpDescriptor, bAnimate);
-            }
             else
                 GetButtonBar().RequestFadeOut(rpDescriptor, bAnimate);
         }
diff --git a/sd/source/ui/slidesorter/view/SlsButtonBar.cxx b/sd/source/ui/slidesorter/view/SlsButtonBar.cxx
index 3ed33d8..2e41520 100644
--- a/sd/source/ui/slidesorter/view/SlsButtonBar.cxx
+++ b/sd/source/ui/slidesorter/view/SlsButtonBar.cxx
@@ -70,25 +70,19 @@ namespace sd { namespace slidesorter { namespace view {
 class ButtonBar::BackgroundTheme
 {
 public:
-    enum ButtonPosition { TOP, BOTTOM };
-public:
     BackgroundTheme(
         const ::boost::shared_ptr<Theme>& rpTheme,
         const ::std::vector<SharedButton>& rButtons);
-    ~BackgroundTheme() { }
+    virtual ~BackgroundTheme() { }
     /** Set the preview bounding box, the maximal area in which to display
         buttons.  A call to this method triggers a call to Layout().
     */
     void SetPreviewBoundingBox (const Rectangle& rPreviewBoundingBox);
     Button::IconSize GetIconSize (void) const;
 
-    BitmapEx CreateBackground () const;
-    Point GetBackgroundLocation (void);
-    Rectangle GetButtonArea (void);
-    void SetButtonPosition( ButtonPosition ePosition ) { mePosition = ePosition; }
-
-    /// Compute the positions & sizes.
-    void Layout (void);
+    virtual BitmapEx CreateBackground () const;
+    virtual Point GetBackgroundLocation (void);
+    virtual Rectangle GetButtonArea (void);
 
 protected:
     ::boost::shared_ptr<Theme> mpTheme;
@@ -100,8 +94,7 @@ protected:
     Rectangle maButtonArea;
     Point maBackgroundLocation;
 
-    /// This comes into effect only during Layout(), before it only caches the value.
-    ButtonPosition mePosition;
+    virtual void Layout (void);
 
 private:
     /// Compute the size of the are for the given button size.
@@ -286,24 +279,6 @@ void ButtonBar::ProcessMouseMotionEvent (
 }
 
 
-void ButtonBar::UpdateButtonPosition(
-    const model::SharedPageDescriptor& rpDescriptor,
-    const Point& rMousePosition)
-{
-    if (rpDescriptor && mpBackgroundTheme)
-    {
-        Rectangle aRectangle( rpDescriptor->GetBoundingBox() );
-        aRectangle.Bottom() -= aRectangle.GetHeight() / 2;
-
-        if (aRectangle.IsInside(rMousePosition))
-            mpBackgroundTheme->SetButtonPosition(ButtonBar::BackgroundTheme::BOTTOM);
-        else
-            mpBackgroundTheme->SetButtonPosition(ButtonBar::BackgroundTheme::TOP);
-
-        // Relayout, to propagate the newest location of the buttons
-        LayoutButtons();
-    }
-}
 
 
 void ButtonBar::ResetPage (void)
@@ -532,7 +507,6 @@ bool ButtonBar::LayoutButtons (void)
     nMaximumHeight += 2*nBorder;
 
     // Set up the bounding box of the button bar.
-    mpBackgroundTheme->Layout();
     maButtonBoundingBox = mpBackgroundTheme->GetButtonArea();
     maBackgroundLocation = mpBackgroundTheme->GetBackgroundLocation();
     if (Theme_ButtonPaintType == 1)
@@ -737,8 +711,7 @@ ButtonBar::BackgroundTheme::BackgroundTheme (
     : mpTheme(rpTheme),
       meIconSize( Button::IconSize_Large ),
       maButtonArea(),
-      maBackgroundLocation(),
-      mePosition( BOTTOM )
+      maBackgroundLocation()
 {
     UpdateMinimumIconSizes(rButtons);
 }
@@ -847,9 +820,9 @@ void ButtonBar::BackgroundTheme::Layout (void)
     }
 
     maBackgroundLocation = Point(
-        maPreviewBoundingBox.Left() + (maPreviewBoundingBox.GetWidth()-aImageSize.Width())/2,
-        mePosition == TOP? maPreviewBoundingBox.Top():
-                           maPreviewBoundingBox.Bottom() - aImageSize.Height());
+        maPreviewBoundingBox.Left()
+            + (maPreviewBoundingBox.GetWidth()-aImageSize.Width())/2,
+        maPreviewBoundingBox.Bottom() - aImageSize.Height());
     maButtonArea = Rectangle(maBackgroundLocation, aImageSize);
 }
 
commit 2cfe27125a962f5f902972656589aab696d6286e
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Thu Aug 2 21:14:57 2012 +0400

    gtk3: filch a fix for scrollbars w/o buttons from gtk2 code
    
    that is b38ee8c8d5bb10ade41d5ee4050ec4fda12fcbd2
    
    Change-Id: Ib86d86616443cf48ba1d3ee0b6f96314b42dc972

diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 4298493..45e8977 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1049,6 +1049,10 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
                (nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN)  ) )
     {
         aEditRect = NWGetScrollButtonRect( nPart, rControlRegion );
+        if (!aEditRect.GetWidth())
+            aEditRect.Right() = aEditRect.Left() + 1;
+        if (!aEditRect.GetHeight())
+            aEditRect.Bottom() = aEditRect.Top() + 1;
     }
     else if ( (nType==CTRL_SPINBOX) &&
               ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) ||


More information about the Libreoffice-commits mailing list