Use the standard kwin button order configuration instead of an own one

svn path=/trunk/kdebase/kwin/; revision=96753
icc-effect-5.14.5
Malte Starostik 2001-05-13 05:19:20 +00:00
parent d551bc8c15
commit dc874cdc2f
1 changed files with 26 additions and 38 deletions

View File

@ -368,51 +368,39 @@ Web::_createButtons()
leftButtonList_ .clear(); leftButtonList_ .clear();
rightButtonList_ .clear(); rightButtonList_ .clear();
QValueList<ButtonType> buttonSetupLeft, buttonSetupRight; QString buttons = options->titleButtonsLeft() + "|" + options->titleButtonsRight();
QList<WebButton> *buttonList = &leftButtonList_;
KConfig c("kwinwebrc"); for (unsigned int i = 0; i < buttons.length(); ++i)
QStringList buttonList;
if (c.hasGroup("Buttons"))
{ {
c.setGroup("Buttons"); WebButton * tb = 0;
switch (buttons[i].latin1())
{
case 'S': // Sticky
tb = _createButton("Sticky", this);
break;
buttonList = c.readListEntry("Layout"); case 'H': // Help
} tb = _createButton("Help", this);
else break;
{
buttonList << "Iconify" << "Sticky";
if (providesContextHelp()) case 'I': // Minimize
buttonList << "Help"; tb = _createButton("Iconify", this);
break;
buttonList << "Title"; case 'A': // Maximize
tb = _createButton("Maximize", this);
break;
buttonList << "Maximize" << "Close"; case 'X': // Close
} tb = _createButton("Close", this);
break;
QStringList::ConstIterator it(buttonList.begin());
for (; it != buttonList.end(); ++it)
{
QString s(*it);
if ("Title" == s)
break; // Move to right-side buttons.
WebButton * tb = _createButton(*it, this);
case '|':
buttonList = &rightButtonList_;
break;
}
if (0 != tb) if (0 != tb)
leftButtonList_.append(tb); buttonList->append(tb);
}
for (; it != buttonList.end(); ++it)
{
WebButton * tb = _createButton(*it, this);
if (0 != tb)
rightButtonList_.append(tb);
} }
if (!leftButtonList_.isEmpty()) if (!leftButtonList_.isEmpty())