From 9048abe1731e242cb301b018abfc1ad27575ad65 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 15 Nov 2007 20:14:41 +0000 Subject: [PATCH] take advantage of KDecorationOptions::defaultTitleButtons[Left|Right] svn path=/trunk/KDE/kdebase/workspace/; revision=737210 --- clients/keramik/keramik.cpp | 8 ++------ clients/oxygen/oxygenclient.cpp | 10 ---------- clients/oxygen/oxygenclient.h | 2 -- clients/plastik/plastikclient.cpp | 10 ---------- clients/plastik/plastikclient.h | 2 -- kcmkwin/kwindecoration/kwindecoration.cpp | 8 ++++---- kcmkwin/kwindecoration/preview.cpp | 4 ++-- 7 files changed, 8 insertions(+), 36 deletions(-) diff --git a/clients/keramik/keramik.cpp b/clients/keramik/keramik.cpp index 5bae2ee121..e8baded410 100644 --- a/clients/keramik/keramik.cpp +++ b/clients/keramik/keramik.cpp @@ -61,10 +61,6 @@ namespace Keramik const int buttonSpacing = 4; // Spacing between the titlebar buttons const int iconSpacing = 5; // Spacing between the icon and the text label - // Default button layout - const char default_left[] = "M"; - const char default_right[] = "HIAX"; - // Titlebar button bitmaps const unsigned char menu_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -929,7 +925,7 @@ void KeramikClient::createLayout() titleLayout->addSpacing( buttonMargin ); // Left button margin addButtons( titleLayout, options()->customButtonPositions() ? - options()->titleButtonsLeft() : QString(default_left) ); + options()->titleButtonsLeft() : KDecorationOptions::defaultTitleButtonsLeft() ); titlebar = new QSpacerItem( 10, clientHandler->titleBarHeight(largeTitlebar) - topSpacing, QSizePolicy::Expanding, QSizePolicy::Minimum ); @@ -937,7 +933,7 @@ void KeramikClient::createLayout() titleLayout->addSpacing( buttonSpacing ); addButtons( titleLayout, options()->customButtonPositions() ? - options()->titleButtonsRight() : QString(default_right) ); + options()->titleButtonsRight() : KDecorationOptions::defaultTitleButtonsRight() ); titleLayout->addSpacing( buttonMargin - 1 ); // Right button margin windowLayout->addSpacing( leftBorderWidth ); // Left border diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index a21ad05bb9..d696f4f078 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -68,16 +68,6 @@ QString OxygenClient::visibleName() const return i18n("Oxygen"); } -QString OxygenClient::defaultButtonsLeft() const -{ - return "M"; -} - -QString OxygenClient::defaultButtonsRight() const -{ - return "HIAX"; -} - void OxygenClient::init() { KCommonDecoration::init(); diff --git a/clients/oxygen/oxygenclient.h b/clients/oxygen/oxygenclient.h index 2c7feeb555..f7b2f9cb80 100644 --- a/clients/oxygen/oxygenclient.h +++ b/clients/oxygen/oxygenclient.h @@ -45,8 +45,6 @@ public: virtual ~OxygenClient(); virtual QString visibleName() const; - virtual QString defaultButtonsLeft() const; - virtual QString defaultButtonsRight() const; virtual KCommonDecorationButton *createButton(::ButtonType type); virtual bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; diff --git a/clients/plastik/plastikclient.cpp b/clients/plastik/plastikclient.cpp index fa06f7bca3..3a45c450aa 100644 --- a/clients/plastik/plastikclient.cpp +++ b/clients/plastik/plastikclient.cpp @@ -56,16 +56,6 @@ QString PlastikClient::visibleName() const return i18n("Plastik"); } -QString PlastikClient::defaultButtonsLeft() const -{ - return "M"; -} - -QString PlastikClient::defaultButtonsRight() const -{ - return "HIAX"; -} - bool PlastikClient::decorationBehaviour(DecorationBehaviour behaviour) const { switch (behaviour) { diff --git a/clients/plastik/plastikclient.h b/clients/plastik/plastikclient.h index 46b194866b..4c5b0d9586 100644 --- a/clients/plastik/plastikclient.h +++ b/clients/plastik/plastikclient.h @@ -37,8 +37,6 @@ public: ~PlastikClient(); virtual QString visibleName() const; - virtual QString defaultButtonsLeft() const; - virtual QString defaultButtonsRight() const; virtual bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; virtual QRegion cornerShape(WindowCorner corner); diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index b306f85170..3794157837 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -472,9 +472,9 @@ void KWinDecorationModule::readConfig( const KConfigGroup & conf ) cbUseCustomButtonPositions->setChecked( customPositions ); buttonPositionWidget->setEnabled( customPositions ); // Menu and onAllDesktops buttons are default on LHS - buttonPositionWidget->setButtonsLeft( conf.readEntry("ButtonsOnLeft", "MS") ); + buttonPositionWidget->setButtonsLeft( conf.readEntry("ButtonsOnLeft", KDecorationOptions::defaultTitleButtonsLeft()) ); // Help, Minimize, Maximize and Close are default on RHS - buttonPositionWidget->setButtonsRight( conf.readEntry("ButtonsOnRight", "HIAX") ); + buttonPositionWidget->setButtonsRight( conf.readEntry("ButtonsOnRight", KDecorationOptions::defaultTitleButtonsRight()) ); int bsize = conf.readEntry( "BorderSize", (int)BorderNormal ); if( bsize >= BorderTiny && bsize < BordersCount ) @@ -555,8 +555,8 @@ void KWinDecorationModule::defaults() // decorationList->setSelected( // decorationList->findItem( i18n("KDE 2") ), true ); // KDE classic client - buttonPositionWidget->setButtonsLeft("MS"); - buttonPositionWidget->setButtonsRight("HIAX"); + buttonPositionWidget->setButtonsLeft(KDecorationOptions::defaultTitleButtonsLeft()); + buttonPositionWidget->setButtonsRight(KDecorationOptions::defaultTitleButtonsRight()); border_size = BorderNormal; checkSupportedBorderSizes(); diff --git a/kcmkwin/kwindecoration/preview.cpp b/kcmkwin/kwindecoration/preview.cpp index e79ba32bda..422ee850c9 100644 --- a/kcmkwin/kwindecoration/preview.cpp +++ b/kcmkwin/kwindecoration/preview.cpp @@ -473,8 +473,8 @@ unsigned long KDecorationPreviewOptions::updateSettings() if (!customTitleButtonsRight.isNull() ) d->title_buttons_right = customTitleButtonsRight; } else { - d->title_buttons_left = "MS"; - d->title_buttons_right = "HIAX"; + d->title_buttons_left = KDecorationOptions::defaultTitleButtonsLeft(); + d->title_buttons_right = KDecorationOptions::defaultTitleButtonsRight(); } return changed;