From 0a27e45f56846efa92c433b3beebb769ff4bb992 Mon Sep 17 00:00:00 2001 From: Rik Hemsley Date: Tue, 10 Oct 2000 22:03:50 +0000 Subject: [PATCH] This should answer those bug reports about not being able to configure the button order on the titlebar, for the RISC OS theme at least. I now have [Sticky][(Help)].....Title.......[Iconify][Maximise][Close]. Much more sensible than the stupid RISC OS layout. svn path=/trunk/kdebase/kwin/; revision=67108 --- clients/riscos/Manager.cpp | 40 +++++++++++++++++++++++++------------- clients/riscos/Manager.h | 5 +++++ clients/riscos/Static.cpp | 25 ++++++++++++++++++++++++ clients/riscos/Static.h | 11 +++++++++-- 4 files changed, 66 insertions(+), 15 deletions(-) diff --git a/clients/riscos/Manager.cpp b/clients/riscos/Manager.cpp index 002eea3e7d..c706c77b79 100644 --- a/clients/riscos/Manager.cpp +++ b/clients/riscos/Manager.cpp @@ -23,6 +23,7 @@ #include #include #include + #include "../../options.h" #include "../../workspace.h" @@ -57,6 +58,9 @@ Manager::Manager( { setBackgroundMode(NoBackground); + QStringList leftButtons = Static::instance()->leftButtons(); + QStringList rightButtons = Static::instance()->rightButtons(); + connect(options, SIGNAL(resetClients()), this, SLOT(slotReset())); QVBoxLayout * l = new QVBoxLayout(this, 0, 0); @@ -71,25 +75,35 @@ Manager::Manager( if (!providesContextHelp()) help_->hide(); - lower_ ->setAlignment(Button::Left); - close_ ->setAlignment(Button::Left); - sticky_ ->setAlignment(Button::Left); - help_ ->setAlignment(Button::Right); - iconify_ ->setAlignment(Button::Right); - maximise_ ->setAlignment(Button::Right); + buttonDict_.insert("Lower", lower_); + buttonDict_.insert("Close", close_); + buttonDict_.insert("Sticky", sticky_); + buttonDict_.insert("Iconify", iconify_); + buttonDict_.insert("Maximize", maximise_); + buttonDict_.insert("Help", help_); - // Lower | Close | Text | Iconify | Maximise + QStringList::ConstIterator it; + + for (it = leftButtons.begin(); it != leftButtons.end(); ++it) + if (buttonDict_[*it]) + buttonDict_[*it]->setAlignment(Button::Left); + + for (it = rightButtons.begin(); it != rightButtons.end(); ++it) + if (buttonDict_[*it]) + buttonDict_[*it]->setAlignment(Button::Left); QHBoxLayout * titleLayout = new QHBoxLayout(l); - titleLayout->addWidget(lower_); - titleLayout->addWidget(close_); - titleLayout->addWidget(sticky_); + for (it = leftButtons.begin(); it != leftButtons.end(); ++it) + if (buttonDict_[*it]) + titleLayout->addWidget(buttonDict_[*it]); + titleSpacer_ = new QSpacerItem(0, 20); titleLayout->addItem(titleSpacer_); - titleLayout->addWidget(help_); - titleLayout->addWidget(iconify_); - titleLayout->addWidget(maximise_); + + for (it = rightButtons.begin(); it != rightButtons.end(); ++it) + if (buttonDict_[*it]) + titleLayout->addWidget(buttonDict_[*it]); QHBoxLayout * midLayout = new QHBoxLayout(l); midLayout->addSpacing(1); diff --git a/clients/riscos/Manager.h b/clients/riscos/Manager.h index 58678f7c98..60283218c9 100644 --- a/clients/riscos/Manager.h +++ b/clients/riscos/Manager.h @@ -23,6 +23,8 @@ #ifndef RISC_OS_MANAGER_H #define RISC_OS_MANAGER_H +#include + #include "../../client.h" class QSpacerItem; @@ -36,6 +38,7 @@ class IconifyButton; class MaximiseButton; class StickyButton; class HelpButton; +class Button; class Manager : public Client { @@ -86,6 +89,8 @@ class Manager : public Client HelpButton * help_; QSpacerItem * titleSpacer_; + + QDict