take advantage of KDecorationOptions::defaultTitleButtons[Left|Right]

svn path=/trunk/KDE/kdebase/workspace/; revision=737210
This commit is contained in:
Aaron J. Seigo 2007-11-15 20:14:41 +00:00
parent 16e3e5581e
commit 9048abe173
7 changed files with 8 additions and 36 deletions

View file

@ -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

View file

@ -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();

View file

@ -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;

View file

@ -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) {

View file

@ -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);

View file

@ -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();

View file

@ -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;