From f08d982b158d8f176dfa57829ecf4e48c476edec Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Tue, 10 Nov 2009 23:11:08 +0000 Subject: [PATCH] - made distance between window border and first button smaller by 2 pixels - set default spacing between buttons to 3 pixels - added 'hidden' option to disable the above - removed extra spacing before close button in default button layout, since the 3 pixels above should be enough svn path=/trunk/KDE/kdebase/workspace/; revision=1047309 --- clients/oxygen/oxygenclient.cpp | 16 +++++++++++++--- clients/oxygen/oxygenclient.h | 6 ++++++ clients/oxygen/oxygenconfiguration.cpp | 12 ++++++++++-- clients/oxygen/oxygenconfiguration.h | 10 ++++++++++ 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index 78a0be6e89..b0f730e727 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -229,6 +229,7 @@ namespace Oxygen { bool maximized( isMaximized() ); + bool narrowSpacing( configuration().useNarrowButtonSpacing() ); int frameBorder( configuration().frameBorder() ); int buttonSize( configuration().hideTitleBar() ? 0 : configuration().buttonSize() ); @@ -273,7 +274,7 @@ namespace Oxygen if( frameBorder == OxygenConfiguration::BorderNone && configuration().hideTitleBar() ) { - border = 0; + border = 0; } else if( !( respectWindowState && maximized )) { @@ -295,7 +296,7 @@ namespace Oxygen { int border = 0; if( !(respectWindowState && maximized) ) - { border = 6; } + { border = 4; } return border; @@ -321,7 +322,7 @@ namespace Oxygen } case LM_ButtonSpacing: - return 1; + return narrowSpacing ? 1:3; case LM_ButtonMarginTop: return 0; @@ -815,6 +816,15 @@ namespace Oxygen } + //_________________________________________________________ + QString OxygenClient::defaultButtonsLeft() const + { return KCommonDecoration::defaultButtonsLeft(); } + + + //_________________________________________________________ + QString OxygenClient::defaultButtonsRight() const + { return "HIAX"; } + //________________________________________________________________ void OxygenClient::updateWindowShape() { diff --git a/clients/oxygen/oxygenclient.h b/clients/oxygen/oxygenclient.h index 584ecda7e8..357a75feb1 100644 --- a/clients/oxygen/oxygenclient.h +++ b/clients/oxygen/oxygenclient.h @@ -142,6 +142,12 @@ namespace Oxygen //@} + //! default buttons located on the left + virtual QString defaultButtonsLeft() const; + + //! default buttons located on the right + virtual QString defaultButtonsRight() const; + //!@name status change methods (overloaded from KCommonDecorationUnstable) //@{ diff --git a/clients/oxygen/oxygenconfiguration.cpp b/clients/oxygen/oxygenconfiguration.cpp index 9d24327d31..dde7fdeef1 100644 --- a/clients/oxygen/oxygenconfiguration.cpp +++ b/clients/oxygen/oxygenconfiguration.cpp @@ -42,7 +42,8 @@ namespace Oxygen hideTitleBar_( false ), useOxygenShadows_( true ), useAnimations_( true ), - animationsDuration_( 150 ) + animationsDuration_( 150 ), + useNarrowButtonSpacing_( false ) {} //__________________________________________________ @@ -106,6 +107,11 @@ namespace Oxygen setAnimationsDuration( group.readEntry( OxygenConfig::ANIMATIONS_DURATION, defaultConfiguration.animationsDuration() ) ); + + // buttonSpacing + setUseNarrowButtonSpacing( group.readEntry( + OxygenConfig::NARROW_BUTTON_SPACING, + defaultConfiguration.useNarrowButtonSpacing() ) ); } //__________________________________________________ @@ -124,6 +130,7 @@ namespace Oxygen group.writeEntry( OxygenConfig::USE_OXYGEN_SHADOWS, useOxygenShadows() ); group.writeEntry( OxygenConfig::USE_ANIMATIONS, useAnimations() ); group.writeEntry( OxygenConfig::ANIMATIONS_DURATION, animationsDuration() ); + group.writeEntry( OxygenConfig::NARROW_BUTTON_SPACING, useNarrowButtonSpacing() ); } //__________________________________________________ @@ -290,7 +297,8 @@ namespace Oxygen hideTitleBar() == other.hideTitleBar() && useOxygenShadows() == other.useOxygenShadows() && useAnimations() == other.useAnimations() && - animationsDuration() == other.animationsDuration(); + animationsDuration() == other.animationsDuration() && + useNarrowButtonSpacing() == other.useNarrowButtonSpacing(); } diff --git a/clients/oxygen/oxygenconfiguration.h b/clients/oxygen/oxygenconfiguration.h index 129df7b2a1..7cd1661668 100644 --- a/clients/oxygen/oxygenconfiguration.h +++ b/clients/oxygen/oxygenconfiguration.h @@ -42,6 +42,7 @@ namespace OxygenConfig static const QString HIDE_TITLEBAR = "HideTitleBar"; static const QString USE_ANIMATIONS = "UseAnimations"; static const QString ANIMATIONS_DURATION = "AnimationsDuration"; + static const QString NARROW_BUTTON_SPACING = "UseNarrowButtonSpacing"; } @@ -144,6 +145,12 @@ namespace Oxygen virtual void setButtonSize( ButtonSize value ) { buttonSize_ = value; } + virtual bool useNarrowButtonSpacing( void ) const + { return useNarrowButtonSpacing_; } + + virtual void setUseNarrowButtonSpacing( bool value ) + { useNarrowButtonSpacing_ = value; } + //@} //!@name frame border @@ -293,6 +300,9 @@ namespace Oxygen //! animations int animationsDuration_; + //! narrow button spacing + bool useNarrowButtonSpacing_; + }; }