From 6db2407334a22dac6de3bbe45ba20e07a629c785 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Sun, 11 Nov 2012 13:15:47 +0100 Subject: [PATCH] Added hidden option to disable extended window borders. --- clients/oxygen/oxygenclient.cpp | 5 ++++- clients/oxygen/oxygenconfiguration.cpp | 8 ++++++++ clients/oxygen/oxygenconfiguration.h | 10 ++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index e5d5487b20..5470eda712 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -1432,7 +1432,10 @@ namespace Oxygen QRegion Client::region( KDecorationDefines::Region r ) { - if( r == KDecorationDefines::ExtendedBorderRegion && configuration().frameBorder() <= Configuration::BorderNoSide ) + if( + (r == KDecorationDefines::ExtendedBorderRegion) && + configuration().useExtendedWindowBorder() && + configuration().frameBorder() <= Configuration::BorderNoSide ) { const QRect rect = widget()->rect().adjusted( diff --git a/clients/oxygen/oxygenconfiguration.cpp b/clients/oxygen/oxygenconfiguration.cpp index 913ae76754..9c35f1d23e 100644 --- a/clients/oxygen/oxygenconfiguration.cpp +++ b/clients/oxygen/oxygenconfiguration.cpp @@ -49,6 +49,7 @@ namespace Oxygen _useOxygenShadows( true ), _closeFromMenuButton( false ), _useNarrowButtonSpacing( false ), + _useExtendedWindowBorder( true ), _animationsEnabled( true ), _buttonAnimationsEnabled( true ), _titleAnimationsEnabled( true ), @@ -138,6 +139,11 @@ namespace Oxygen OxygenConfig::NARROW_BUTTON_SPACING, defaultConfiguration.useNarrowButtonSpacing() ) ); + // extended window border + setUseExtendedWindowBorder( group.readEntry( + OxygenConfig::EXTENDED_WINDOW_BORDERS, + defaultConfiguration.useExtendedWindowBorder() ) ); + // animations setAnimationsEnabled( group.readEntry( OxygenConfig::ANIMATIONS_ENABLED, @@ -215,6 +221,7 @@ namespace Oxygen 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() ); + if( useExtendedWindowBorder() != defaultConfiguration.useExtendedWindowBorder() ) group.writeEntry( OxygenConfig::EXTENDED_WINDOW_BORDERS, useExtendedWindowBorder() ); // animations if( animationsEnabled() != defaultConfiguration.animationsEnabled() ) group.writeEntry( OxygenConfig::ANIMATIONS_ENABLED, animationsEnabled() ); @@ -409,6 +416,7 @@ namespace Oxygen useOxygenShadows() == other.useOxygenShadows() && closeFromMenuButton() == other.closeFromMenuButton() && useNarrowButtonSpacing() == other.useNarrowButtonSpacing() && + useExtendedWindowBorder() == other.useExtendedWindowBorder() && animationsEnabled() == other.animationsEnabled() && buttonAnimationsEnabled() == other.buttonAnimationsEnabled() && titleAnimationsEnabled() == other.titleAnimationsEnabled() && diff --git a/clients/oxygen/oxygenconfiguration.h b/clients/oxygen/oxygenconfiguration.h index 1550273350..52fd690283 100644 --- a/clients/oxygen/oxygenconfiguration.h +++ b/clients/oxygen/oxygenconfiguration.h @@ -45,6 +45,7 @@ namespace OxygenConfig static const QString ANIMATIONS_ENABLED = "AnimationsEnabled"; static const QString NARROW_BUTTON_SPACING = "UseNarrowButtonSpacing"; static const QString CLOSE_FROM_MENU_BUTTON = "CloseFromMenuButton"; + static const QString EXTENDED_WINDOW_BORDERS = "UseExtendedWindowBorders"; //!@name animation flags //@{ @@ -215,6 +216,12 @@ namespace Oxygen virtual void setFrameBorder( QString value, bool translated ) { _frameBorder = frameBorder( value, translated ); } + virtual bool useExtendedWindowBorder( void ) const + { return _useExtendedWindowBorder; } + + virtual void setUseExtendedWindowBorder( bool value ) + { _useExtendedWindowBorder = value; } + //@} //!@name blend color @@ -427,6 +434,9 @@ namespace Oxygen //! narrow button spacing bool _useNarrowButtonSpacing; + //! extended window borders + bool _useExtendedWindowBorder; + //!@name animation flags //@{ bool _animationsEnabled;