Le Thu, 03 Mar 2011 11:59:19 +0000, Michael Meeks <michael.meeks@novell.com> a écrit :
Hi Sebastien, On Tue, 2011-03-01 at 23:42 +0100, Sébastien Le Ray wrote:Here is a complete patch for fdo#31251. It adds a smooth shadow to the page.Wow - it is really pretty indeed :-) I just pushed it. Nice work ! can you confirm is it LGPLv3+/MPL ? Incidentally, it would be lovely to have the post-it notes, not only to have a border, but to have curved corners at the bottom, but not the top, so they really look like sticky notes. ie. take a sticky note an stick it flat on your desk, and you see the effect [ both bottom corners curl slightly ] ;-) possibly that will require some (manual?) re-coloring action of the bitmaps, which might be slightly painful, though I guess it is just a matter of keeping a constant AlphaMask bitmap around, and merging it into a BitmapEx with a Bitmap (of the same size obviously) 'Erase'd with the correct color for the note.During its development, I found that SwRect::_Intersection (used in page margin painting) returns negative height/width if the two rectangles do not overlap. I don't know if it is the expected behavior or a bug. If it's a bug I guess I can provide a patch.Ho hum - probably a difficult one to audit for, to check every location to ensure they are not depending on this. Possibly it makes the impl. faster too (?). Well worth documenting though in the API. Thanks ! Michael.
Hi, this simple shadow patch has generated a long discussion on Libreoffice-design. Some people don't like the color, some people don't like the amount of blur, some people want no shadow at all, some people want a "4 borders" shadow. So here is a second patchset that tries to address the first three critics : - It adds a configuration option (in Appearance category) to set shadow color. It currently defaults to gray but I'm sure design team will find a more sensitive default : - It adds a configuration option to disable shadow; - It doesn't use bitmaps directly anymore but an alpha mask, so if people want to try another blur effect, they just have to edit images.zip:/sw/res/page-*-shadow-mask.png These are black & white image. Black amount determines transparency, white being fully transparent. Here again, I'm sure that design people will find a better default. Only constraints are 1x10px for bottom shadow, 10x10px for corner and 10x1px for right shadow. I'll let design team play and discuss with that, when they agree on a default, I'll provide an additional patch to take it into account. Note: I had to perform a make dev-install for settings to be correctly saved. Regards Sébastien
From 56705efe8542ad48d7e2b498d702c067878aab26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoffice@orniz.org> Date: Tue, 8 Mar 2011 08:02:08 +0100 Subject: [PATCH] Added shadow color configuration save. --- svtools/inc/svtools/colorcfg.hxx | 1 + svtools/source/config/colorcfg.cxx | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/svtools/inc/svtools/colorcfg.hxx b/svtools/inc/svtools/colorcfg.hxx index 6231685..5c95dc1 100644 --- a/svtools/inc/svtools/colorcfg.hxx +++ b/svtools/inc/svtools/colorcfg.hxx @@ -51,6 +51,7 @@ enum ColorConfigEntry ANCHOR , SPELL , SMARTTAGS , + SHADOWCOLOR , WRITERTEXTGRID , WRITERFIELDSHADINGS , WRITERIDXSHADINGS , diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index c98c885..7be72cf 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -137,6 +137,7 @@ uno::Sequence< OUString> ColorConfig_Impl::GetPropertyNames(const rtl::OUString& { RTL_CONSTASCII_USTRINGPARAM("/Anchor") ,sal_False }, { RTL_CONSTASCII_USTRINGPARAM("/Spell") ,sal_False }, { RTL_CONSTASCII_USTRINGPARAM("/SmartTags") ,sal_False }, + { RTL_CONSTASCII_USTRINGPARAM("/Shadow") , sal_True }, { RTL_CONSTASCII_USTRINGPARAM("/WriterTextGrid") ,sal_False }, { RTL_CONSTASCII_USTRINGPARAM("/WriterFieldShadings"),sal_True }, { RTL_CONSTASCII_USTRINGPARAM("/WriterIdxShadings") ,sal_True }, @@ -428,6 +429,7 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry) 0, // ANCHOR 0xff0000, // SPELL COL_LIGHTMAGENTA,// SMARTTAGS + COL_GRAY, // SHADOWCOLOR 0xc0c0c0, // WRITERTEXTGRID 0xc0c0c0, // WRITERFIELDSHADIN 0xc0c0c0, // WRITERIDXSHADINGS -- 1.7.4.1
From c30a7d8001c04bacead8b72c175e640e76ee4017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoffice@orniz.org> Date: Tue, 8 Mar 2011 08:02:57 +0100 Subject: [PATCH] Added shadow configuration to prefs schema. --- .../registry/data/org/openoffice/Office/UI.xcu | 8 ++++++++ .../registry/schema/org/openoffice/Office/UI.xcs | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI.xcu b/officecfg/registry/data/org/openoffice/Office/UI.xcu index 5af8183..cca7916 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI.xcu @@ -361,6 +361,14 @@ <value xsi:nil="true"/> </prop> </node> + <node oor:name="Shadow"> + <prop oor:name="IsVisible"> + <value>true</value> + </prop> + <prop oor:name="Color"> + <value xsi:nil="true"/> + </prop> + </node> <node oor:name="WriterTextGrid"> <prop oor:name="Color"> <value xsi:nil="true"/> diff --git a/officecfg/registry/schema/org/openoffice/Office/UI.xcs b/officecfg/registry/schema/org/openoffice/Office/UI.xcs index 48d018d..1784d82 100644 --- a/officecfg/registry/schema/org/openoffice/Office/UI.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/UI.xcs @@ -199,6 +199,22 @@ </info> </prop> </group> + <group oor:name="Shadow"> + <info> + <desc>Specifies the settings for shadows.</desc> + </info> + <prop oor:name="IsVisible" oor:type="xs:boolean"> + <info> + <desc>Specifies the visibility of shadows (true = visible).</desc> + </info> + <value>true</value> + </prop> + <prop oor:name="Color" oor:type="xs:int"> + <info> + <desc>Specifies the color used for shadows.</desc> + </info> + </prop> + </group> <group oor:name="WriterTextGrid"> <info> <desc>Specifies the settings for the text grid in Writer.</desc> -- 1.7.4.1
From 03204823664dd33d66c6dacb35d5a969d6f67d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoffice@orniz.org> Date: Tue, 8 Mar 2011 07:58:42 +0100 Subject: [PATCH] Added shadow option to appearance dialog. --- cui/source/options/optcolor.cxx | 10 +++ cui/source/options/optcolor.hrc | 4 + cui/source/options/optcolor.src | 155 ++++++++++++++++++++------------------- 3 files changed, 95 insertions(+), 74 deletions(-) diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 4ac044a..f2c3a4e 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -110,6 +110,9 @@ class ColorConfigWindow_Impl : public Window FixedText aSmarttagsFT; ColorListBox aSmarttagsLB; Window aSmarttagsWN; + CheckBox aShadowColorCB; + ColorListBox aShadowColorLB; + Window aShadowColorWN; Window aWriterBackWN; SvxExtFixedText_Impl aWriterFT; FixedText aWrtTextGridFT; @@ -305,6 +308,7 @@ sal_Int16 lcl_getGroup( sal_Int32 _nFeature ) case ANCHOR : case SPELL : case SMARTTAGS : + case SHADOWCOLOR : { nRet = GROUP_GENERAL; break; @@ -412,6 +416,9 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rRe aSmarttagsFT(this, ResId( FT_SMARTTAGS, *rResId.GetResMgr() )), aSmarttagsLB(this, ResId( LB_SMARTTAGS, *rResId.GetResMgr() )), aSmarttagsWN(this, ResId( WN_SMARTTAGS, *rResId.GetResMgr() )), + aShadowColorCB(this, ResId( CB_SHADOWCOLOR, *rResId.GetResMgr())), + aShadowColorLB(this, ResId( LB_SHADOWCOLOR, *rResId.GetResMgr())), + aShadowColorWN(this, ResId( WN_SHADOWCOLOR, *rResId.GetResMgr())), aWriterBackWN(this), aWriterFT(this, ResId(FT_WRITER, *rResId.GetResMgr())), aWrtTextGridFT(this, ResId( FT_WRITERTEXTGRID, *rResId.GetResMgr())), @@ -549,6 +556,7 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rRe aCheckBoxes[LINKSVISITED ] = &aLinksVisitedCB ; aFixedTexts[SPELL ]=& aSpellFT; aFixedTexts[SMARTTAGS ]=& aSmarttagsFT; + aCheckBoxes[SHADOWCOLOR ]=& aShadowColorCB; aFixedTexts[WRITERTEXTGRID ]=& aWrtTextGridFT; aCheckBoxes[WRITERFIELDSHADINGS ] = &aWrtFieldCB ; aCheckBoxes[WRITERIDXSHADINGS ] = &aWrtIdxShadingBackCB ; @@ -594,6 +602,7 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rRe aColorBoxes[LINKSVISITED ] = &aLinksVisitedLB ; aColorBoxes[SPELL ] = &aSpellLB ; aColorBoxes[SMARTTAGS ] = &aSmarttagsLB ; + aColorBoxes[SHADOWCOLOR ] = &aShadowColorLB ; aColorBoxes[WRITERTEXTGRID ] = &aWrtTextGridLB ; aColorBoxes[WRITERFIELDSHADINGS ] = &aWrtFieldLB ; aColorBoxes[WRITERIDXSHADINGS ] = &aWrtIdxShadingBackLB ; @@ -639,6 +648,7 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rRe aWindows[LINKSVISITED ] = &aLinksVisitedWN ; aWindows[SPELL ] = &aSpellWN ; aWindows[SMARTTAGS ] = &aSmarttagsWN ; + aWindows[SHADOWCOLOR ] = &aShadowColorWN ; aWindows[WRITERTEXTGRID ] = &aWrtTextGridWN ; aWindows[WRITERFIELDSHADINGS ] = &aWrtFieldWN ; aWindows[WRITERIDXSHADINGS ] = &aWrtIdxShadingBackWN ; diff --git a/cui/source/options/optcolor.hrc b/cui/source/options/optcolor.hrc index 37478e0..504cd5f 100644 --- a/cui/source/options/optcolor.hrc +++ b/cui/source/options/optcolor.hrc @@ -186,6 +186,10 @@ #define LB_SQLCOMMENT 193 #define WN_SQLCOMMENT 194 +#define CB_SHADOWCOLOR 196 +#define LB_SHADOWCOLOR 197 +#define WN_SHADOWCOLOR 198 + #define ST_EXTENSION 166 diff --git a/cui/source/options/optcolor.src b/cui/source/options/optcolor.src index b2e9c15..83dc067 100644 --- a/cui/source/options/optcolor.src +++ b/cui/source/options/optcolor.src @@ -211,280 +211,287 @@ TabPage RID_SVXPAGE_COLORCONFIG }; LB_WN( SMARTTAGS, 10 ) + Checkbox CB_SHADOWCOLOR + { + CB_POS_SIZE( 11 ); + Text [ en-US ] = "Shadows"; + }; + LB_WN( SHADOWCOLOR, 11 ) + FixedText FT_WRITER { - FT_SEP_POS_SIZE( 11 ); + FT_SEP_POS_SIZE( 12 ); Text [ en-US ] = "Text Document"; }; FixedText FT_WRITERTEXTGRID { - FT_POS_SIZE( 12 ); + FT_POS_SIZE( 13 ); Text [ en-US ] = "Grid"; }; - LB_WN( WRITERTEXTGRID, 12 ) + LB_WN( WRITERTEXTGRID, 13 ) CheckBox CB_WRITERFIELDSHADINGS { - CB_POS_SIZE( 13 ); + CB_POS_SIZE( 14 ); Text [ en-US ] = "Field shadings"; }; - LB_WN( WRITERFIELDSHADINGS, 13 ) + LB_WN( WRITERFIELDSHADINGS, 14 ) CheckBox CB_WRITERIDXSHADINGS { - CB_POS_SIZE( 14 ); + CB_POS_SIZE( 15 ); Text [ en-US ] = "Index and table shadings"; }; - LB_WN( WRITERIDXSHADINGS, 14 ) + LB_WN( WRITERIDXSHADINGS, 15 ) FixedText FT_WRITERSCRIPTINDICATOR { - FT_POS_SIZE( 15 ); + FT_POS_SIZE( 16 ); Text [ en-US ] = "Script indicator"; }; - LB_WN( WRITERSCRIPTINDICATOR, 15 ) + LB_WN( WRITERSCRIPTINDICATOR, 16 ) CheckBox CB_WRITERSECTIONBOUNDARIES { - CB_POS_SIZE( 16 ); + CB_POS_SIZE( 17 ); Text [ en-US ] = "Section boundaries"; }; - LB_WN( WRITERSECTIONBOUNDARIES, 16 ) + LB_WN( WRITERSECTIONBOUNDARIES, 17 ) FixedText FT_WRITERPAGEBREAKS { - FT_POS_SIZE( 17 ); + FT_POS_SIZE( 18 ); Text [ en-US ] = "Page and column breaks"; }; - LB_WN( WRITERPAGEBREAKS, 17 ) + LB_WN( WRITERPAGEBREAKS, 18 ) FixedText FT_WRITERDIRECTCURSOR { - FT_POS_SIZE( 18 ); + FT_POS_SIZE( 19 ); Text [ en-US ] = "Direct cursor"; }; - LB_WN( WRITERDIRECTCURSOR, 18 ) + LB_WN( WRITERDIRECTCURSOR, 19 ) FixedText FT_HTML { - FT_SEP_POS_SIZE( 19 ); + FT_SEP_POS_SIZE( 20 ); Text [ en-US ] = "HTML Document"; }; FixedText FT_HTMLSGML { - FT_POS_SIZE( 20 ); + FT_POS_SIZE( 21 ); Text [ en-US ] = "SGML syntax highlighting"; }; - LB_WN( HTMLSGML, 20 ) + LB_WN( HTMLSGML, 21 ) FixedText FT_HTMLCOMMENT { - FT_POS_SIZE( 21 ); + FT_POS_SIZE( 22 ); Text [ en-US ] = "Comment highlighting"; }; - LB_WN( HTMLCOMMENT, 21 ) + LB_WN( HTMLCOMMENT, 22 ) FixedText FT_HTMLKEYWORD { - FT_POS_SIZE( 22 ); + FT_POS_SIZE( 23 ); Text [ en-US ] = "Keyword highlighting"; }; - LB_WN( HTMLKEYWORD, 22 ) + LB_WN( HTMLKEYWORD, 23 ) FixedText FT_HTMLUNKNOWN { - FT_POS_SIZE( 23 ); + FT_POS_SIZE( 24 ); Text [ en-US ] = "Text"; }; - LB_WN( HTMLUNKNOWN, 23 ) + LB_WN( HTMLUNKNOWN, 24 ) FixedText FT_CALC { - FT_SEP_POS_SIZE( 24 ); + FT_SEP_POS_SIZE( 25 ); Text [ en-US ] = "Spreadsheet"; }; FixedText FT_CALCGRID { - FT_POS_SIZE( 25 ); + FT_POS_SIZE( 26 ); Text [ en-US ] = "Grid lines"; }; - LB_WN( CALCGRID, 25 ) + LB_WN( CALCGRID, 26 ) FixedText FT_CALCPAGEBREAK { - FT_POS_SIZE( 26 ); + FT_POS_SIZE( 27 ); Text [ en-US ] = "Page breaks"; }; - LB_WN( CALCPAGEBREAK, 26 ) + LB_WN( CALCPAGEBREAK, 27 ) FixedText FT_CALCPAGEBREAKMANUAL { - FT_POS_SIZE( 27 ); + FT_POS_SIZE( 28 ); Text [ en-US ] = "Manual page breaks"; }; - LB_WN( CALCPAGEBREAKMANUAL, 27 ) + LB_WN( CALCPAGEBREAKMANUAL, 28 ) FixedText FT_CALCPAGEBREAKAUTO { - FT_POS_SIZE( 28 ); + FT_POS_SIZE( 29 ); Text [ en-US ] = "Automatic page breaks"; }; - LB_WN( CALCPAGEBREAKAUTO, 28) + LB_WN( CALCPAGEBREAKAUTO, 29) FixedText FT_CALCDETECTIVE { - FT_POS_SIZE( 29 ); + FT_POS_SIZE( 30 ); Text [ en-US ] = "Detective"; }; - LB_WN( CALCDETECTIVE, 29 ) + LB_WN( CALCDETECTIVE, 30 ) FixedText FT_CALCDETECTIVEERROR { - FT_POS_SIZE( 30 ); + FT_POS_SIZE( 31 ); Text [ en-US ] = "Detective error"; }; - LB_WN( CALCDETECTIVEERROR, 30 ) + LB_WN( CALCDETECTIVEERROR, 31 ) FixedText FT_CALCREFERENCE { - FT_POS_SIZE( 31 ); + FT_POS_SIZE( 32 ); Text [ en-US ] = "References"; }; - LB_WN( CALCREFERENCE, 31 ) + LB_WN( CALCREFERENCE, 32 ) FixedText FT_CALCNOTESBACKGROUND { - FT_POS_SIZE( 32 ); + FT_POS_SIZE( 33 ); Text [ en-US ] = "Notes background"; }; - LB_WN( CALCNOTESBACKGROUND, 32 ) + LB_WN( CALCNOTESBACKGROUND, 33 ) FixedText FT_DRAW { - FT_SEP_POS_SIZE( 33 ); + FT_SEP_POS_SIZE( 34 ); Text [ en-US ] = "Drawing / Presentation"; }; FixedText FT_DRAWGRID { - FT_POS_SIZE( 34 ); + FT_POS_SIZE( 35 ); Text [ en-US ] = "Grid"; }; - LB_WN( DRAWGRID, 34 ) + LB_WN( DRAWGRID, 35 ) FixedText FT_BASIC { - FT_SEP_POS_SIZE( 35 ); + FT_SEP_POS_SIZE( 36 ); Text [ en-US ] = "Basic Syntax Highlighting"; }; FixedText FT_BASICIDENTIFIER { - FT_POS_SIZE( 36 ); + FT_POS_SIZE( 37 ); Text [ en-US ] = "Identifier"; }; - LB_WN( BASICIDENTIFIER, 36 ) + LB_WN( BASICIDENTIFIER, 37 ) FixedText FT_BASICCOMMENT { - FT_POS_SIZE( 37 ); + FT_POS_SIZE( 38 ); Text [ en-US ] = "Comment"; }; - LB_WN( BASICCOMMENT, 37 ) + LB_WN( BASICCOMMENT, 38 ) FixedText FT_BASICNUMBER { - FT_POS_SIZE( 38 ); + FT_POS_SIZE( 39 ); Text [ en-US ] = "Number"; }; - LB_WN( BASICNUMBER, 38) + LB_WN( BASICNUMBER, 39) FixedText FT_BASICSTRING { - FT_POS_SIZE( 39 ); + FT_POS_SIZE( 40 ); Text [ en-US ] = "String"; }; - LB_WN( BASICSTRING, 39 ) + LB_WN( BASICSTRING, 40 ) FixedText FT_BASICOPERATOR { - FT_POS_SIZE( 40 ); + FT_POS_SIZE( 41 ); Text [ en-US ] = "Operator"; }; - LB_WN( BASICOPERATOR, 40 ) + LB_WN( BASICOPERATOR, 41 ) FixedText FT_BASICKEYWORD { - FT_POS_SIZE( 41 ); + FT_POS_SIZE( 42 ); Text [ en-US ] = "Reserved expression"; }; - LB_WN( BASICKEYWORD, 41 ) + LB_WN( BASICKEYWORD, 42 ) FixedText FT_BASICERROR { - FT_POS_SIZE( 42 ); + FT_POS_SIZE( 43 ); Text [ en-US ] = "Error"; }; - LB_WN( BASICERROR, 42 ) + LB_WN( BASICERROR, 43 ) FixedText FT_SQL_COMMAND { - FT_SEP_POS_SIZE( 43 ); + FT_SEP_POS_SIZE( 44 ); Text [ en-US ] = "SQL Syntax Highlighting"; }; FixedText FT_SQLIDENTIFIER { - FT_POS_SIZE( 44 ); + FT_POS_SIZE( 45 ); Text [ en-US ] = "Identifier"; }; - LB_WN( SQLIDENTIFIER, 44 ) + LB_WN( SQLIDENTIFIER, 45 ) FixedText FT_SQLNUMBER { - FT_POS_SIZE( 45 ); + FT_POS_SIZE( 46 ); Text [ en-US ] = "Number"; }; - LB_WN( SQLNUMBER, 45 ) + LB_WN( SQLNUMBER, 46 ) FixedText FT_SQLSTRING { - FT_POS_SIZE( 46 ); + FT_POS_SIZE( 47 ); Text [ en-US ] = "String"; }; - LB_WN( SQLSTRING, 46 ) + LB_WN( SQLSTRING, 47 ) FixedText FT_SQLOPERATOR { - FT_POS_SIZE( 47 ); + FT_POS_SIZE( 48 ); Text [ en-US ] = "Operator"; }; - LB_WN( SQLOPERATOR, 47 ) + LB_WN( SQLOPERATOR, 48 ) FixedText FT_SQLKEYWORD { - FT_POS_SIZE( 48 ); + FT_POS_SIZE( 49 ); Text [ en-US ] = "Keyword"; }; - LB_WN( SQLKEYWORD, 48 ) + LB_WN( SQLKEYWORD, 49 ) FixedText FT_SQLPARAMETER { - FT_POS_SIZE( 49 ); + FT_POS_SIZE( 50 ); Text [ en-US ] = "Parameter"; }; - LB_WN( SQLPARAMETER, 49 ) + LB_WN( SQLPARAMETER, 50 ) FixedText FT_SQLCOMMENT { - FT_POS_SIZE( 50 ); + FT_POS_SIZE( 51 ); Text [ en-US ] = "Comment"; }; - LB_WN( SQLCOMMENT, 50 ) + LB_WN( SQLCOMMENT, 51 ) String ST_EXTENSION { -- 1.7.4.1
From 03d88d4c4448d05a0328a3fa5c6d7dd054a150e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoffice@orniz.org> Date: Sun, 6 Mar 2011 16:18:09 +0100 Subject: [PATCH 1/3] Converted shadow images to alpha masks. --- default_images/sw/res/page-bottom-shadow.png | Bin 193 -> 181 bytes default_images/sw/res/page-bottomright-shadow.png | Bin 289 -> 208 bytes default_images/sw/res/page-right-shadow.png | Bin 191 -> 180 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/default_images/sw/res/page-bottom-shadow.png b/default_images/sw/res/page-bottom-shadow.png index fe881a97cc14556d3da978024cbff78912d9c1f6..fd19f034bb0fc80350c240eab1c0e33d7864f1e0 100644 GIT binary patch delta 100 zcmX@exRr5&q%s2#1nkV72Ba8^gWR1M)}51i3FI&(dAqwX{BQ3+vwxz4JSQ_7pQ5O( y)qbam85)`*o-U3d9M_W*5+<ZfN&>=^rppW*TN%DRy;`~+WT2<3pUXO@geCy?ejwuj delta 112 zcmdnWc#v^|q&gb|14HR06E7geSRCZ;#IWw1%u67LEy>&6h2cL4F4((#@<bbXP9|v{ zS;4Eu1r`%iGz?`tT^vI=t|#xP`TM6{jg77CxepHy&-n*OisvLT1Z?A8cHq?AML=^H NJYD@<);T3K0RY>0CeZ)@ diff --git a/default_images/sw/res/page-bottomright-shadow.png b/default_images/sw/res/page-bottomright-shadow.png index ff00470bc5f24ee6ede99cbc892430cb9cbea8c9..94f32290092a528df8eeb76fadec1f5b9b77987b 100644 GIT binary patch delta 163 zcmZ3;bb)b#q%s2#tcaYD2&5Q`gWR1M)}51i3FI&(dAqwX{BQ3+vwxz4d?_;<m$XR6 z+@FO&sSr;W#}JO|tOrjr9#G(5Ip7-3IZws@#r_LtIFyu)jW!*5vu0@r$L9N~tJY48 zoIXF(d1_$p?)Mve0!w4}r%#N$@~!r7gXZ6v$L$*efArKc7%W*S$WSNZ#gb9|%B2Ko OK7*&LpUXO@geCx(6F(^c delta 245 zcmV<R01E%m0ignr87Bq+0050L&%FQu00DDSM?wIu&K&6g000JJOGiWi{{a60|De66 zlaV|he*zl}8Y^6WKTQAt0HH}lK~xyiUC=vj!!Qtp;ZK1tqe6x5e~1(*d;_OTWJ$3s zM~@U928I?GkRbov8M68~zwh|O<z>Ab&)%~6!2=6cY|&nHO4kEdjF>P-ztK{_HBg5> z4ij#r=@jcV7sF0hJsXCABc@ky##lWgbcxbqLu~5y-+Bu;WzrSj=$g9ip@4fHbWgrM vQ@^B&^_H)>C)ZFW9l<@{Fk@=!c5$dbiV|COnXtfk00000NkvXXu0mjfb`53v diff --git a/default_images/sw/res/page-right-shadow.png b/default_images/sw/res/page-right-shadow.png index 7b8870ed042f72bb7da4e0c6abcc1930b778cb0f..784e00f37afcaf952f6a82c40f390b0f5fbda432 100644 GIT binary patch delta 99 zcmdnbxP@_oq%s2#9GaJ~2uLv&2e~^jtUD+363Agn@^*J&_}|`tX8%M7c}`|FJ_W5w x?u+dvW@u;#d%8G=a9mGLnJ{J2q$wcG!oV_-;d#-Xpp78&JYD@<);T3K0RZ|yAW;AS delta 110 zcmdnOxSw%?q&gb|1H<#L_H{stu{g-xiDBJ2nU_EgTavfC3&Vd9T(Ecf<cT)&oJ`U@ zGUjrsM_MMPXy{9Mx;Tb#Tu<Ip^Y>3Z8(Z6R9v+_a3w~Id*)i}JaZe36ll2B@3WKMs KpUXO@geCyLw<R+G -- 1.7.4.1
From eff3d43f2fb30ba8114396aa733658f15c80ef8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoffice@orniz.org> Date: Sun, 6 Mar 2011 16:19:48 +0100 Subject: [PATCH 1/4] Using alpha mask for page shadow drawing. Alpha masks will allow us to have configurable shadow colors. --- sw/source/core/layout/paintfrm.cxx | 39 +++++++++++++++++++++++++++++++---- 1 files changed, 34 insertions(+), 5 deletions(-) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index ec6a5d6..82ab24b 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -5303,7 +5303,38 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *_pViewShell->GetOut() ); // <-- - BitmapEx aPageBottomShadow( SW_RES( BMP_PAGE_BOTTOM_SHADOW ) ); + static bool initialized = false; + static BitmapEx aPageTopRightShadow; + static BitmapEx aPageBottomRightShadow; + static BitmapEx aPageBottomLeftShadow; + static BitmapEx aPageBottomShadowBase; + static BitmapEx aPageRightShadowBase; + static Color aShadowColor( COL_BLACK ); + + + if(!initialized) { + AlphaMask aMask( SW_RES( BMP_PAGE_BOTTOM_RIGHT_SHADOW ) ); + Bitmap aFilledSquare( Size( mnShadowPxWidth, mnShadowPxWidth ), 24 ); + aFilledSquare.Erase( aShadowColor ); + + aPageBottomRightShadow = BitmapEx( aFilledSquare, aMask ); + aMask.Rotate( 900, 255 ); + aPageTopRightShadow = BitmapEx( aFilledSquare, aMask ); + aMask.Rotate( 1800, 255); + aPageBottomLeftShadow = BitmapEx( aFilledSquare, aMask ); + + aFilledSquare = Bitmap( Size( 1, mnShadowPxWidth ), 24 ); + aFilledSquare.Erase( aShadowColor ); + aMask = Bitmap( SW_RES( BMP_PAGE_BOTTOM_SHADOW ) ); + aPageBottomShadowBase = BitmapEx( aFilledSquare, aMask ); + + aFilledSquare = Bitmap( Size( mnShadowPxWidth, 1 ), 24 ); + aFilledSquare.Erase( aShadowColor ); + aMask = Bitmap( SW_RES( BMP_PAGE_RIGHT_SHADOW ) ); + aPageRightShadowBase = BitmapEx( aFilledSquare, aMask ); + + initialized = true; + } SwRect aPaintRect; OutputDevice *pOut = _pViewShell->GetOut(); @@ -5311,10 +5342,8 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; // paint right shadow if ( bPaintRightShadow ) { - BitmapEx aPageRightShadow( SW_RES( BMP_PAGE_RIGHT_SHADOW ) ); - BitmapEx aPageTopRightShadow( SW_RES( BMP_PAGE_TOP_RIGHT_SHADOW ) ); - BitmapEx aPageBottomRightShadow( SW_RES( BMP_PAGE_BOTTOM_RIGHT_SHADOW ) ); SwPageFrm::GetRightShadowRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar ); + BitmapEx aPageRightShadow = aPageRightShadowBase; aPageRightShadow.Scale( 1, aPaintRect.Height() ); pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.Pos() ), aPageRightShadow ); pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Left(), aPaintRect.Top() - mnShadowPxWidth ) ), aPageTopRightShadow ); @@ -5325,9 +5354,9 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; SwPageFrm::GetBottomShadowRect( _rPageRect, _pViewShell, aPaintRect, bFullBottomShadow, bRightSidebar ); if(!bFullBottomShadow) { - BitmapEx aPageBottomLeftShadow( SW_RES( BMP_PAGE_BOTTOM_LEFT_SHADOW ) ); pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Left() - mnShadowPxWidth, aPaintRect.Top() ) ), aPageBottomLeftShadow ); } + BitmapEx aPageBottomShadow = aPageBottomShadowBase; aPageBottomShadow.Scale( aPaintRect.Width(), 1 ); pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.Pos() ), aPageBottomShadow); } -- 1.7.4.1
From b9b31354be0a43da21ceac086d471f3787eb3fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoffice@orniz.org> Date: Sun, 6 Mar 2011 16:31:58 +0100 Subject: [PATCH 2/4] Removed no more used shadow images. --- sw/source/core/inc/pagefrm.hrc | 8 +++----- sw/source/core/layout/pagefrm.src | 10 ---------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/sw/source/core/inc/pagefrm.hrc b/sw/source/core/inc/pagefrm.hrc index c72c212..20a0512 100644 --- a/sw/source/core/inc/pagefrm.hrc +++ b/sw/source/core/inc/pagefrm.hrc @@ -31,11 +31,9 @@ #include "rcid.hrc" // Bitmaps for page shadow -#define BMP_PAGE_TOP_RIGHT_SHADOW RC_PAGEFRM_BEGIN -#define BMP_PAGE_RIGHT_SHADOW RC_PAGEFRM_BEGIN + 1 -#define BMP_PAGE_BOTTOM_RIGHT_SHADOW RC_PAGEFRM_BEGIN + 2 -#define BMP_PAGE_BOTTOM_SHADOW RC_PAGEFRM_BEGIN + 3 -#define BMP_PAGE_BOTTOM_LEFT_SHADOW RC_PAGEFRM_BEGIN + 4 +#define BMP_PAGE_RIGHT_SHADOW RC_PAGEFRM_BEGIN + 0 +#define BMP_PAGE_BOTTOM_RIGHT_SHADOW RC_PAGEFRM_BEGIN + 1 +#define BMP_PAGE_BOTTOM_SHADOW RC_PAGEFRM_BEGIN + 2 // If you add resources, don't forget to update this diff --git a/sw/source/core/layout/pagefrm.src b/sw/source/core/layout/pagefrm.src index dfa9b2b..dd77467 100644 --- a/sw/source/core/layout/pagefrm.src +++ b/sw/source/core/layout/pagefrm.src @@ -1,10 +1,5 @@ #include "pagefrm.hrc" -Bitmap BMP_PAGE_TOP_RIGHT_SHADOW -{ - File = "page-topright-shadow.png"; -}; - Bitmap BMP_PAGE_RIGHT_SHADOW { File = "page-right-shadow.png"; @@ -20,8 +15,3 @@ Bitmap BMP_PAGE_BOTTOM_SHADOW File = "page-bottom-shadow.png"; }; -Bitmap BMP_PAGE_BOTTOM_LEFT_SHADOW -{ - File = "page-bottomleft-shadow.png"; -}; - -- 1.7.4.1
From 0e973d8fcc78acdbad66b888663ca976954bbe16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoffice@orniz.org> Date: Sun, 6 Mar 2011 16:31:41 +0100 Subject: [PATCH 2/3] Removed now useless images. --- default_images/sw/res/page-bottomleft-shadow.png | Bin 285 -> 0 bytes default_images/sw/res/page-topright-shadow.png | Bin 306 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 default_images/sw/res/page-bottomleft-shadow.png delete mode 100644 default_images/sw/res/page-topright-shadow.png diff --git a/default_images/sw/res/page-bottomleft-shadow.png b/default_images/sw/res/page-bottomleft-shadow.png deleted file mode 100644 index 9e4a72b1acacb82f99f323cdaf415f39f6cf4774..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4F%}28J29*~C-V}>VN3FMcVYMs zf(!O8p9~b?EbxddW?<kJ24O~qS#u<Sg6t)pzOL-InWTB7S!Zr$J`5C^>*?YcB5}F& z{OP<y4m=JQjSWm3<V6A%C;tCGUuV+^^^)+FS^@J~U1bCtvtFK(`hDu#l3gpk)-)Ma zRPYxZjMtxEEwkZZ`Z2-f8t<Cp*BD+qR^E3^??sE|Jf~ZV&olCpkMehMFTOIbsN<G_ z<K2+_h)2xad)Uuw7<d@Q-3^&*a-3)VjFP0X?)4}B-uE+f@_MIqu7b0x{^*3_{9LzP ZOgjP$&+h*;pA+a%22WQ%mvv4FO#mOpX<PsR diff --git a/default_images/sw/res/page-topright-shadow.png b/default_images/sw/res/page-topright-shadow.png deleted file mode 100644 index 2603731527826eb1143d6191c4e27950b0d67d81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 306 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4F%}28J29*~C-V}>VN3FMcVYMs zf(!O8p9~b?EbxddW?<kJ24O~qS#u<Sg6t)pzOL-InWTB7g>%!lO#%vS@^o<wk+>Xt z-Zt-0fPm}6^L&O++yfUWC~aou;`+9qLtJl9rv|G4M_+TWfwJPflG*0&<>y3luV0Zc ze9-c^YOCa(Jwm5FWFxo4elFtnOR{(*&Tf-@yUe$B{nxBwzk<%<bw~L`-z|D$9DY6g z=K-1b6^FC4QXa=|$#qvdx-`?FKl!$4I}7`pKv9v0)m+crZJrp~raipEzM*@+<g%MT vWH0zLT=o#H`d)eF^3|m?FS#yu`N)6J*I4l5y#Ka9*E4v!`njxgN@xNA0Vi<z -- 1.7.4.1
From d6cd9b8866a7697f270061d0e6abb3f31eb34dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoffice@orniz.org> Date: Sun, 6 Mar 2011 16:39:25 +0100 Subject: [PATCH 3/4] Renamed shadow images to *-mask. --- sw/source/core/inc/pagefrm.hrc | 6 +++--- sw/source/core/layout/pagefrm.src | 12 ++++++------ sw/source/core/layout/paintfrm.cxx | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sw/source/core/inc/pagefrm.hrc b/sw/source/core/inc/pagefrm.hrc index 20a0512..302ba9a 100644 --- a/sw/source/core/inc/pagefrm.hrc +++ b/sw/source/core/inc/pagefrm.hrc @@ -31,9 +31,9 @@ #include "rcid.hrc" // Bitmaps for page shadow -#define BMP_PAGE_RIGHT_SHADOW RC_PAGEFRM_BEGIN + 0 -#define BMP_PAGE_BOTTOM_RIGHT_SHADOW RC_PAGEFRM_BEGIN + 1 -#define BMP_PAGE_BOTTOM_SHADOW RC_PAGEFRM_BEGIN + 2 +#define BMP_PAGE_RIGHT_SHADOW_MASK RC_PAGEFRM_BEGIN + 0 +#define BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK RC_PAGEFRM_BEGIN + 1 +#define BMP_PAGE_BOTTOM_SHADOW_MASK RC_PAGEFRM_BEGIN + 2 // If you add resources, don't forget to update this diff --git a/sw/source/core/layout/pagefrm.src b/sw/source/core/layout/pagefrm.src index dd77467..83b80e4 100644 --- a/sw/source/core/layout/pagefrm.src +++ b/sw/source/core/layout/pagefrm.src @@ -1,17 +1,17 @@ #include "pagefrm.hrc" -Bitmap BMP_PAGE_RIGHT_SHADOW +Bitmap BMP_PAGE_RIGHT_SHADOW_MASK { - File = "page-right-shadow.png"; + File = "page-right-shadow-mask.png"; }; -Bitmap BMP_PAGE_BOTTOM_RIGHT_SHADOW +Bitmap BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK { - File = "page-bottomright-shadow.png"; + File = "page-bottomright-shadow-mask.png"; }; -Bitmap BMP_PAGE_BOTTOM_SHADOW +Bitmap BMP_PAGE_BOTTOM_SHADOW_MASK { - File = "page-bottom-shadow.png"; + File = "page-bottom-shadow-mask.png"; }; diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 82ab24b..13b51d3 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -5313,7 +5313,7 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; if(!initialized) { - AlphaMask aMask( SW_RES( BMP_PAGE_BOTTOM_RIGHT_SHADOW ) ); + AlphaMask aMask( SW_RES( BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK ) ); Bitmap aFilledSquare( Size( mnShadowPxWidth, mnShadowPxWidth ), 24 ); aFilledSquare.Erase( aShadowColor ); @@ -5325,12 +5325,12 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; aFilledSquare = Bitmap( Size( 1, mnShadowPxWidth ), 24 ); aFilledSquare.Erase( aShadowColor ); - aMask = Bitmap( SW_RES( BMP_PAGE_BOTTOM_SHADOW ) ); + aMask = Bitmap( SW_RES( BMP_PAGE_BOTTOM_SHADOW_MASK ) ); aPageBottomShadowBase = BitmapEx( aFilledSquare, aMask ); aFilledSquare = Bitmap( Size( mnShadowPxWidth, 1 ), 24 ); aFilledSquare.Erase( aShadowColor ); - aMask = Bitmap( SW_RES( BMP_PAGE_RIGHT_SHADOW ) ); + aMask = Bitmap( SW_RES( BMP_PAGE_RIGHT_SHADOW_MASK ) ); aPageRightShadowBase = BitmapEx( aFilledSquare, aMask ); initialized = true; -- 1.7.4.1
From 29894b3c170ba6167106003d35f2fe065319f61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoffice@orniz.org> Date: Sun, 6 Mar 2011 16:38:54 +0100 Subject: [PATCH 3/3] Use meaningful names for shadow images. --- default_images/sw/res/page-bottom-shadow-mask.png | Bin 0 -> 181 bytes default_images/sw/res/page-bottom-shadow.png | Bin 181 -> 0 bytes .../sw/res/page-bottomright-shadow-mask.png | Bin 0 -> 208 bytes default_images/sw/res/page-bottomright-shadow.png | Bin 208 -> 0 bytes default_images/sw/res/page-right-shadow-mask.png | Bin 0 -> 180 bytes default_images/sw/res/page-right-shadow.png | Bin 180 -> 0 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 default_images/sw/res/page-bottom-shadow-mask.png delete mode 100644 default_images/sw/res/page-bottom-shadow.png create mode 100644 default_images/sw/res/page-bottomright-shadow-mask.png delete mode 100644 default_images/sw/res/page-bottomright-shadow.png create mode 100644 default_images/sw/res/page-right-shadow-mask.png delete mode 100644 default_images/sw/res/page-right-shadow.png diff --git a/default_images/sw/res/page-bottom-shadow-mask.png b/default_images/sw/res/page-bottom-shadow-mask.png new file mode 100644 index 0000000000000000000000000000000000000000..fd19f034bb0fc80350c240eab1c0e33d7864f1e0 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrA0VEg#c4kil2^0spJ29*~C-V}>VM_9LcVYP7 z-hXC4kjGiz5n0T@z%2~Ij105pNB{-dOFVsD*>5wm@hOVhTJ3iN3Q3l@MwB?`=jNv7 zl`uFLr6!i7rYMwWmSiZnd-?{1H}Z)C6^VGdIEHXsPfkdfkTNL=2veFaGjMEW`1bT_ R>3X0%gQu&X%Q~loCID+EFY5pR literal 0 HcmV?d00001 diff --git a/default_images/sw/res/page-bottom-shadow.png b/default_images/sw/res/page-bottom-shadow.png deleted file mode 100644 index fd19f034bb0fc80350c240eab1c0e33d7864f1e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrA0VEg#c4kil2^0spJ29*~C-V}>VM_9LcVYP7 z-hXC4kjGiz5n0T@z%2~Ij105pNB{-dOFVsD*>5wm@hOVhTJ3iN3Q3l@MwB?`=jNv7 zl`uFLr6!i7rYMwWmSiZnd-?{1H}Z)C6^VGdIEHXsPfkdfkTNL=2veFaGjMEW`1bT_ R>3X0%gQu&X%Q~loCID+EFY5pR diff --git a/default_images/sw/res/page-bottomright-shadow-mask.png b/default_images/sw/res/page-bottomright-shadow-mask.png new file mode 100644 index 0000000000000000000000000000000000000000..94f32290092a528df8eeb76fadec1f5b9b77987b GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2VkYHF5IUx~9F%}28J29*~C-V}>VM_9LcVYP7 z-hXC4kjGiz5n0T@z%2~Ij105pNB{-dOFVsD*>5wmaY>70%>7vi6bkWlaSY+O&U)}9 z;{gQ@mIJQgoby!dU+lkdhC@l&*l5#{H*1!5aBRMxx@zsj$m#Plou>xo?tZ_qC$Kbj zfBMA8E8lAWHfa8xdECAs@JCNAgTa!Of(&&cUMv~auUtxi<}-M@`njxgN@xNAtSm## literal 0 HcmV?d00001 diff --git a/default_images/sw/res/page-bottomright-shadow.png b/default_images/sw/res/page-bottomright-shadow.png deleted file mode 100644 index 94f32290092a528df8eeb76fadec1f5b9b77987b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2VkYHF5IUx~9F%}28J29*~C-V}>VM_9LcVYP7 z-hXC4kjGiz5n0T@z%2~Ij105pNB{-dOFVsD*>5wmaY>70%>7vi6bkWlaSY+O&U)}9 z;{gQ@mIJQgoby!dU+lkdhC@l&*l5#{H*1!5aBRMxx@zsj$m#Plou>xo?tZ_qC$Kbj zfBMA8E8lAWHfa8xdECAs@JCNAgTa!Of(&&cUMv~auUtxi<}-M@`njxgN@xNAtSm## diff --git a/default_images/sw/res/page-right-shadow-mask.png b/default_images/sw/res/page-right-shadow-mask.png new file mode 100644 index 0000000000000000000000000000000000000000..784e00f37afcaf952f6a82c40f390b0f5fbda432 GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^AT}chkYG48FJTdgQyk>(#IWw1%u67LDaqU2h2ejD z|C#+j9%q3^WHAE+w=f7ZGR&GI0Tg5}@$_|Nzs=0Xr=T^-eX$)-NV3E=qQp5rH#aq} zgu%HeHL)Z$MWH;iBtya7(>EZzkxv|`NZ8ZGF@)oKa>|4$lO|08VHO6Ki44z+_5^JN PN;7!6`njxgN@xNAgB34b literal 0 HcmV?d00001 diff --git a/default_images/sw/res/page-right-shadow.png b/default_images/sw/res/page-right-shadow.png deleted file mode 100644 index 784e00f37afcaf952f6a82c40f390b0f5fbda432..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^AT}chkYG48FJTdgQyk>(#IWw1%u67LDaqU2h2ejD z|C#+j9%q3^WHAE+w=f7ZGR&GI0Tg5}@$_|Nzs=0Xr=T^-eX$)-NV3E=qQp5rH#aq} zgu%HeHL)Z$MWH;iBtya7(>EZzkxv|`NZ8ZGF@)oKa>|4$lO|08VHO6Ki44z+_5^JN PN;7!6`njxgN@xNAgB34b -- 1.7.4.1
From e0b8024df145078ba2a8ee94623f2ef4c045cb7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoffice@orniz.org> Date: Tue, 8 Mar 2011 08:43:28 +0100 Subject: [PATCH 4/4] Handle shadow option in frame painting. --- sw/inc/viewopt.hxx | 4 ++++ sw/source/core/layout/paintfrm.cxx | 11 ++++++----- sw/source/ui/config/viewopt.cxx | 12 ++++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index c71bfb1..2c4d2e7 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -110,6 +110,7 @@ namespace svtools{ class ColorConfig;} #define VIEWOPT_VISITED_LINKS 0x0020 #define VIEWOPT_FIELD_SHADINGS 0x0040 #define VIEWOPT_SECTION_BOUNDARIES 0x0080 +#define VIEWOPT_SHADOW 0x0100 // Implementierung in core/text/txtpaint.cxx extern void SyncVout( const OutputDevice *pOut ); @@ -133,6 +134,7 @@ class SwViewOption static Color aSectionBoundColor; static Color aPageBreakColor; static Color aScriptIndicatorColor; + static Color aShadowColor; static sal_Int32 nAppearanceFlags; // protected: @@ -557,6 +559,7 @@ public: static Color& GetTextGridColor(); static Color& GetSpellColor(); static Color& GetSmarttagColor(); + static Color& GetShadowColor(); SW_DLLPUBLIC static Color& GetFontColor(); static Color& GetFieldShadingsColor(); static Color& GetSectionBoundColor(); @@ -572,6 +575,7 @@ public: static BOOL IsVisitedLinks() {return IsAppearanceFlag(VIEWOPT_VISITED_LINKS );} static BOOL IsFieldShadings() {return IsAppearanceFlag(VIEWOPT_FIELD_SHADINGS);} static BOOL IsSectionBoundaries() {return IsAppearanceFlag(VIEWOPT_SECTION_BOUNDARIES);} + static BOOL IsShadow() {return IsAppearanceFlag(VIEWOPT_SHADOW );} static void SetAppearanceFlag(sal_Int32 nFlag, BOOL bSet, BOOL bSaveInConfig = FALSE); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 13b51d3..da5e5db 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -5299,20 +5299,23 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; bool bFullBottomShadow, bool bRightSidebar ) { + // No shadow in prefs + if( !SwViewOption::IsShadow() ) return; + // --> FME 2004-06-24 #i16816# tagged pdf support SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *_pViewShell->GetOut() ); // <-- - static bool initialized = false; static BitmapEx aPageTopRightShadow; static BitmapEx aPageBottomRightShadow; static BitmapEx aPageBottomLeftShadow; static BitmapEx aPageBottomShadowBase; static BitmapEx aPageRightShadowBase; - static Color aShadowColor( COL_BLACK ); + static Color aShadowColor; - if(!initialized) { + if(aShadowColor != SwViewOption::GetShadowColor() ) { + aShadowColor = SwViewOption::GetShadowColor(); AlphaMask aMask( SW_RES( BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK ) ); Bitmap aFilledSquare( Size( mnShadowPxWidth, mnShadowPxWidth ), 24 ); aFilledSquare.Erase( aShadowColor ); @@ -5332,8 +5335,6 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; aFilledSquare.Erase( aShadowColor ); aMask = Bitmap( SW_RES( BMP_PAGE_RIGHT_SHADOW_MASK ) ); aPageRightShadowBase = BitmapEx( aFilledSquare, aMask ); - - initialized = true; } SwRect aPaintRect; diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx index 18a1a23..a0db43d 100644 --- a/sw/source/ui/config/viewopt.cxx +++ b/sw/source/ui/config/viewopt.cxx @@ -72,6 +72,7 @@ Color SwViewOption::aFieldShadingsColor(COL_LIGHTGRAY); Color SwViewOption::aSectionBoundColor(COL_LIGHTGRAY); Color SwViewOption::aPageBreakColor(COL_BLUE); Color SwViewOption::aScriptIndicatorColor(COL_GREEN); +Color SwViewOption::aShadowColor(COL_GRAY); sal_Int32 SwViewOption::nAppearanceFlags = VIEWOPT_DOC_BOUNDARIES|VIEWOPT_OBJECT_BOUNDARIES; USHORT SwViewOption::nPixelTwips = 0; // one pixel on the screen @@ -418,6 +419,11 @@ Color& SwViewOption::GetSmarttagColor() return aSmarttagColor; } +Color& SwViewOption::GetShadowColor() +{ + return aShadowColor; +} + Color& SwViewOption::GetFontColor() { return aFontColor; @@ -475,6 +481,11 @@ void SwViewOption::ApplyColorConfigValues(const svtools::ColorConfig& rConfig ) if(aValue.bIsVisible) nAppearanceFlags |= VIEWOPT_VISITED_LINKS; + aValue = rConfig.GetColorValue(svtools::SHADOWCOLOR); + aShadowColor.SetColor(aValue.nColor); + if(aValue.bIsVisible) + nAppearanceFlags |= VIEWOPT_SHADOW; + aDirectCursorColor.SetColor(rConfig.GetColorValue(svtools::WRITERDIRECTCURSOR).nColor); aTextGridColor.SetColor(rConfig.GetColorValue(svtools::WRITERTEXTGRID).nColor); @@ -526,6 +537,7 @@ void SwViewOption::SetAppearanceFlag(sal_Int32 nFlag, BOOL bSet, BOOL bSaveInCon { VIEWOPT_VISITED_LINKS , svtools::LINKSVISITED }, { VIEWOPT_FIELD_SHADINGS , svtools::WRITERFIELDSHADINGS }, { VIEWOPT_SECTION_BOUNDARIES , svtools::WRITERSECTIONBOUNDARIES }, + { VIEWOPT_SHADOW , svtools::SHADOWCOLOR }, { 0 , svtools::ColorConfigEntryCount } }; sal_uInt16 nPos = 0; -- 1.7.4.1
Attachment:
signature.asc
Description: PGP signature