[Libreoffice-commits] core.git: Branch 'feature/sidebaropt' - 3 commits - sfx2/source

Jan Holesovsky kendy at suse.cz
Fri May 17 14:58:19 PDT 2013


 sfx2/source/sidebar/DrawHelper.cxx        |   74 ------------------------------
 sfx2/source/sidebar/DrawHelper.hxx        |    7 --
 sfx2/source/sidebar/SidebarToolBox.cxx    |    5 --
 sfx2/source/sidebar/ToolBoxBackground.cxx |   23 ++-------
 sfx2/source/sidebar/ToolBoxBackground.hxx |    1 
 5 files changed, 9 insertions(+), 101 deletions(-)

New commits:
commit 11ec102241d7e823c7245efcc8e523d07301ea8a
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri May 17 23:36:03 2013 +0200

    sidebar: The sidebar uses only small icons.
    
    Force the Color toolbar buttons etc. to small icons too, otherwise
    it's inconsistent.
    
    Change-Id: I7eea09c47c2d2f888611d04b2177f490f4977ebb

diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx
index 61110ee..0fcf64e 100644
--- a/sfx2/source/sidebar/SidebarToolBox.cxx
+++ b/sfx2/source/sidebar/SidebarToolBox.cxx
@@ -46,6 +46,7 @@ SidebarToolBox::SidebarToolBox (
 {
     SetBackground(Wallpaper());
     SetPaintTransparent(true);
+    SetToolboxButtonSize( TOOLBOX_BUTTONSIZE_SMALL );
 
     if (rxFrame.is())
     {
@@ -250,14 +251,12 @@ Reference<frame::XToolbarController> SidebarToolBox::GetControllerForItemId (con
 
 void SidebarToolBox::UpdateIcons (const Reference<frame::XFrame>& rxFrame)
 {
-    const sal_Bool bBigImages (SvtMiscOptions().AreCurrentSymbolsLarge());
-
     for (ControllerContainer::iterator iController(maControllers.begin()), iEnd(maControllers.end());
          iController!=iEnd;
          ++iController)
     {
         const ::rtl::OUString sCommandURL (iController->second.msCurrentCommand);
-        Image aImage (framework::GetImageFromURL(rxFrame, sCommandURL, bBigImages));
+        Image aImage (framework::GetImageFromURL(rxFrame, sCommandURL, false));
         SetItemImage(iController->first, aImage);
     }
 }
commit 49af83566016a2a62589ddc5394c9ae4ed3e70a9
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri May 17 23:29:31 2013 +0200

    sidebar: Kill DrawBevelBorder(), nobody uses that now.
    
    Change-Id: I7901ad17515002c8568a46f9a11c0c9919c0841e

diff --git a/sfx2/source/sidebar/DrawHelper.cxx b/sfx2/source/sidebar/DrawHelper.cxx
index f8172b2..85dbe37 100644
--- a/sfx2/source/sidebar/DrawHelper.cxx
+++ b/sfx2/source/sidebar/DrawHelper.cxx
@@ -21,7 +21,6 @@
 
 #include <vcl/lineinfo.hxx>
 
-
 namespace sfx2 { namespace sidebar {
 
 void DrawHelper::DrawBorder (
@@ -65,70 +64,6 @@ void DrawHelper::DrawBorder (
         rVerticalPaint);
 }
 
-
-
-
-void DrawHelper::DrawBevelBorder (
-    OutputDevice& rDevice,
-    const Rectangle rBox,
-    const SvBorder aBorderSize,
-    const Paint& rTopLeftPaint,
-    const Paint& rCenterPaint,
-    const Paint& rBottomRightPaint)
-{
-    // Draw top line.
-    DrawHorizontalLine(
-        rDevice,
-        rBox.Left(),
-        rBox.Right() - aBorderSize.Right(),
-        rBox.Top(),
-        aBorderSize.Top(),
-        rTopLeftPaint);
-    // Draw bottom line.
-    DrawHorizontalLine(
-        rDevice,
-        rBox.Left()+aBorderSize.Left(),
-        rBox.Right(),
-        rBox.Bottom()-aBorderSize.Bottom()+1,
-        aBorderSize.Bottom(),
-        rBottomRightPaint);
-    // Draw left line.
-    DrawVerticalLine(
-        rDevice,
-        rBox.Top()+aBorderSize.Top(),
-        rBox.Bottom() - aBorderSize.Bottom(),
-        rBox.Left(),
-        aBorderSize.Left(),
-        rTopLeftPaint);
-    // Draw right line.
-    DrawVerticalLine(
-        rDevice,
-        rBox.Top()+aBorderSize.Top(),
-        rBox.Bottom()-aBorderSize.Bottom(),
-        rBox.Right()-aBorderSize.Right()+1,
-        aBorderSize.Right(),
-        rBottomRightPaint);
-    // Draw top right corner.
-    DrawVerticalLine(
-        rDevice,
-        rBox.Top(),
-        rBox.Top()+aBorderSize.Top()-1,
-        rBox.Right()-aBorderSize.Right()+1,
-        aBorderSize.Right(),
-        rCenterPaint);
-    // Draw bottom right corner.
-    DrawVerticalLine(
-        rDevice,
-        rBox.Bottom() - aBorderSize.Bottom()+1,
-        rBox.Bottom(),
-        rBox.Left(),
-        aBorderSize.Left(),
-        rCenterPaint);
-}
-
-
-
-
 void DrawHelper::DrawHorizontalLine(
     OutputDevice& rDevice,
     const sal_Int32 nLeft,
@@ -165,9 +100,6 @@ void DrawHelper::DrawHorizontalLine(
     }
 }
 
-
-
-
 void DrawHelper::DrawVerticalLine(
     OutputDevice& rDevice,
     const sal_Int32 nTop,
@@ -204,9 +136,6 @@ void DrawHelper::DrawVerticalLine(
     }
 }
 
-
-
-
 void DrawHelper::DrawRoundedRectangle (
     OutputDevice& rDevice,
     const Rectangle& rBox,
@@ -238,7 +167,4 @@ void DrawHelper::DrawRoundedRectangle (
     }
 }
 
-
-
-
 } } // end of namespace sfx2::sidebar
diff --git a/sfx2/source/sidebar/DrawHelper.hxx b/sfx2/source/sidebar/DrawHelper.hxx
index 45bf7ea..c17c9ed 100644
--- a/sfx2/source/sidebar/DrawHelper.hxx
+++ b/sfx2/source/sidebar/DrawHelper.hxx
@@ -39,13 +39,6 @@ public:
         const SvBorder aBorderSize,
         const Paint& rHorizontalPaint,
         const Paint& rVerticalPaint);
-    static void DrawBevelBorder (
-        OutputDevice& rDevice,
-        const Rectangle rBox,
-        const SvBorder aBorderSize,
-        const Paint& rTopLeftPaint,
-        const Paint& rCenterPaint,
-        const Paint& rBottomRightPaint);
     static void DrawHorizontalLine(
         OutputDevice& rDevice,
         const sal_Int32 nLeft,
commit d8db8409dded9a0dc2cea118441eba62e7a2b967
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri May 17 23:23:24 2013 +0200

    sidebar: Simplify the look of the toolboxes.
    
    Get rid of the background (that is not based on the theme the user uses, so
    will not play good with system integration), and just draw a shadow frame
    around the toolbar buttons.
    
    [We cannot get rid of that for good, the controls then look 'lost in space'
    ;-)]
    
    Change-Id: I1325a341c9cf3e5a91e102e233916735de7f8064

diff --git a/sfx2/source/sidebar/ToolBoxBackground.cxx b/sfx2/source/sidebar/ToolBoxBackground.cxx
index d98f709..a5105c9 100644
--- a/sfx2/source/sidebar/ToolBoxBackground.cxx
+++ b/sfx2/source/sidebar/ToolBoxBackground.cxx
@@ -21,8 +21,8 @@
 #include "sfx2/sidebar/Tools.hxx"
 #include "sfx2/sidebar/Theme.hxx"
 
+#include <vcl/svapp.hxx>
 #include <vcl/toolbox.hxx>
-#include <vcl/gradient.hxx>
 #include <svl/smplhint.hxx>
 
 
@@ -32,8 +32,6 @@ ToolBoxBackground::ToolBoxBackground (Window* pParentWindow)
     : Window(pParentWindow, WB_DIALOGCONTROL),
       maPadding(Tools::RectangleToSvBorder(Theme::GetRectangle(Theme::Rect_ToolBoxPadding)))
 {
-    SetBackground(Theme::GetPaint(Theme::Paint_ToolBoxBackground).GetWallpaper());
-
 #ifdef DEBUG
     SetText(A2S("ToolBoxBackground"));
 #endif
@@ -87,19 +85,11 @@ void ToolBoxBackground::Paint (const Rectangle& rRect)
 {
     Window::Paint(rRect);
 
-    Rectangle aBox (Point(0,0), GetSizePixel());
-
-    const sidebar::Paint aTopLeftBorderPaint (Theme::GetPaint(Theme::Paint_ToolBoxBorderTopLeft));
-    const sidebar::Paint aCenterBorderPaint (Theme::GetPaint(Theme::Paint_ToolBoxBorderCenterCorners));
-    const sidebar::Paint aBottomRightBorderPaint (Theme::GetPaint(Theme::Paint_ToolBoxBorderBottomRight));
-    const Rectangle aBorderSize (Theme::GetRectangle(Theme::Rect_ToolBoxBorder));
-    DrawHelper::DrawBevelBorder (
-        *this,
-        aBox,
-        Tools::RectangleToSvBorder(aBorderSize),
-        aTopLeftBorderPaint,
-        aCenterBorderPaint,
-        aBottomRightBorderPaint);
+    const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+    SetFillColor();
+    SetLineColor( rStyleSettings.GetShadowColor() );
+
+    DrawRect( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
 }
 
 
@@ -109,7 +99,6 @@ void ToolBoxBackground::DataChanged (const DataChangedEvent& rEvent)
 {
     (void)rEvent;
 
-    SetBackground(Theme::GetPaint(Theme::Paint_ToolBoxBackground).GetWallpaper());
     maPadding = Tools::RectangleToSvBorder(Theme::GetRectangle(Theme::Rect_ToolBoxPadding));
 }
 
diff --git a/sfx2/source/sidebar/ToolBoxBackground.hxx b/sfx2/source/sidebar/ToolBoxBackground.hxx
index e5204b9..f1d1bdc 100644
--- a/sfx2/source/sidebar/ToolBoxBackground.hxx
+++ b/sfx2/source/sidebar/ToolBoxBackground.hxx
@@ -27,6 +27,7 @@ class ToolBox;
 
 namespace sfx2 { namespace sidebar {
 
+/// Draws the sidebar ToolBoxes (groups of toolbar buttons).
 class ToolBoxBackground
     : public Window
 {


More information about the Libreoffice-commits mailing list