[Libreoffice-commits] .: svtools/source vcl/aqua vcl/inc vcl/source vcl/unx
Michael Meeks
michael at kemper.freedesktop.org
Thu Apr 28 03:12:49 PDT 2011
svtools/source/edit/svmedit.cxx | 3 ---
vcl/aqua/source/window/salframe.cxx | 1 +
vcl/inc/vcl/settings.hxx | 6 +++++-
vcl/source/app/settings.cxx | 3 +++
vcl/source/control/edit.cxx | 7 ++++---
vcl/unx/kde/salnativewidgets-kde.cxx | 1 +
vcl/unx/kde4/KDESalFrame.cxx | 1 +
7 files changed, 15 insertions(+), 7 deletions(-)
New commits:
commit f3e0a843ca977add0a6dfc72b481b09b95e928d3
Author: Christian Dywan <christian.dywan at lanedo.com>
Date: Thu Apr 21 15:14:32 2011 +0200
Introduce HideDisabledMenuItems style setting
The STYLE_OPTION_HIDEDISABLED flag is removed.
The setting is enabled for KDE and OSX.
diff --git a/svtools/source/edit/svmedit.cxx b/svtools/source/edit/svmedit.cxx
index b182446..b1f8919 100644
--- a/svtools/source/edit/svmedit.cxx
+++ b/svtools/source/edit/svmedit.cxx
@@ -859,9 +859,6 @@ void TextWindow::Command( const CommandEvent& rCEvt )
if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
{
PopupMenu* pPopup = Edit::CreatePopupMenu();
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- if ( rStyleSettings.GetOptions() & STYLE_OPTION_HIDEDISABLED )
- pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES );
if ( !mpExtTextView->HasSelection() )
{
pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index f37182f..4b41148 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -1320,6 +1320,7 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
// images in menus false for MacOSX
aStyleSettings.SetPreferredUseImagesInMenus( false );
+ aStyleSettings.SetHideDisabledMenuItems( sal_True );
aStyleSettings.SetAcceleratorsInContextMenus( sal_False );
rSettings.SetStyleSettings( aStyleSettings );
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index e5a824c..4f16997 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -434,6 +434,7 @@ private:
sal_uLong mnSymbolsStyle;
sal_uLong mnPreferredSymbolsStyle;
sal_uInt16 mnSkipDisabledInMenus;
+ sal_Bool mbHideDisabledMenuItems;
sal_Bool mnAcceleratorsInContextMenus;
Wallpaper maWorkspaceGradient;
const void* mpFontOptions;
@@ -456,7 +457,6 @@ private:
#define STYLE_OPTION_SPINARROW ((sal_uLong)0x00000080)
#define STYLE_OPTION_SPINUPDOWN ((sal_uLong)0x00000100)
#define STYLE_OPTION_NOMNEMONICS ((sal_uLong)0x00000200)
-#define STYLE_OPTION_HIDEDISABLED ((sal_uLong)0x00100000)
#define DRAGFULL_OPTION_WINDOWMOVE ((sal_uLong)0x00000001)
#define DRAGFULL_OPTION_WINDOWSIZE ((sal_uLong)0x00000002)
@@ -736,6 +736,10 @@ public:
{ CopyData(); mpData->mnSkipDisabledInMenus = bSkipDisabledInMenus; }
sal_Bool GetSkipDisabledInMenus() const
{ return (sal_Bool) mpData->mnSkipDisabledInMenus; }
+ void SetHideDisabledMenuItems( sal_Bool bHideDisabledMenuItems )
+ { CopyData(); mpData->mbHideDisabledMenuItems = bHideDisabledMenuItems; }
+ sal_Bool GetHideDisabledMenuItems() const
+ { return mpData->mbHideDisabledMenuItems; }
void SetAcceleratorsInContextMenus( sal_Bool bAcceleratorsInContextMenus )
{ CopyData(); mpData->mnAcceleratorsInContextMenus = bAcceleratorsInContextMenus; }
sal_Bool GetAcceleratorsInContextMenus() const
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index b256f04..388a043 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -529,6 +529,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
mnUseImagesInMenus = rData.mnUseImagesInMenus;
mbPreferredUseImagesInMenus = rData.mbPreferredUseImagesInMenus;
mnSkipDisabledInMenus = rData.mnSkipDisabledInMenus;
+ mbHideDisabledMenuItems = rData.mbHideDisabledMenuItems;
mnAcceleratorsInContextMenus = rData.mnAcceleratorsInContextMenus;
mnToolbarIconSize = rData.mnToolbarIconSize;
mnSymbolsStyle = rData.mnSymbolsStyle;
@@ -618,6 +619,7 @@ void ImplStyleData::SetStandardStyles()
mnUseFlatMenues = 0;
mbPreferredUseImagesInMenus = sal_True;
mnSkipDisabledInMenus = (sal_uInt16)sal_False;
+ mbHideDisabledMenuItems = sal_False;
mnAcceleratorsInContextMenus = sal_True;
Gradient aGrad( GRADIENT_LINEAR, DEFAULT_WORKSPACE_GRADIENT_START_COLOR, DEFAULT_WORKSPACE_GRADIENT_END_COLOR );
@@ -1079,6 +1081,7 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->mnUseImagesInMenus == rSet.mpData->mnUseImagesInMenus) &&
(mpData->mbPreferredUseImagesInMenus == rSet.mpData->mbPreferredUseImagesInMenus) &&
(mpData->mnSkipDisabledInMenus == rSet.mpData->mnSkipDisabledInMenus) &&
+ (mpData->mbHideDisabledMenuItems == rSet.mpData->mbHideDisabledMenuItems) &&
(mpData->mnAcceleratorsInContextMenus == rSet.mpData->mnAcceleratorsInContextMenus) &&
(mpData->maFontColor == rSet.mpData->maFontColor ))
return sal_True;
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index fb352f3..14c69a0 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2094,9 +2094,6 @@ void Edit::Command( const CommandEvent& rCEvt )
if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
{
PopupMenu* pPopup = Edit::CreatePopupMenu();
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- if ( rStyleSettings.GetOptions() & STYLE_OPTION_HIDEDISABLED )
- pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES );
if ( !maSelection.Len() )
{
@@ -2934,6 +2931,10 @@ PopupMenu* Edit::CreatePopupMenu()
PopupMenu* pPopup = new PopupMenu( ResId( SV_RESID_MENU_EDIT, *pResMgr ) );
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+ if ( rStyleSettings.GetHideDisabledMenuItems() )
+ pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES );
+ else
+ pPopup->SetMenuFlags ( MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES );
if ( rStyleSettings.GetAcceleratorsInContextMenus() )
{
pPopup->SetAccelKey( SV_MENU_EDIT_UNDO, KeyCode( KEYFUNC_UNDO ) );
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index d0fa4a0..5707586 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1970,6 +1970,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
// Menu
aStyleSettings.SetSkipDisabledInMenus( sal_True );
+ aStyleSettings.SetHideDisabledMenuItems( sal_True );
KMenuBar *pMenuBar = qMainWindow.menuBar();
if ( pMenuBar )
{
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 8ed5078..68f9e5c 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -308,6 +308,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
// Menu
style.SetSkipDisabledInMenus( TRUE );
+ style.SetHideDisabledMenuItems( sal_True );
KMenuBar* pMenuBar = new KMenuBar();
if ( pMenuBar )
{
More information about the Libreoffice-commits
mailing list