[Libreoffice-commits] core.git: Branch 'feature/sidebar' - svx/source

Andre Fischer af at apache.org
Fri May 10 02:04:38 PDT 2013


 svx/source/sidebar/graphic/GraphicPropertyPanel.cxx |   61 +++++++++------
 svx/source/sidebar/graphic/GraphicPropertyPanel.hrc |   41 ----------
 svx/source/sidebar/graphic/GraphicPropertyPanel.src |   80 ++++++++------------
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx |    1 
 4 files changed, 70 insertions(+), 113 deletions(-)

New commits:
commit 299f922763b613df993599d776800b50c22732d4
Author: Andre Fischer <af at apache.org>
Date:   Tue Apr 30 09:57:28 2013 +0000

    Related: #i122144# Color mode control now looks like in toolbar
    
    and fixed overlapping icons and metric fields.
    
    (cherry picked from commit 835892332e2fda9e2082668679fb0385bf37eaaf)
    
    Change-Id: I21a78328bf11f7368ba97fc47b72f247e7316706

diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
index 14433b7..04bdbf5 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
@@ -27,6 +27,7 @@
 #include <svl/intitem.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/dispatch.hxx>
+#include "svx/dialogs.hrc"
 
 using namespace css;
 using namespace cssu;
@@ -68,18 +69,10 @@ GraphicPropertyPanel::GraphicPropertyPanel(
     maBlueControl(SID_ATTR_GRAF_BLUE, *pBindings, *this),
     maGammaControl(SID_ATTR_GRAF_GAMMA, *pBindings, *this),
     maModeControl(SID_ATTR_GRAF_MODE, *pBindings, *this),
-    maImgNormal(SVX_RES(IMG_NORMAL)),
-    maImgBW(SVX_RES(IMG_BW)),
-    maImgGray(SVX_RES(IMG_GRAY)),
-    maImgWater(SVX_RES(IMG_WATER)),
     maImgRed(this, SVX_RES(IMG_RED)),
     maImgGreen(this, SVX_RES(IMG_GREEN)),
     maImgBlue(this, SVX_RES(IMG_BLUE)),
     maImgGamma(this, SVX_RES(IMG_GAMMA)),
-    msNormal(SVX_RES(STR_NORMAL)),
-    msBW(SVX_RES(STR_BW)),
-    msGray(SVX_RES(STR_GRAY)),
-    msWater(SVX_RES(STR_WATER)),
     mxFrame(rxFrame),
     mpBindings(pBindings)
 {
@@ -103,38 +96,58 @@ void GraphicPropertyPanel::Initialize()
     mpFtTrans->SetBackground(Wallpaper());
 
     mpMtrBrightness->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyBrightnessHdl ) );
-    mpMtrBrightness->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Brightness")));    //wj acc
+    mpMtrBrightness->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Brightness")));
     mpMtrContrast->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyContrastHdl ) );
-    mpMtrContrast->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Contrast")));    //wj acc
+    mpMtrContrast->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Contrast")));
     mpMtrTrans->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyTransHdl ) );
-    mpMtrTrans->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Transparency")));   //wj acc
+    mpMtrTrans->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Transparency")));
 
-    mpLBColorMode->InsertEntry( msNormal, maImgNormal );
-    mpLBColorMode->InsertEntry( msGray, maImgGray );
-    mpLBColorMode->InsertEntry( msBW, maImgBW );
-    mpLBColorMode->InsertEntry( msWater, maImgWater );
+    mpLBColorMode->InsertEntry(String(SVX_RES(RID_SVXSTR_GRAFMODE_STANDARD)));
+    mpLBColorMode->InsertEntry(String(SVX_RES(RID_SVXSTR_GRAFMODE_GREYS)));
+    mpLBColorMode->InsertEntry(String(SVX_RES(RID_SVXSTR_GRAFMODE_MONO)));
+    mpLBColorMode->InsertEntry(String(SVX_RES(RID_SVXSTR_GRAFMODE_WATERMARK)));
     mpLBColorMode->SetSelectHdl( LINK( this, GraphicPropertyPanel, ClickColorModeHdl ));
-    mpLBColorMode->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Color mode")));  //wj acc
+    mpLBColorMode->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Color mode")));
 
     mpMtrRed->SetModifyHdl( LINK( this, GraphicPropertyPanel, RedHdl ) );
     mpMtrGreen->SetModifyHdl( LINK( this, GraphicPropertyPanel, GreenHdl ) );
     mpMtrBlue->SetModifyHdl( LINK( this, GraphicPropertyPanel, BlueHdl ) );
     mpMtrGamma->SetModifyHdl( LINK( this, GraphicPropertyPanel, GammaHdl ) );
-    mpMtrRed->SetAccessibleName(mpMtrRed->GetQuickHelpText());  //wj acc
-    mpMtrGreen->SetAccessibleName(mpMtrGreen->GetQuickHelpText());  //wj acc
-    mpMtrBlue->SetAccessibleName(mpMtrBlue->GetQuickHelpText());        //wj acc
-    mpMtrGamma->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Gamma value")));    //wj acc
+    mpMtrRed->SetAccessibleName(mpMtrRed->GetQuickHelpText());
+    mpMtrGreen->SetAccessibleName(mpMtrGreen->GetQuickHelpText());
+    mpMtrBlue->SetAccessibleName(mpMtrBlue->GetQuickHelpText());
+    mpMtrGamma->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Gamma value")));
 
     mpMtrRed->SetAccessibleRelationLabeledBy(mpMtrRed.get());
     mpMtrGreen->SetAccessibleRelationLabeledBy(mpMtrGreen.get());
     mpMtrBlue->SetAccessibleRelationLabeledBy(mpMtrBlue.get());
     mpMtrGamma->SetAccessibleRelationLabeledBy(mpMtrGamma.get());
-    mpMtrBrightness->SetAccessibleRelationLabeledBy(mpFtBrightness.get());  //7874
-    mpMtrContrast->SetAccessibleRelationLabeledBy(mpFtContrast.get());  //7874
-    mpMtrTrans->SetAccessibleRelationLabeledBy(mpFtTrans.get());    //7874
-    mpLBColorMode->SetAccessibleRelationLabeledBy(mpFtColorMode.get()); //7874
+    mpMtrBrightness->SetAccessibleRelationLabeledBy(mpFtBrightness.get());
+    mpMtrContrast->SetAccessibleRelationLabeledBy(mpFtContrast.get());
+    mpMtrTrans->SetAccessibleRelationLabeledBy(mpFtTrans.get());
+    mpLBColorMode->SetAccessibleRelationLabeledBy(mpFtColorMode.get());
+
+    // Fix left position of some controls that may be wrong due to
+    // rounding errors.
+    const sal_Int32 nRight0 (mpLBColorMode->GetPosPixel().X() + mpLBColorMode->GetSizePixel().Width());
+    const sal_Int32 nRight1 (mpMtrTrans->GetPosPixel().X() + mpMtrTrans->GetSizePixel().Width());
+    mpMtrRed->SetPosPixel(Point(
+            nRight0 - mpMtrRed->GetSizePixel().Width(),
+            mpMtrRed->GetPosPixel().Y()));
+    mpMtrBlue->SetPosPixel(Point(
+            nRight0 - mpMtrBlue->GetSizePixel().Width(),
+            mpMtrBlue->GetPosPixel().Y()));
+    mpMtrGreen->SetPosPixel(Point(
+            nRight1 - mpMtrGreen->GetSizePixel().Width(),
+            mpMtrGreen->GetPosPixel().Y()));
+    mpMtrGamma->SetPosPixel(Point(
+            nRight1 - mpMtrGamma->GetSizePixel().Width(),
+            mpMtrGamma->GetPosPixel().Y()));
 }
 
+
+
+
 //////////////////////////////////////////////////////////////////////////////
 
 IMPL_LINK( GraphicPropertyPanel, ModifyBrightnessHdl, void *, EMPTYARG )
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hrc b/svx/source/sidebar/graphic/GraphicPropertyPanel.hrc
index 0ca1f5c..16ab734 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hrc
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hrc
@@ -26,14 +26,6 @@
 #define LB_COLOR_MODE       11
 #define MBOX_WIDTH          50
 
-#define IMG_NORMAL          13
-#define IMG_BW              14
-#define IMG_GRAY            15
-#define IMG_WATER           16
-#define STR_NORMAL          17
-#define STR_BW              18
-#define STR_GRAY            19
-#define STR_WATER           20
 #define MF_RED              21
 #define MF_GREEN            22
 #define MF_BLUE             23
@@ -43,36 +35,3 @@
 #define IMG_BLUE            27
 #define IMG_GAMMA           28
 
-//===========================location================================
-
-#define FT_BRIGHTNESS_X         SECTIONPAGE_MARGIN_HORIZONTAL
-#define FT_BRIGHTNESS_Y         SECTIONPAGE_MARGIN_VERTICAL_TOP
-#define MTR_BRIGHTNESS_X        FT_BRIGHTNESS_X
-#define MTR_BRIGHTNESS_Y        FT_BRIGHTNESS_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
-#define FT_CONTRAST_X           FT_BRIGHTNESS_X + MBOX_WIDTH + CONTROL_SPACING_HORIZONTAL
-#define FT_CONTRAST_Y           FT_BRIGHTNESS_Y
-#define MTR_CONTRAST_X          FT_CONTRAST_X
-#define MTR_CONTRAST_Y          MTR_BRIGHTNESS_Y
-
-#define FT_COLOR_MODE_X         FT_BRIGHTNESS_X
-#define FT_COLOR_MODE_Y         MTR_BRIGHTNESS_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
-#define LBX_COLOR_MODE_X        FT_COLOR_MODE_X
-#define LBX_COLOR_MODE_Y        FT_COLOR_MODE_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
-
-#define FT_TRANSPARENT_X        FT_CONTRAST_X
-#define FT_TRANSPARENT_Y        MTR_CONTRAST_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
-#define MTR_TRANS_X             FT_TRANSPARENT_X
-#define MTR_TRANS_Y             FT_TRANSPARENT_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
-
-#define MF_RED_X                SECTIONPAGE_MARGIN_HORIZONTAL
-#define MF_RED_Y                MTR_TRANS_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
-#define MF_GREEN_X              MF_RED_X + MBOX_WIDTH + CONTROL_SPACING_HORIZONTAL
-#define MF_GREEN_Y              MF_RED_Y
-#define MF_BLUE_X               MF_RED_X
-#define MF_BLUE_Y               MF_RED_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
-#define MF_GAMMA_X              MF_GREEN_X
-#define MF_GAMMA_Y              MF_BLUE_Y
-
-#define PAGE_HEIGHT             MF_GAMMA_Y + MBOX_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT
-
-// eof
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.src b/svx/source/sidebar/graphic/GraphicPropertyPanel.src
index 4946b61..209d463 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.src
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.src
@@ -20,6 +20,22 @@
 #include <svx/dialogs.hrc>
 #include "helpid.hrc"
 
+#define X0      SECTIONPAGE_MARGIN_HORIZONTAL
+#define X1      X0 + 10
+#define X2      X0 + MBOX_WIDTH + CONTROL_SPACING_HORIZONTAL
+#define X3      X2 + 10
+
+#define Y0      SECTIONPAGE_MARGIN_VERTICAL_TOP
+#define Y1      Y0 + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
+#define Y2      Y1 + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
+#define Y3      Y2 + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
+#define Y4      Y3 + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
+#define Y5      Y4 + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
+
+#define PAGE_HEIGHT  Y5 + MBOX_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT
+
+
+
 Control RID_SIDEBAR_GRAPHIC_PANEL
 {
     OutputSize = TRUE;
@@ -32,14 +48,14 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
 
     FixedText FT_BRIGHTNESS
     {
-        Pos = MAP_APPFONT ( FT_BRIGHTNESS_X, FT_BRIGHTNESS_Y );
+        Pos = MAP_APPFONT (X0, Y0);
         Size = MAP_APPFONT ( MBOX_WIDTH , TEXT_HEIGHT ) ;
         Text [ en-US ] = "~Brightness:";
     };
     MetricField MTR_BRIGHTNESS
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( MTR_BRIGHTNESS_X, MTR_BRIGHTNESS_Y );
+        Pos = MAP_APPFONT (X0, Y1);
         Size = MAP_APPFONT ( MBOX_WIDTH , MBOX_HEIGHT ) ;
         HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_BRIGHT;
         QuickHelpText [ en-US ] = "Specify the luminance of the graphic.";
@@ -55,14 +71,14 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
     };
     FixedText FT_CONTRAST
     {
-        Pos = MAP_APPFONT ( FT_CONTRAST_X, FT_CONTRAST_Y );
+        Pos = MAP_APPFONT (X2, Y0);
         Size = MAP_APPFONT ( MBOX_WIDTH, TEXT_HEIGHT ) ;
         Text [ en-US ] = "~Contrast:";
     };
     MetricField MTR_CONTRAST
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( MTR_CONTRAST_X, MTR_CONTRAST_Y );
+        Pos = MAP_APPFONT (X2, Y1);
         Size = MAP_APPFONT ( MBOX_WIDTH , MBOX_HEIGHT ) ;
         HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_CONTRAST;
         QuickHelpText [ en-US ] = "Specify the degree of difference between the lightest and darkest parts of the graphic.";
@@ -78,14 +94,14 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
     };
     FixedText FT_COLOR_MODE
     {
-        Pos = MAP_APPFONT ( FT_COLOR_MODE_X, FT_COLOR_MODE_Y );
+        Pos = MAP_APPFONT (X0, Y2);
         Size = MAP_APPFONT ( MBOX_WIDTH, TEXT_HEIGHT ) ;
         Text [ en-US ] = "Color ~mode:";
     };
     ListBox LB_COLOR_MODE
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( LBX_COLOR_MODE_X , LBX_COLOR_MODE_Y ) ;
+        Pos = MAP_APPFONT (X0 , Y3) ;
         Size = MAP_APPFONT ( MBOX_WIDTH , 100 ) ;
         HelpID = HID_PROPERTY_PANEL_GRAPHIC_LB_COLORMODE;
         QuickHelpText [ en-US ] = "Select the color mode of the graphic.";
@@ -94,14 +110,14 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
     };
     FixedText FT_TRANSPARENT
     {
-        Pos = MAP_APPFONT ( FT_TRANSPARENT_X, FT_TRANSPARENT_Y );
+        Pos = MAP_APPFONT (X2, Y2);
         Size = MAP_APPFONT ( MBOX_WIDTH , TEXT_HEIGHT ) ;
         Text [ en-US ] = "~Transparency:";
     };
     MetricField MTR_TRANSPARENT
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( MTR_TRANS_X, MTR_TRANS_Y ) ;
+        Pos = MAP_APPFONT (X2, Y3) ;
         Size = MAP_APPFONT ( MBOX_WIDTH ,MBOX_HEIGHT ) ;
         HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_TRANSP;
         QuickHelpText [ en-US ] = "Specify the percentage of transparency; 0% is fully opaque and 100% is fully transparent.";
@@ -117,7 +133,7 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
     MetricField MF_RED
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( MF_RED_X + 10, MF_RED_Y ) ;
+        Pos = MAP_APPFONT (X1, Y4) ;
         Size = MAP_APPFONT ( MBOX_WIDTH - 10,MBOX_HEIGHT ) ;
         HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_RED;
         QuickHelpText [ en-US ] = "Red";
@@ -134,7 +150,7 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
     MetricField MF_GREEN
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( MF_GREEN_X + 10, MF_GREEN_Y ) ;
+        Pos = MAP_APPFONT (X3, Y4) ;
         Size = MAP_APPFONT ( MBOX_WIDTH - 10 ,MBOX_HEIGHT ) ;
         HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_GREEN;
         QuickHelpText [ en-US ] = "Green";
@@ -151,7 +167,7 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
     MetricField MF_BLUE
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( MF_BLUE_X + 10, MF_BLUE_Y ) ;
+        Pos = MAP_APPFONT (X1, Y5) ;
         Size = MAP_APPFONT ( MBOX_WIDTH - 10 ,MBOX_HEIGHT ) ;
         HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_BLUE;
         QuickHelpText [ en-US ] = "Blue";
@@ -168,7 +184,7 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
     MetricField MF_GAMMA
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( MF_GAMMA_X + 10, MF_GAMMA_Y ) ;
+        Pos = MAP_APPFONT (X3, Y5) ;
         Size = MAP_APPFONT ( MBOX_WIDTH - 10 ,MBOX_HEIGHT ) ;
         HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_GAMMA;
         QuickHelpText [ en-US ] = "Specify the gamma value that affects the brightness of the midtone values.";
@@ -180,25 +196,9 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
         DecimalDigits = 2;
         SpinSize = 10;
     };
-    Image IMG_NORMAL
-    {
-        ImageBitmap = Bitmap{File = "symphony/ColorModeNormal_16x16.png";};
-    };
-    Image IMG_BW
-    {
-        ImageBitmap = Bitmap{File = "symphony/ColorModeBlackWhite_16x16.png";};
-    };
-    Image IMG_GRAY
-    {
-        ImageBitmap = Bitmap{File = "symphony/ColorModeGrey_16x16.png";};
-    };
-    Image IMG_WATER
-    {
-        ImageBitmap = Bitmap{File = "symphony/ColorModeWaterMark_16x16.png";};
-    };
     FixedImage IMG_RED
     {
-        Pos = MAP_APPFONT( MF_RED_X, MF_RED_Y );
+        Pos = MAP_APPFONT(X0, Y4);
         Size = MAP_APPFONT( 10, 12 );
         Fixed = Image
         {
@@ -207,7 +207,7 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
     };
     FixedImage IMG_GREEN
     {
-        Pos = MAP_APPFONT( MF_GREEN_X, MF_GREEN_Y );
+        Pos = MAP_APPFONT(X2, Y4);
         Size = MAP_APPFONT( 10, 12 );
         Fixed = Image
         {
@@ -216,7 +216,7 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
     };
     FixedImage IMG_BLUE
     {
-        Pos = MAP_APPFONT( MF_BLUE_X, MF_BLUE_Y );
+        Pos = MAP_APPFONT(X0, Y5);
         Size = MAP_APPFONT( 10, 12 );
         Fixed = Image
         {
@@ -225,29 +225,13 @@ Control RID_SIDEBAR_GRAPHIC_PANEL
     };
     FixedImage IMG_GAMMA
     {
-        Pos = MAP_APPFONT( MF_GAMMA_X, MF_GAMMA_Y );
+        Pos = MAP_APPFONT(X2, Y5);
         Size = MAP_APPFONT( 10, 12 );
         Fixed = Image
         {
             ImageBitmap = Bitmap { File = "symphony/AdjustColorGamma_16x16.png"; };
         };
     };
-    String STR_NORMAL
-    {
-        Text [ en-US ] = "Normal";
-    };
-    String STR_BW
-    {
-        Text [ en-US ] = "Black/White";
-    };
-    String STR_GRAY
-    {
-        Text [ en-US ] = "Grayscale";
-    };
-    String STR_WATER
-    {
-        Text [ en-US ] = "Watermark";
-    };
 };
 
 // eof
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 7136304..0471caf 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -909,6 +909,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
                             break;
                         case 315000:
                             mpMtrAngle->SelectEntryPos(7);
+                            break;
                     }
 
                     break;


More information about the Libreoffice-commits mailing list