diff --git a/kcmkwin/kwinoptions/mouse.h b/kcmkwin/kwinoptions/mouse.h --- a/kcmkwin/kwinoptions/mouse.h +++ b/kcmkwin/kwinoptions/mouse.h @@ -25,7 +25,6 @@ class KConfig; #include -#include #include #include "ui_actions.h" @@ -68,12 +67,6 @@ KWinMouseConfigForm *m_ui; KWinOptionsSettings *m_settings; - - void createMaximizeButtonTooltips(KComboBox* combo); - -private Q_SLOTS: - void paletteChanged(); - }; class KWindowActionsConfig : public KCModule diff --git a/kcmkwin/kwinoptions/mouse.cpp b/kcmkwin/kwinoptions/mouse.cpp --- a/kcmkwin/kwinoptions/mouse.cpp +++ b/kcmkwin/kwinoptions/mouse.cpp @@ -19,100 +19,13 @@ #include "mouse.h" -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - #include -#include -#include #include #include #include "kwinoptions_settings.h" - -namespace -{ - -QPixmap maxButtonPixmaps[3]; - -void createMaxButtonPixmaps() -{ - char const *maxButtonXpms[][3 + 13] = { - { - nullptr, nullptr, nullptr, - "...............", - ".......#.......", - "......###......", - ".....#####.....", - "..#....#....#..", - ".##....#....##.", - "###############", - ".##....#....##.", - "..#....#....#..", - ".....#####.....", - "......###......", - ".......#.......", - "..............." - }, - { - nullptr, nullptr, nullptr, - "...............", - ".......#.......", - "......###......", - ".....#####.....", - ".......#.......", - ".......#.......", - ".......#.......", - ".......#.......", - ".......#.......", - ".....#####.....", - "......###......", - ".......#.......", - "..............." - }, - { - nullptr, nullptr, nullptr, - "...............", - "...............", - "...............", - "...............", - "..#.........#..", - ".##.........##.", - "###############", - ".##.........##.", - "..#.........#..", - "...............", - "...............", - "...............", - "..............." - }, - }; - - QByteArray baseColor(". c " + KColorScheme(QPalette::Active, KColorScheme::View).background().color().name().toLatin1()); - QByteArray textColor("# c " + KColorScheme(QPalette::Active, KColorScheme::View).foreground().color().name().toLatin1()); - for (int t = 0; t < 3; ++t) { - maxButtonXpms[t][0] = "15 13 2 1"; - maxButtonXpms[t][1] = baseColor.constData(); - maxButtonXpms[t][2] = textColor.constData(); - maxButtonPixmaps[t] = QPixmap(maxButtonXpms[t]); - maxButtonPixmaps[t].setMask(maxButtonPixmaps[t].createHeuristicMask()); - } -} - -} // namespace - KWinMouseConfigForm::KWinMouseConfigForm(QWidget *parent) : QWidget(parent) { @@ -125,45 +38,15 @@ setupUi(parent); } -void KTitleBarActionsConfig::paletteChanged() -{ - createMaxButtonPixmaps(); - for (int i=0; i<3; ++i) { - m_ui->kcfg_MaximizeButtonLeftClickCommand->setItemIcon(i, maxButtonPixmaps[i]); - m_ui->kcfg_MaximizeButtonMiddleClickCommand->setItemIcon(i, maxButtonPixmaps[i]); - m_ui->kcfg_MaximizeButtonRightClickCommand->setItemIcon(i, maxButtonPixmaps[i]); - } - -} - KTitleBarActionsConfig::KTitleBarActionsConfig(bool _standAlone, KWinOptionsSettings *settings, QWidget *parent) : KCModule(parent), standAlone(_standAlone) , m_ui(new KWinMouseConfigForm(this)) , m_settings(settings) { addConfig(m_settings, this); - - // create the items for the maximize button actions - createMaxButtonPixmaps(); - for (int i=0; i<3; ++i) { - m_ui->kcfg_MaximizeButtonLeftClickCommand->addItem(maxButtonPixmaps[i], QString()); - m_ui->kcfg_MaximizeButtonMiddleClickCommand->addItem(maxButtonPixmaps[i], QString()); - m_ui->kcfg_MaximizeButtonRightClickCommand->addItem(maxButtonPixmaps[i], QString()); - } - createMaximizeButtonTooltips(m_ui->kcfg_MaximizeButtonLeftClickCommand); - createMaximizeButtonTooltips(m_ui->kcfg_MaximizeButtonMiddleClickCommand); - createMaximizeButtonTooltips(m_ui->kcfg_MaximizeButtonRightClickCommand); - load(); } -void KTitleBarActionsConfig::createMaximizeButtonTooltips(KComboBox *combo) -{ - combo->setItemData(0, i18n("Maximize"), Qt::ToolTipRole); - combo->setItemData(1, i18n("Maximize (vertical only)"), Qt::ToolTipRole); - combo->setItemData(2, i18n("Maximize (horizontal only)"), Qt::ToolTipRole); -} - void KTitleBarActionsConfig::showEvent(QShowEvent *ev) { if (!standAlone) { @@ -176,9 +59,6 @@ void KTitleBarActionsConfig::changeEvent(QEvent *ev) { - if (ev->type() == QEvent::PaletteChange) { - paletteChanged(); - } ev->accept(); } diff --git a/kcmkwin/kwinoptions/mouse.ui b/kcmkwin/kwinoptions/mouse.ui --- a/kcmkwin/kwinoptions/mouse.ui +++ b/kcmkwin/kwinoptions/mouse.ui @@ -607,15 +607,24 @@ - - - 0 - 0 - - Behavior on <em>left</em> click onto the maximize button. + + + Maximize + + + + + Maximize (vertical only) + + + + + Maximize (horizontal only) + + @@ -633,15 +642,24 @@ - - - 0 - 0 - - Behavior on <em>middle</em> click onto the maximize button. + + + Maximize + + + + + Maximize (vertical only) + + + + + Maximize (horizontal only) + + @@ -659,15 +677,24 @@ - - - 0 - 0 - - Behavior on <em>right</em> click onto the maximize button. + + + Maximize + + + + + Maximize (vertical only) + + + + + Maximize (horizontal only) + +