diff options
author | Szabolcs Dezsi <dezsiszabi@hotmail.com> | 2012-03-06 11:16:07 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-03-06 20:23:35 +0100 |
commit | 78e8d5f0d62f910b8561a1c4fd7ebd8ae4cfb9f8 (patch) | |
tree | ac1c904edd258cf816be463efb40f0cfc8a9430d /framework | |
parent | lp#527938, debian#602953, fdo#33266, i#105408: do not crash on clicking bibli... (diff) | |
download | core-78e8d5f0d62f910b8561a1c4fd7ebd8ae4cfb9f8.tar.gz core-78e8d5f0d62f910b8561a1c4fd7ebd8ae4cfb9f8.zip |
Added option to hide external link buttons on Start Center
This option is useful for Intel AppUp builds. On the other hand,
unused STARTCENTER_LAYOUT_STYLE option was removed.
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/framework.hrc | 14 | ||||
-rw-r--r-- | framework/source/services/backingwindow.cxx | 98 | ||||
-rw-r--r-- | framework/source/services/backingwindow.hxx | 9 | ||||
-rw-r--r-- | framework/source/services/fwk_services.src | 8 |
4 files changed, 20 insertions, 109 deletions
diff --git a/framework/inc/framework.hrc b/framework/inc/framework.hrc index e92e50ba3cda..0c81f4ab81a7 100644 --- a/framework/inc/framework.hrc +++ b/framework/inc/framework.hrc @@ -46,14 +46,12 @@ // ResIds for BackingWindow #define DLG_BACKING (RID_FWK_DIALOG_START_CORRECT+100) -#define STR_BACKING_WELCOME 1 -#define STR_BACKING_WELCOMEPRODUCT 2 -#define STR_BACKING_CREATE 3 -#define STR_BACKING_TEMPLATE 4 -#define STR_BACKING_FILE 5 -#define STR_BACKING_EXTHELP 6 -#define STR_BACKING_INFOHELP 7 -#define STR_BACKING_TPLREP 8 +#define STR_BACKING_CREATE 1 +#define STR_BACKING_TEMPLATE 2 +#define STR_BACKING_FILE 3 +#define STR_BACKING_EXTHELP 4 +#define STR_BACKING_INFOHELP 5 +#define STR_BACKING_TPLREP 6 #define RES_BACKING_IMAGES (DLG_BACKING+1) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 0b8976981840..6bdc1a45a6bc 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -137,8 +137,6 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper1< ::com::sun::star BackingWindow::BackingWindow( Window* i_pParent ) : Window( i_pParent, FwkResId( DLG_BACKING ) ), - maWelcome( this, WB_LEFT ), - maProduct( this, WB_LEFT ), maWriterButton( this, STC_BUTTON_STYLE ), maCalcButton( this, STC_BUTTON_STYLE ), maImpressButton( this, STC_BUTTON_STYLE ), @@ -148,13 +146,11 @@ BackingWindow::BackingWindow( Window* i_pParent ) : maMathButton( this, STC_BUTTON_STYLE ), maTemplateButton( this, STC_BUTTON_STYLE ), maToolbox( this, WB_DIALOGCONTROL ), - maWelcomeString( FwkResId( STR_BACKING_WELCOME ) ), - maProductString( FwkResId( STR_BACKING_WELCOMEPRODUCT ) ), maOpenString( FwkResId( STR_BACKING_FILE ) ), maTemplateString( FwkResId( STR_BACKING_TEMPLATE ) ), maButtonImageSize( 10, 10 ), mbInitControls( false ), - mnLayoutStyle( 0 ), + mnHideExternalLinks( 0 ), mpAccExec( NULL ), mnBtnPos( 120 ), mnBtnTop( 150 ), @@ -179,8 +175,8 @@ BackingWindow::BackingWindow( Window* i_pParent ) : if( xNameAccess.is() ) { //throws css::container::NoSuchElementException, css::lang::WrappedTargetException - Any value( xNameAccess->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartCenterLayoutStyle"))) ); - mnLayoutStyle = value.get<sal_Int32>(); + Any value( xNameAccess->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartCenterHideExternalLinks"))) ); + mnHideExternalLinks = value.get<sal_Int32>(); } } } @@ -195,8 +191,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) : // clean up resource stack FreeResource(); - maWelcome.SetPaintTransparent( sal_True ); - maProduct.SetPaintTransparent( sal_True ); EnableChildTransparentMode(); SetStyle( GetStyle() | WB_DIALOGCONTROL ); @@ -399,12 +393,6 @@ void BackingWindow::initBackground() SetBackground(); bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode(); - if( bDark ) - maWelcomeTextColor = maLabelTextColor = Color( COL_WHITE ); - else if( mnLayoutStyle == 1 ) - maWelcomeTextColor = maLabelTextColor = Color( COL_BLACK ); - else - maWelcomeTextColor = maLabelTextColor = Color( 0x26, 0x35, 0x42 ); Color aTextBGColor( bDark ? COL_BLACK : COL_WHITE ); @@ -438,19 +426,6 @@ void BackingWindow::initBackground() maToolbox.SetItemImage( nItemId_Info, BitmapEx( FwkResId( BMP_BACKING_INFO ) ) ); maToolbox.SetItemImage( nItemId_TplRep, BitmapEx( FwkResId( BMP_BACKING_TPLREP ) ) ); - maWelcome.SetControlForeground( maWelcomeTextColor ); - maWelcome.SetBackground(); - maProduct.SetControlForeground( maWelcomeTextColor ); - maProduct.SetBackground(); - - if( mnLayoutStyle == 1 ) - { - if( Application::GetSettings().GetLayoutRTL() ) - mnBtnPos = maBackgroundRight.GetSizePixel().Width() + 40; - else - mnBtnPos = maBackgroundLeft.GetSizePixel().Width() + 40; - } - // get icon images from fwk resource and set them on the appropriate buttons loadImage( FwkResId( BMP_BACKING_WRITER ), maWriterButton ); loadImage( FwkResId( BMP_BACKING_CALC ), maCalcButton ); @@ -482,56 +457,12 @@ void BackingWindow::initControls() maControlRect.Bottom() -= nShadowBottom; long nYPos = 0; - // set bigger welcome string - maWelcome.SetText( maWelcomeString ); - maTextFont = GetSettings().GetStyleSettings().GetLabelFont(); - maTextFont.SetSize( Size( 0, 18 ) ); - maTextFont.SetWeight( WEIGHT_BOLD ); - maWelcome.SetFont( maTextFont ); - // get metric to get correct width factor and adjust - long nW = (maWelcome.GetFontMetric().GetWidth()*95)/100; - maTextFont.SetSize( Size( nW, 18 ) ); - - maWelcome.SetFont( maTextFont ); - maWelcome.SetControlFont( maTextFont ); - maWelcomeSize = Size( maWelcome.GetTextWidth( maWelcomeString ), maWelcome.GetTextHeight() ); - maWelcomeSize.Width() = (maWelcomeSize.Width() * 20)/19; - - nYPos += (maWelcomeSize.Height()*3)/2; - - if( maControlRect.GetWidth() < mnBtnPos + maWelcomeSize.Width() + 20 ) - maControlRect.Right() = maControlRect.Left() + maWelcomeSize.Width() + mnBtnPos + 20; - - nYPos += maWelcomeSize.Height(); - - // set product string - maTextFont.SetSize( Size( 0, 30 ) ); - maProduct.SetFont( maTextFont ); - - // get metric to get correct width factor and adjust - nW = (maProduct.GetFontMetric().GetWidth()*95)/100; - maTextFont.SetSize( Size( nW, 28 ) ); - - maProduct.SetFont( maTextFont ); - maProduct.SetControlFont( maTextFont ); - maProduct.SetText( maProductString ); - maProductSize = Size( maProduct.GetTextWidth( maProductString ), maProduct.GetTextHeight() ); - maProductSize.Width() = (maProductSize.Width() * 20)/19; - - if( maControlRect.GetWidth() < maProductSize.Width() + mnBtnPos + 10 ) - maControlRect.Right() = maControlRect.Left() + maProductSize.Width() + mnBtnPos + 10; - - if( mnLayoutStyle == 1 ) - { - maWelcome.Show(); - maProduct.Show(); - } - nYPos += (maProductSize.Height()*3)/2; + if( maControlRect.GetWidth() < mnBtnPos + 20 ) + maControlRect.Right() = maControlRect.Left() + mnBtnPos + 20; - // set a slighly larger font than normal labels on the texts - maTextFont.SetSize( Size( 0, 11 ) ); - maTextFont.SetWeight( WEIGHT_NORMAL ); + if( maControlRect.GetWidth() < mnBtnPos + 10 ) + maControlRect.Right() = maControlRect.Left() + mnBtnPos + 10; // collect the URLs of the entries in the File/New menu SvtModuleOptions aModuleOptions; @@ -629,7 +560,7 @@ void BackingWindow::initControls() } maToolbox.SetSelectHdl( LINK( this, BackingWindow, ToolboxHdl ) ); - if( mnLayoutStyle == 0 ) + if( mnHideExternalLinks == 0 ) maToolbox.Show(); // scale middle map to formatted width @@ -847,9 +778,9 @@ void BackingWindow::Resize() // #i93631# squeeze controls so they fit into the box // this can be necessary due to application font height which has small deviations // from the size set - const long nWDelta = maWelcomeSize.Height(); - const long nW2Delta = (maWelcomeSize.Height()*3)/2; - const long nPDelta = (maProductSize.Height()*3)/2; + const long nWDelta = 0; + const long nW2Delta = 0; + const long nPDelta = 0; const long nBDelta = maButtonImageSize.Height() + 10; const long nB2Delta = 3*maButtonImageSize.Height()/2; const long nLastDelta = maButtonImageSize.Height(); @@ -868,16 +799,13 @@ void BackingWindow::Resize() long nYPos = maControlRect.Top(); nYPos += nW2Delta - nDiff; - maWelcome.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), - Size( maControlRect.GetWidth() - mnBtnPos - 5, (maWelcomeSize.Height()*20)/19 ) ); + nYPos += nWDelta - nDiff; - maProduct.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( maControlRect.GetWidth() - mnBtnPos - 5, (maProductSize.Height()*20)/19 ) ); nYPos += nPDelta - nDiff; nYPos += nWDelta/2 - nDiff; - if( mnLayoutStyle != 1 ) - nYPos = maControlRect.Top() + mnBtnTop; + nYPos = maControlRect.Top() + mnBtnTop; maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx index 179a632d5608..96eb9092c0b3 100644 --- a/framework/source/services/backingwindow.hxx +++ b/framework/source/services/backingwindow.hxx @@ -90,10 +90,6 @@ namespace framework com::sun::star::uno::Reference<com::sun::star::frame::XFrame> mxFrame; com::sun::star::uno::Reference<com::sun::star::document::XEventBroadcaster> mxBroadcaster; - FixedText maWelcome; - Size maWelcomeSize; - FixedText maProduct; - Size maProductSize; ImageButton maWriterButton; ImageButton maCalcButton; ImageButton maImpressButton; @@ -109,8 +105,6 @@ namespace framework BitmapEx maBackgroundMiddle; BitmapEx maBackgroundRight; - String maWelcomeString; - String maProductString; String maCreateString; String maOpenString; String maTemplateString; @@ -121,12 +115,11 @@ namespace framework long mnColumnWidth[2]; long mnTextColumnWidth[2]; Color maLabelTextColor; - Color maWelcomeTextColor; Size maButtonImageSize; bool mbInitControls; - sal_Int32 mnLayoutStyle; + sal_Int32 mnHideExternalLinks; svt::AcceleratorExecute* mpAccExec; long mnBtnPos; long mnBtnTop; diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src index 536b3d7eaa2d..1905142f5de4 100644 --- a/framework/source/services/fwk_services.src +++ b/framework/source/services/fwk_services.src @@ -33,14 +33,6 @@ Window DLG_BACKING SVLook = TRUE ; Border = FALSE; - String STR_BACKING_WELCOME - { - Text [ en-US ] = "Welcome to"; - }; - String STR_BACKING_WELCOMEPRODUCT - { - Text [ en-US ] = "%PRODUCTNAME"; - }; String STR_BACKING_CREATE { Text [ en-US ] = "Create a new document"; |