Added hidden configuration option to enable/disable closing windows by clicking on menu button.

Option is called "CloseFromMenuButton"
It is false by default.
To turn it on, add
  CloseFromMenuButton=true
in [Windeco] section of $HOME/.kde4/share/config/oxygenrc.
Note that it results in poor usability of the menu button, if enabled.

CCBUG: 301237
This commit is contained in:
Hugo Pereira Da Costa 2012-06-07 12:28:25 -07:00
parent fd694c5bac
commit 46d0116dd5
3 changed files with 21 additions and 1 deletions

View file

@ -193,7 +193,7 @@ namespace Oxygen
{
case DB_MenuClose:
return true;
return configuration().closeFromMenuButton();
case DB_WindowMask:
return false;

View file

@ -47,6 +47,7 @@ namespace Oxygen
_hideTitleBar( false ),
_useDropShadows( true ),
_useOxygenShadows( true ),
_closeFromMenuButton( false ),
_useNarrowButtonSpacing( false ),
_animationsEnabled( true ),
_buttonAnimationsEnabled( true ),
@ -127,6 +128,11 @@ namespace Oxygen
OxygenConfig::USE_OXYGEN_SHADOWS,
defaultConfiguration.useOxygenShadows() ) );
// close from menu button
setCloseFromMenuButton( group.readEntry(
OxygenConfig::CLOSE_FROM_MENU_BUTTON,
defaultConfiguration.closeFromMenuButton() ) );
// buttonSpacing
setUseNarrowButtonSpacing( group.readEntry(
OxygenConfig::NARROW_BUTTON_SPACING,
@ -207,6 +213,7 @@ namespace Oxygen
if( hideTitleBar() != defaultConfiguration.hideTitleBar() ) group.writeEntry( OxygenConfig::HIDE_TITLEBAR, hideTitleBar() );
if( useDropShadows() != defaultConfiguration.useDropShadows() ) group.writeEntry( OxygenConfig::USE_DROP_SHADOWS, useDropShadows() );
if( useOxygenShadows() != defaultConfiguration.useOxygenShadows() ) group.writeEntry( OxygenConfig::USE_OXYGEN_SHADOWS, useOxygenShadows() );
if( closeFromMenuButton() != defaultConfiguration.closeFromMenuButton() ) group.writeEntry( OxygenConfig::CLOSE_FROM_MENU_BUTTON, closeFromMenuButton() );
if( useNarrowButtonSpacing() != defaultConfiguration.useNarrowButtonSpacing() ) group.writeEntry( OxygenConfig::NARROW_BUTTON_SPACING, useNarrowButtonSpacing() );
// animations
@ -400,6 +407,7 @@ namespace Oxygen
hideTitleBar() == other.hideTitleBar() &&
useDropShadows() == other.useDropShadows() &&
useOxygenShadows() == other.useOxygenShadows() &&
closeFromMenuButton() == other.closeFromMenuButton() &&
useNarrowButtonSpacing() == other.useNarrowButtonSpacing() &&
animationsEnabled() == other.animationsEnabled() &&
buttonAnimationsEnabled() == other.buttonAnimationsEnabled() &&

View file

@ -44,6 +44,7 @@ namespace OxygenConfig
static const QString HIDE_TITLEBAR = "HideTitleBar";
static const QString ANIMATIONS_ENABLED = "AnimationsEnabled";
static const QString NARROW_BUTTON_SPACING = "UseNarrowButtonSpacing";
static const QString CLOSE_FROM_MENU_BUTTON = "CloseFromMenuButton";
//!@name animation flags
//@{
@ -300,6 +301,14 @@ namespace Oxygen
virtual void setUseOxygenShadows( bool value )
{ _useOxygenShadows = value; }
//! close from menu button
virtual bool closeFromMenuButton( void ) const
{ return _closeFromMenuButton; }
//! close from menu button
virtual void setCloseFromMenuButton( bool value )
{ _closeFromMenuButton = value; }
//!@name animations
//@{
@ -412,6 +421,9 @@ namespace Oxygen
//! oxygen shadows
bool _useOxygenShadows;
//! close window from menu button
bool _closeFromMenuButton;
//! narrow button spacing
bool _useNarrowButtonSpacing;