summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svtools/inc/svtools/menuoptions.hxx4
-rw-r--r--svtools/source/config/menuoptions.cxx66
-rw-r--r--svtools/source/uno/contextmenuhelper.cxx2
-rw-r--r--vcl/aqua/source/window/salframe.cxx3
-rw-r--r--vcl/source/window/window.cxx18
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx13
6 files changed, 67 insertions, 39 deletions
diff --git a/svtools/inc/svtools/menuoptions.hxx b/svtools/inc/svtools/menuoptions.hxx
index f98c33ec33a5..1d93d9068e1c 100644
--- a/svtools/inc/svtools/menuoptions.hxx
+++ b/svtools/inc/svtools/menuoptions.hxx
@@ -122,11 +122,11 @@ class SVL_DLLPUBLIC SvtMenuOptions: public svt::detail::Options
sal_Bool IsEntryHidingEnabled() const;
sal_Bool IsFollowMouseEnabled() const;
- sal_Bool IsMenuIconsEnabled() const;
+ sal_Int16 GetMenuIconsState() const;
void SetEntryHidingState( sal_Bool bState );
void SetFollowMouseState( sal_Bool bState );
- void SetMenuIconsState( sal_Bool bState );
+ void SetMenuIconsState( sal_Int16 bState );
//-------------------------------------------------------------------------------------------------------------
// private methods
diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx
index e8fa39d6b7bb..2d0e8d905ad9 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -43,6 +43,7 @@
#include <tools/debug.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
+#include <vcl/svapp.hxx>
#include <rtl/logfile.hxx>
#include "itemholder1.hxx"
@@ -63,17 +64,19 @@ using namespace ::com::sun::star::uno ;
#define ROOTNODE_MENU OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/View/Menu" ))
#define DEFAULT_DONTHIDEDISABLEDENTRIES sal_False
#define DEFAULT_FOLLOWMOUSE sal_True
-#define DEFAULT_MENUICONS sal_True
+#define DEFAULT_MENUICONS 2
#define PROPERTYNAME_DONTHIDEDISABLEDENTRIES OUString(RTL_CONSTASCII_USTRINGPARAM("DontHideDisabledEntry" ))
#define PROPERTYNAME_FOLLOWMOUSE OUString(RTL_CONSTASCII_USTRINGPARAM("FollowMouse" ))
#define PROPERTYNAME_SHOWICONSINMENUES OUString(RTL_CONSTASCII_USTRINGPARAM("ShowIconsInMenues" ))
+#define PROPERTYNAME_SYSTEMICONSINMENUES OUString(RTL_CONSTASCII_USTRINGPARAM("IsSystemIconsInMenus" ))
#define PROPERTYHANDLE_DONTHIDEDISABLEDENTRIES 0
#define PROPERTYHANDLE_FOLLOWMOUSE 1
#define PROPERTYHANDLE_SHOWICONSINMENUES 2
+#define PROPERTYHANDLE_SYSTEMICONSINMENUES 3
-#define PROPERTYCOUNT 3
+#define PROPERTYCOUNT 4
#include <tools/link.hxx>
#include <tools/list.hxx>
@@ -93,7 +96,7 @@ class SvtMenuOptions_Impl : public ConfigItem
LinkList aList;
sal_Bool m_bDontHideDisabledEntries ; /// cache "DontHideDisabledEntries" of Menu section
sal_Bool m_bFollowMouse ; /// cache "FollowMouse" of Menu section
- sal_Bool m_bMenuIcons ; /// cache "MenuIcons" of Menu section
+ sal_Int16 m_nMenuIcons ; /// cache "MenuIcons" of Menu section
//-------------------------------------------------------------------------------------------------------------
// public methods
@@ -169,8 +172,8 @@ class SvtMenuOptions_Impl : public ConfigItem
sal_Bool IsFollowMouseEnabled() const
{ return m_bFollowMouse; }
- sal_Bool IsMenuIconsEnabled() const
- { return m_bMenuIcons; }
+ sal_Int16 GetMenuIconsState() const
+ { return m_nMenuIcons; }
void SetEntryHidingState ( sal_Bool bState )
{
@@ -190,9 +193,9 @@ class SvtMenuOptions_Impl : public ConfigItem
Commit();
}
- void SetMenuIconsState ( sal_Bool bState )
+ void SetMenuIconsState ( sal_Int16 bState )
{
- m_bMenuIcons = bState;
+ m_nMenuIcons = bState;
SetModified();
for ( USHORT n=0; n<aList.Count(); n++ )
aList.GetObject(n)->Call( this );
@@ -234,7 +237,7 @@ SvtMenuOptions_Impl::SvtMenuOptions_Impl()
// Init member then.
, m_bDontHideDisabledEntries ( DEFAULT_DONTHIDEDISABLEDENTRIES )
, m_bFollowMouse ( DEFAULT_FOLLOWMOUSE )
- , m_bMenuIcons ( DEFAULT_MENUICONS )
+ , m_nMenuIcons ( DEFAULT_MENUICONS )
{
// Use our static list of configuration keys to get his values.
Sequence< OUString > seqNames = impl_GetPropertyNames();
@@ -245,6 +248,9 @@ SvtMenuOptions_Impl::SvtMenuOptions_Impl()
// Follow assignment use order of values in relation to our list of key names!
DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nI miss some values of configuration keys!\n" );
+ sal_Bool bMenuIcons = true;
+ sal_Bool bSystemMenuIcons = true;
+
// Copy values from list in right order to ouer internal member.
sal_Int32 nPropertyCount = seqValues.getLength() ;
sal_Int32 nProperty = 0 ;
@@ -268,12 +274,19 @@ SvtMenuOptions_Impl::SvtMenuOptions_Impl()
break;
case PROPERTYHANDLE_SHOWICONSINMENUES : {
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\ShowIconsInMenues\"?" );
- seqValues[nProperty] >>= m_bMenuIcons;
+ seqValues[nProperty] >>= bMenuIcons;
+ }
+ break;
+ case PROPERTYHANDLE_SYSTEMICONSINMENUES : {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" );
+ seqValues[nProperty] >>= bSystemMenuIcons;
}
break;
}
}
+ m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons;
+
EnableNotification( seqNames );
}
@@ -303,6 +316,10 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
// Safe impossible cases.
// We need values from ALL notified configuration keys.
DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::Notify()\nI miss some values of configuration keys!\n" );
+
+ sal_Bool bMenuIcons = true;
+ sal_Bool bSystemMenuIcons = true;
+
// Step over list of property names and get right value from coreesponding value list to set it on internal members!
sal_Int32 nCount = seqPropertyNames.getLength();
for( sal_Int32 nProperty=0; nProperty<nCount; ++nProperty )
@@ -312,22 +329,29 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::Notify()\nWho has changed the value type of \"Office.Common\\View\\Menu\\DontHideDisabledEntry\"?" );
seqValues[nProperty] >>= m_bDontHideDisabledEntries;
}
- else
- if( seqPropertyNames[nProperty] == PROPERTYNAME_FOLLOWMOUSE )
+ else if( seqPropertyNames[nProperty] == PROPERTYNAME_FOLLOWMOUSE )
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::Notify()\nWho has changed the value type of \"Office.Common\\View\\Menu\\FollowMouse\"?" );
seqValues[nProperty] >>= m_bFollowMouse;
}
- if( seqPropertyNames[nProperty] == PROPERTYNAME_SHOWICONSINMENUES )
+ else if( seqPropertyNames[nProperty] == PROPERTYNAME_SHOWICONSINMENUES )
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\ShowIconsInMenues\"?" );
- seqValues[nProperty] >>= m_bMenuIcons;
+ seqValues[nProperty] >>= bMenuIcons;
}
+ else if( seqPropertyNames[nProperty] == PROPERTYNAME_SYSTEMICONSINMENUES )
+ {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" );
+ seqValues[nProperty] >>= bSystemMenuIcons;
+ }
+
#if OSL_DEBUG_LEVEL > 1
else DBG_ASSERT( sal_False, "SvtMenuOptions_Impl::Notify()\nUnkown property detected ... I can't handle these!\n" );
#endif
}
+ m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons;
+
for ( USHORT n=0; n<aList.Count(); n++ )
aList.GetObject(n)->Call( this );
}
@@ -354,8 +378,13 @@ void SvtMenuOptions_Impl::Commit()
seqValues[nProperty] <<= m_bFollowMouse;
}
break;
+ //Output cache of current setting as possibly modified by System Theme for older version
case PROPERTYHANDLE_SHOWICONSINMENUES : {
- seqValues[nProperty] <<= m_bMenuIcons;
+ seqValues[nProperty] <<=(sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus());
+ }
+ break;
+ case PROPERTYHANDLE_SYSTEMICONSINMENUES : {
+ seqValues[nProperty] <<= (m_nMenuIcons == 2 ? sal_True : sal_False) ;
}
break;
}
@@ -374,7 +403,8 @@ Sequence< OUString > SvtMenuOptions_Impl::impl_GetPropertyNames()
{
PROPERTYNAME_DONTHIDEDISABLEDENTRIES ,
PROPERTYNAME_FOLLOWMOUSE ,
- PROPERTYNAME_SHOWICONSINMENUES
+ PROPERTYNAME_SHOWICONSINMENUES ,
+ PROPERTYNAME_SYSTEMICONSINMENUES
};
// Initialize return sequence with these list ...
static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
@@ -483,16 +513,16 @@ void SvtMenuOptions::SetFollowMouseState( sal_Bool bState )
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
-sal_Bool SvtMenuOptions::IsMenuIconsEnabled() const
+sal_Int16 SvtMenuOptions::GetMenuIconsState() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pDataContainer->IsMenuIconsEnabled();
+ return m_pDataContainer->GetMenuIconsState();
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
-void SvtMenuOptions::SetMenuIconsState( sal_Bool bState )
+void SvtMenuOptions::SetMenuIconsState( sal_Int16 bState )
{
MutexGuard aGuard( GetOwnStaticMutex() );
m_pDataContainer->SetMenuIconsState( bState );
diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx
index 3c6e8f23e710..be7738adaf14 100644
--- a/svtools/source/uno/contextmenuhelper.cxx
+++ b/svtools/source/uno/contextmenuhelper.cxx
@@ -610,7 +610,7 @@ ContextMenuHelper::completeMenuProperties(
// Retrieve some settings necessary to display complete context
// menu correctly.
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- bool bShowMenuImages( SvtMenuOptions().IsMenuIconsEnabled() );
+ bool bShowMenuImages( rSettings.GetUseImagesInMenus() );
bool bIsHiContrast( rSettings.GetMenuColor().IsDark() );
if ( pMenu )
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index 5db3ea68ab14..560d80fd75d5 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -1176,6 +1176,9 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
// set scrollbar size
aStyleSettings.SetScrollBarSize( [NSScroller scrollerWidth] );
+ // images in menus false for MacOSX
+ aStyleSettings.SetUseImagesInMenus( false );
+
rSettings.SetStyleSettings( aStyleSettings );
[mpView unlockFocus];
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index ec16b65cf41f..48a029df8f69 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -497,24 +497,6 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
}
}
- // Detect if images in menus are allowed or not
- {
- sal_Bool bTmp = sal_False, bUseImagesInMenus = sal_True;
- utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
- vcl::unohelper::GetMultiServiceFactory(),
- OUString::createFromAscii( "org.openoffice.Office.Common/View/Menu" ) ); // note: case sensisitive !
- if ( aNode.isValid() )
- {
- ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString::createFromAscii( "ShowIconsInMenues" ) );
- if( aValue >>= bTmp )
- bUseImagesInMenus = bTmp;
- }
-
- aStyleSettings = rSettings.GetStyleSettings();
- aStyleSettings.SetUseImagesInMenus( bUseImagesInMenus );
- rSettings.SetStyleSettings( aStyleSettings );
- }
-
#ifdef DBG_UTIL
// Evt. AppFont auf Fett schalten, damit man feststellen kann,
// ob fuer die Texte auf anderen Systemen genuegend Platz
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 04d679d8d4f1..b4a0974a5c18 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -96,6 +96,7 @@ struct NWFWidgetData
GtkWidget * gMenuItemMenuWidget;
GtkWidget * gMenuItemCheckMenuWidget;
GtkWidget * gMenuItemRadioMenuWidget;
+ GtkWidget * gImageMenuItem;
GtkWidget * gTooltipPopup;
GtkWidget * gProgressBar;
GtkWidget * gTreeView;
@@ -131,6 +132,7 @@ struct NWFWidgetData
gMenuItemMenuWidget( NULL ),
gMenuItemCheckMenuWidget( NULL ),
gMenuItemRadioMenuWidget( NULL ),
+ gImageMenuItem( NULL ),
gTooltipPopup( NULL ),
gProgressBar( NULL ),
gTreeView( NULL ),
@@ -3404,6 +3406,11 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
else
aStyleSet.SetCursorBlinkTime( STYLE_CURSOR_NOBLINKTIME );
+ gboolean showmenuicons = true;
+ pSettings = gtk_widget_get_settings( gWidgetData[m_nScreen].gImageMenuItem );
+ g_object_get( pSettings, "gtk-menu-images", &showmenuicons, (char *)NULL );
+ aStyleSet.SetUseImagesInMenus( showmenuicons );
+
// set scrollbar settings
gint slider_width = 14;
gint trough_border = 1;
@@ -3843,10 +3850,12 @@ static void NWEnsureGTKMenu( int nScreen )
gWidgetData[nScreen].gMenuItemMenuWidget = gtk_menu_item_new_with_label( "b" );
gWidgetData[nScreen].gMenuItemCheckMenuWidget = gtk_check_menu_item_new_with_label( "b" );
gWidgetData[nScreen].gMenuItemRadioMenuWidget = gtk_radio_menu_item_new_with_label( NULL, "b" );
+ gWidgetData[nScreen].gImageMenuItem = gtk_image_menu_item_new();
gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gMenuItemMenuWidget );
gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gMenuItemCheckMenuWidget );
gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gMenuItemRadioMenuWidget );
+ gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gImageMenuItem );
// do what NWAddWidgetToCacheWindow does except adding to def container
gtk_widget_realize( gWidgetData[nScreen].gMenuWidget );
@@ -3861,10 +3870,14 @@ static void NWEnsureGTKMenu( int nScreen )
gtk_widget_realize( gWidgetData[nScreen].gMenuItemRadioMenuWidget );
gtk_widget_ensure_style( gWidgetData[nScreen].gMenuItemRadioMenuWidget );
+ gtk_widget_realize( gWidgetData[nScreen].gImageMenuItem );
+ gtk_widget_ensure_style( gWidgetData[nScreen].gImageMenuItem );
+
gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuWidget );
gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemMenuWidget );
gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemCheckMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemCheckMenuWidget );
gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemRadioMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemRadioMenuWidget );
+ gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gImageMenuItem ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gImageMenuItem );
}
}