diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 8b2aa1b5301ab60368a03e36df4ff5216726e87d (patch) | |
tree | 36163d4ee667c23b5cf232df2f3004cd0a76202a /kwin-styles/glow | |
download | tdeartwork-8b2aa1b5301ab60368a03e36df4ff5216726e87d.tar.gz tdeartwork-8b2aa1b5301ab60368a03e36df4ff5216726e87d.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeartwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwin-styles/glow')
114 files changed, 2405 insertions, 0 deletions
diff --git a/kwin-styles/glow/Makefile.am b/kwin-styles/glow/Makefile.am new file mode 100644 index 00000000..92d5a63a --- /dev/null +++ b/kwin-styles/glow/Makefile.am @@ -0,0 +1,22 @@ + +INCLUDES = $(all_includes) + +SUBDIRS = . config themes + +kde_module_LTLIBRARIES = kwin3_glow.la + +kwin3_glow_la_SOURCES = glowclient.cpp glowbutton.cpp +kwin3_glow_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +kwin3_glow_la_LIBADD = $(LIB_KDECORE) -lkdecorations + +METASOURCES = AUTO +noinst_HEADERS = glowclient.h glowbutton.h resources.h + +linkdir = $(kde_datadir)/kwin/ +link_DATA = glow.desktop + +EXTRA_DIST = $(link_DATA) + +###KMAKE-start (don't edit or delete this block) + +###KMAKE-end diff --git a/kwin-styles/glow/config/Makefile.am b/kwin-styles/glow/config/Makefile.am new file mode 100644 index 00000000..e677ff91 --- /dev/null +++ b/kwin-styles/glow/config/Makefile.am @@ -0,0 +1,17 @@ +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = kwin_glow_config.la + +kwin_glow_config_la_SOURCES = glowconfigdialog.cpp +kwin_glow_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +kwin_glow_config_la_LIBADD = $(LIB_KDEUI) + +METASOURCES = AUTO +noinst_HEADERS = glowconfigdialog.h + +lnkdir = $(kde_datadir)/kwin/ + + +###KMAKE-start (don't edit or delete this block) + +###KMAKE-end diff --git a/kwin-styles/glow/config/bitmaps.h b/kwin-styles/glow/config/bitmaps.h new file mode 100644 index 00000000..7ecb262a --- /dev/null +++ b/kwin-styles/glow/config/bitmaps.h @@ -0,0 +1,55 @@ +/*************************************************************************** + bitmaps.h - description + ------------------- + begin : Thu Sep 12 2001 + copyright : (C) 2001 by Henning Burchardt + email : h_burchardt@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef BITMAPS_H +#define BITMAPS_H + +#define BITMAP_SIZE 17 + +static unsigned char close_bits[] = { + 0x00,0x00,0x16,0x00,0x00,0x16,0x00,0x00,0xf8,0x00,0x00,0x0c,0x10,0x10,0x60, + 0x30,0x18,0x00,0x60,0x0c,0xc8,0xc0,0x07,0x16,0x80,0x03,0x60,0xc0,0x07,0x00, + 0x60,0x0c,0x00,0x30,0x18,0xf8,0x10,0x10,0x00,0x00,0x00,0x46,0x00,0x00,0xfe, + 0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89,0xf3,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; +static unsigned char help_bits[] = { + 0x00,0x00,0x16,0x00,0x00,0x16,0x00,0x00,0x10,0x00,0x00,0x0c,0x80,0x07,0xb6, + 0x40,0x0c,0x00,0x00,0x0c,0xc8,0x00,0x0c,0x16,0x00,0x06,0xb6,0x00,0x03,0x00, + 0x00,0x01,0x00,0x00,0x00,0x10,0x00,0x01,0x00,0x00,0x00,0xac,0x00,0x00,0xfe, + 0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x24,0xc4,0x3f,0x40,0x01,0xf3,0x00,0x00, + 0x70,0xb9,0x65,0x40,0x70,0xb9,0x65,0x40 }; +static unsigned char maximizeoff_bits[] = { + 0x00,0x00,0x16,0x00,0x00,0x16,0x00,0x00,0x1e,0x00,0x00,0x0c,0xf0,0x1f,0x60, + 0xf0,0x1f,0x00,0x10,0x10,0xc8,0x10,0x10,0x16,0x10,0x10,0x60,0x10,0x10,0x00, + 0x10,0x10,0x00,0x10,0x10,0x1e,0xf0,0x1f,0x00,0x00,0x00,0x50,0x00,0x00,0xfe, + 0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x68,0xb9,0x65,0x40,0x01,0xf2,0x00,0x00, + 0x00,0x00,0x00,0x00,0xe0,0xb1,0x65,0x40 }; +static unsigned char minimize_bits[] = { + 0x00,0x00,0x16,0x00,0x00,0x16,0x00,0x00,0x10,0x00,0x00,0x0c,0x00,0x00,0xb6, + 0xe0,0x0f,0x00,0x00,0x00,0xc8,0x20,0x08,0x16,0x60,0x0c,0xb6,0xc0,0x06,0x00, + 0x80,0x03,0x00,0x00,0x01,0x10,0x00,0x00,0x00,0x00,0x00,0xb2,0x00,0x00,0xfe, + 0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x29,0xf2,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; +static unsigned char stickyoff_bits[] = { + 0x00,0x00,0x16,0x00,0x00,0x16,0x00,0x00,0x1e,0x00,0x00,0x0c,0x50,0x15,0x60, + 0xe0,0x00,0x00,0xf0,0x11,0xc8,0xe0,0x00,0x16,0x50,0x15,0x60,0x00,0x00,0x00, + 0x10,0x11,0x00,0x00,0x00,0x1e,0x50,0x15,0x00,0x00,0x00,0x46,0x00,0x00,0xfe, + 0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x08,0x31,0xf2,0x00,0x00, + 0x00,0x00,0x00,0x00,0x29,0xf2,0x00,0x00 }; + +#endif + diff --git a/kwin-styles/glow/config/glowconfigdialog.cpp b/kwin-styles/glow/config/glowconfigdialog.cpp new file mode 100644 index 00000000..41144c8a --- /dev/null +++ b/kwin-styles/glow/config/glowconfigdialog.cpp @@ -0,0 +1,369 @@ +/*************************************************************************** + glowconfigdialog.cpp - description + ------------------- + begin : Thu Sep 12 2001 + copyright : (C) 2001 by Henning Burchardt + email : h_burchardt@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <qbitmap.h> +#include <qbuttongroup.h> +#include <qcheckbox.h> +#include <qcombobox.h> +#include <qdir.h> +#include <qfileinfo.h> +#include <qgroupbox.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qlistview.h> +#include <qpushbutton.h> +#include <qsignalmapper.h> +#include <qstringlist.h> +#include <kconfig.h> +#include <kcolorbutton.h> +#include <kdebug.h> +#include <kglobal.h> +#include <kglobalsettings.h> +#include <klocale.h> +#include <kpixmap.h> +#include <kpixmapeffect.h> +#include <kstandarddirs.h> +#include "bitmaps.h" +#include "glowconfigdialog.h" +#include "../resources.h" + +#define NUMBER_OF_BUTTONS 5 + +extern "C" +{ + KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent ) + { + return(new GlowConfigDialog(conf, parent)); + } +} + +GlowConfigDialog::GlowConfigDialog( KConfig * conf, QWidget * parent ) + : QObject(parent) +{ + _glowConfig = new KConfig("kwinglowrc"); + KGlobal::locale()->insertCatalogue("kwin_glow_config"); + + _main_group_box = new QWidget(parent); + QVBoxLayout *main_group_boxLayout = new QVBoxLayout(_main_group_box); + main_group_boxLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); + main_group_boxLayout->setSpacing(6); + + //------------------------------------------------------------------------- + // themes + + _theme_list_view = new QListView (_main_group_box, "theme_list_view"); + _theme_list_view->addColumn (i18n("Theme")); + _theme_list_view->addColumn (i18n("Button Size")); + _theme_list_view->setAllColumnsShowFocus(true); + _theme_list_view->setResizeMode(QListView::AllColumns); + + main_group_boxLayout->addWidget (_theme_list_view); + QObject::connect (_theme_list_view, SIGNAL(selectionChanged()), + this, SLOT(slotThemeListViewSelectionChanged())); + slotLoadThemeList(); + + _button_glow_color_group_box = new QGroupBox( + 0, Qt::Horizontal, i18n("Button Glow Colors"), _main_group_box); + QHBoxLayout *colorHBoxLayout = + new QHBoxLayout(_button_glow_color_group_box->layout()); + + // create buttons + QSize buttonSize(BITMAP_SIZE, BITMAP_SIZE); + QPixmap pm(buttonSize); + pm.fill(Qt::black); + + _stickyButton = new QPushButton(_button_glow_color_group_box); + pm.setMask(QBitmap(buttonSize, stickyoff_bits, true)); + _stickyButton->setPixmap(pm); + colorHBoxLayout->addWidget(_stickyButton); + _titleButtonList.push_back(_stickyButton); + + _helpButton = new QPushButton(_button_glow_color_group_box); + pm.setMask(QBitmap(buttonSize, help_bits, true)); + _helpButton->setPixmap(pm); + colorHBoxLayout->addWidget(_helpButton); + _titleButtonList.push_back(_helpButton); + + _iconifyButton = new QPushButton(_button_glow_color_group_box); + pm.setMask(QBitmap(buttonSize, minimize_bits, true)); + _iconifyButton->setPixmap(pm); + colorHBoxLayout->addWidget(_iconifyButton); + _titleButtonList.push_back(_iconifyButton); + + _maximizeButton = new QPushButton(_button_glow_color_group_box); + pm.setMask(QBitmap(buttonSize, maximizeoff_bits, true)); + _maximizeButton->setPixmap(pm); + colorHBoxLayout->addWidget(_maximizeButton); + _titleButtonList.push_back(_maximizeButton); + + _closeButton = new QPushButton(_button_glow_color_group_box); + pm.setMask(QBitmap(buttonSize, close_bits, true)); + _closeButton->setPixmap(pm); + colorHBoxLayout->addWidget(_closeButton); + _titleButtonList.push_back(_closeButton); + + // create signal mapper + _titleButtonMapper = new QSignalMapper(this); + for( uint i=0; i<_titleButtonList.size(); i++ ) { + _titleButtonMapper->setMapping(_titleButtonList[i], i); + connect(_titleButtonList[i], SIGNAL(clicked()),_titleButtonMapper, SLOT(map())); + } + connect(_titleButtonMapper, SIGNAL(mapped(int)),this, SLOT(slotTitleButtonClicked(int))); + + _colorButton = new KColorButton(_button_glow_color_group_box); + _colorButton->setEnabled(false); + connect(_colorButton, SIGNAL(changed(const QColor&)), + this, SLOT(slotColorButtonChanged(const QColor&))); + + colorHBoxLayout->addItem(new QSpacerItem( + 200, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + colorHBoxLayout->addWidget(_colorButton); + + main_group_boxLayout->addWidget(_button_glow_color_group_box); + + QHBoxLayout *titlebarGradientTypeLayout = new QHBoxLayout(); + _titlebarGradientTypeComboBox = new QComboBox(_main_group_box); + + KConfig *c = KGlobal::config(); + KConfigGroupSaver cgs( c, QString::fromLatin1("WM") ); + QColor activeBackground = c->readColorEntry("activeBackground"); + QColor activeBlend = c->readColorEntry("activeBlend"); + + // If the colors are equal, change one to get a gradient effect + if (activeBackground==activeBlend) { + activeBackground = activeBackground.dark(); + } + for (int i=0; i< KPixmapEffect::EllipticGradient; i++ ) { + KPixmap gradPixmap(QSize(196,20)); + KPixmapEffect::gradient(gradPixmap, activeBackground, + activeBlend, (KPixmapEffect::GradientType) i); + + _titlebarGradientTypeComboBox->insertItem(gradPixmap, i); + } + + connect(_titlebarGradientTypeComboBox, SIGNAL(activated(int)), + this, SLOT(slotTitlebarGradientTypeChanged(int))); + titlebarGradientTypeLayout->addWidget( + new QLabel(i18n("Titlebar gradient:"), _main_group_box)); + titlebarGradientTypeLayout->addWidget(_titlebarGradientTypeComboBox, 0, Qt::AlignLeft); + titlebarGradientTypeLayout->addStretch(10); + main_group_boxLayout->addLayout(titlebarGradientTypeLayout); + + + _showResizeHandleCheckBox = new QCheckBox( + i18n("Show resize handle"), _main_group_box); + connect(_showResizeHandleCheckBox, SIGNAL(clicked()), + this, SLOT(slotResizeHandleCheckBoxChanged())); + main_group_boxLayout->addWidget(_showResizeHandleCheckBox); + + // load config and update user interface + load(conf); + + _main_group_box->show(); +} + +GlowConfigDialog::~GlowConfigDialog() +{ + delete _main_group_box; + delete _glowConfig; + delete[] _buttonConfigMap; +} + +void GlowConfigDialog::load( KConfig* /* conf */ ) +{ + QColor color; + const QColor defaultCloseButtonColor(DEFAULT_CLOSE_BUTTON_COLOR); + const QColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR); + const QColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR); + const QColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR); + const QColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR); + + _glowConfig->setGroup("General"); + + _buttonConfigMap = new QColor[NUMBER_OF_BUTTONS]; + color = _glowConfig->readColorEntry("stickyButtonGlowColor", + &defaultStickyButtonColor); + _buttonConfigMap[stickyButton] = color; + + color = _glowConfig->readColorEntry("helpButtonGlowColor", + &defaultHelpButtonColor); + _buttonConfigMap[helpButton] = color; + + color = _glowConfig->readColorEntry("iconifyButtonGlowColor", + &defaultIconifyButtonColor); + _buttonConfigMap[iconifyButton] = color; + + color = _glowConfig->readColorEntry("maximizeButtonGlowColor", + &defaultMaximizeButtonColor); + _buttonConfigMap[maximizeButton] = color; + + color = _glowConfig->readColorEntry("closeButtonGlowColor", + &defaultCloseButtonColor); + _buttonConfigMap[closeButton] = color; + + _showResizeHandle = _glowConfig->readBoolEntry("showResizeHandle", true); + _titlebarGradientType = static_cast<KPixmapEffect::GradientType> + (_glowConfig->readNumEntry("titlebarGradientType", + KPixmapEffect::DiagonalGradient)); + + _showResizeHandleCheckBox->setChecked(_showResizeHandle); + _titlebarGradientTypeComboBox->setCurrentItem(_titlebarGradientType); + + _theme_name = _glowConfig->readEntry ("themeName", "default"); + _theme_list_view->setSelected ( + _theme_list_view->findItem (_theme_name, 0), true); + slotTitleButtonClicked(0); +} + +void GlowConfigDialog::save( KConfig* /* conf */ ) +{ + _glowConfig->setGroup("General"); + + _glowConfig->writeEntry("stickyButtonGlowColor", _buttonConfigMap[stickyButton]); + _glowConfig->writeEntry("helpButtonGlowColor", _buttonConfigMap[helpButton]); + _glowConfig->writeEntry("iconifyButtonGlowColor", _buttonConfigMap[iconifyButton]); + _glowConfig->writeEntry("maximizeButtonGlowColor", _buttonConfigMap[maximizeButton]); + _glowConfig->writeEntry("closeButtonGlowColor", _buttonConfigMap[closeButton]); + + _glowConfig->writeEntry("showResizeHandle", _showResizeHandle); + _glowConfig->writeEntry("titlebarGradientType", _titlebarGradientType); + + _glowConfig->writeEntry ("themeName", _theme_name); + + _glowConfig->sync(); +} + +void GlowConfigDialog::defaults() +{ + const QColor defaultCloseButtonColor = DEFAULT_CLOSE_BUTTON_COLOR; + const QColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR); + const QColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR); + const QColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR); + const QColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR); + + _buttonConfigMap[stickyButton] = defaultStickyButtonColor; + _buttonConfigMap[helpButton] = defaultHelpButtonColor; + _buttonConfigMap[iconifyButton] = defaultIconifyButtonColor; + _buttonConfigMap[maximizeButton] = defaultMaximizeButtonColor; + _buttonConfigMap[closeButton] = defaultCloseButtonColor; + + _showResizeHandle = true; + _titlebarGradientType = KPixmapEffect::DiagonalGradient; + + _showResizeHandleCheckBox->setChecked(_showResizeHandle); + _titlebarGradientTypeComboBox->setCurrentItem(_titlebarGradientType); + + _theme_list_view->setSelected ( + _theme_list_view->findItem("default", 0), true); +} + +void GlowConfigDialog::slotLoadThemeList () +{ + QStringList dir_list=KGlobal::dirs()->findDirs("data", "kwin/glow-themes"); + + QStringList::ConstIterator it; + + _theme_list_view->clear(); + new QListViewItem (_theme_list_view, "default", "17x17"); + + for (it=dir_list.begin(); it!=dir_list.end(); ++it) + { + QDir dir (*it, QString("*"), QDir::Unsorted, + QDir::Dirs | QDir::Readable); + if (dir.exists()) + { + QFileInfoListIterator it2(*dir.entryInfoList()); + QFileInfo * finfo; + + while ((finfo=it2.current())) + { + if (finfo->fileName() == "." || finfo->fileName() == "..") { + ++it2; + continue; + } + + if (! _theme_list_view->findItem (finfo->fileName(), 0)) + { + KConfig conf (dir.path() + "/" + finfo->fileName() + "/" + + finfo->fileName() + ".theme"); + QSize button_size = conf.readSizeEntry ( + "buttonSize", new QSize (-1, -1)); + if (button_size.width() == -1) + { + ++it2; + continue; + } + QString size_string = QString("") + + QString::number(button_size.width()) + + "x" + QString::number(button_size.height()); + new QListViewItem (_theme_list_view, + finfo->fileName(), size_string); + } + + ++it2; + } + } + } +} + +void GlowConfigDialog::slotTitlebarGradientTypeChanged(int index) +{ + _titlebarGradientType = static_cast<KPixmapEffect::GradientType>(index); + emit changed(); +} + +void GlowConfigDialog::slotResizeHandleCheckBoxChanged() +{ + _showResizeHandle = _showResizeHandleCheckBox->isChecked(); + emit changed(); +} + +void GlowConfigDialog::slotTitleButtonClicked(int index) +{ + for( int i=0; i< ((int) _titleButtonList.size()); i++ ) { + _titleButtonList[i]->setDown(i==index); + } + _colorButton->setEnabled(true); + _colorButton->setColor(_buttonConfigMap[index]); +} + +void GlowConfigDialog::slotColorButtonChanged(const QColor& glowColor) +{ + if( _stickyButton->isDown() ) { + _buttonConfigMap[stickyButton] = glowColor; + } else if( _helpButton->isDown() ) { + _buttonConfigMap[helpButton] = glowColor; + } else if( _iconifyButton->isDown() ) { + _buttonConfigMap[iconifyButton] = glowColor; + } else if( _maximizeButton->isDown() ) { + _buttonConfigMap[maximizeButton] = glowColor; + } else { + _buttonConfigMap[closeButton] = glowColor; + } + emit changed(); +} + +void GlowConfigDialog::slotThemeListViewSelectionChanged () +{ + if( _theme_list_view->selectedItem() != 0 ) { + _theme_name = _theme_list_view->selectedItem()->text (0); + + emit changed(); + } +} + +#include "glowconfigdialog.moc" diff --git a/kwin-styles/glow/config/glowconfigdialog.h b/kwin-styles/glow/config/glowconfigdialog.h new file mode 100644 index 00000000..2190b3ce --- /dev/null +++ b/kwin-styles/glow/config/glowconfigdialog.h @@ -0,0 +1,91 @@ +/*************************************************************************** + glowconfigdialog.h - description + ------------------- + begin : Thu Sep 12 2001 + copyright : (C) 2001 by Henning Burchardt + email : h_burchardt@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef GLOW_CONFIG_DIALOG_H +#define GLOW_CONFIG_DIALOG_H + +#include <qvaluevector.h> +#include <qobject.h> + +class QListView; +class QPushButton; +class QSignalMapper; +class QCheckBox; +class QComboBox; +class KConfig; +class KColorButton; + +class GlowConfigDialog : public QObject +{ + Q_OBJECT + +public: + GlowConfigDialog( KConfig* conf, QWidget* parent ); + ~GlowConfigDialog(); + +signals: + void changed(); + +public slots: + void load( KConfig* conf ); + void save( KConfig* conf ); + void defaults(); + +protected slots: + void slotTitleButtonClicked(int); + void slotColorButtonChanged(const QColor&); + void slotTitlebarGradientTypeChanged(int); + void slotResizeHandleCheckBoxChanged(); + void slotThemeListViewSelectionChanged (); + +private slots: + void slotLoadThemeList (); + +private: + enum ButtonType{stickyButton, helpButton, iconifyButton, + maximizeButton, closeButton }; + + KConfig *_glowConfig; + + bool _showResizeHandle; + KPixmapEffect::GradientType _titlebarGradientType; + QString _theme_name; + + QWidget *_main_group_box; + QGroupBox *_button_glow_color_group_box; + QGroupBox *_theme_group_box; + + QListView * _theme_list_view; + + QCheckBox *_showResizeHandleCheckBox; + QComboBox *_titlebarGradientTypeComboBox; + + QPushButton *_stickyButton; + QPushButton *_helpButton; + QPushButton *_iconifyButton; + QPushButton *_maximizeButton; + QPushButton *_closeButton; + QSignalMapper *_titleButtonMapper; + + QColor* _buttonConfigMap; + QValueVector<QPushButton*> _titleButtonList; + + KColorButton *_colorButton; +}; + +#endif + diff --git a/kwin-styles/glow/glow.desktop b/kwin-styles/glow/glow.desktop new file mode 100644 index 00000000..6db539eb --- /dev/null +++ b/kwin-styles/glow/glow.desktop @@ -0,0 +1,49 @@ +[Desktop Entry] +Name=Glow +Name[af]=Gloei +Name[br]=Lufrus +Name[ca]=Lluïssor +Name[cs]=Záře +Name[cy]=Gwrid +Name[da]=Glød +Name[el]=Λάμψη +Name[es]=Brillo +Name[et]=Helendus +Name[eu]=Dirdira +Name[fa]=درخشندگی +Name[fi]=Hehku +Name[fr]=Lueur +Name[fy]=Gloede +Name[hi]=ग्लो +Name[is]=Glóð +Name[it]=Bagliore +Name[ja]=輝き +Name[ka]=გავარვარება +Name[lt]=Švytėjimas +Name[lv]=Kvēlot +Name[mk]=Отсјај +Name[ms]=Kilau +Name[mt]=Dija +Name[nb]=Glød +Name[ne]=चमक +Name[nl]=Gloed +Name[nn]=Glød +Name[pl]=Blask +Name[ro]=Licărire +Name[ru]=Зарево +Name[sk]=Plameň +Name[sl]=Lesk +Name[sr]=Сијање +Name[sr@Latn]=Sijanje +Name[sv]=Glöd +Name[ta]=ஒளிப்பெற்று +Name[tg]=Шафақ +Name[th]=เรืองแสง +Name[tr]=Parlama +Name[uk]=Заграва +Name[ven]=Tshedza +Name[vi]=Hào quang +Name[xh]=Qukuqela +Name[zh_CN]=光芒 +Name[zu]=Khanya +X-KDE-Library=kwin3_glow diff --git a/kwin-styles/glow/glowbutton.cpp b/kwin-styles/glow/glowbutton.cpp new file mode 100644 index 00000000..41f53386 --- /dev/null +++ b/kwin-styles/glow/glowbutton.cpp @@ -0,0 +1,339 @@ +/*************************************************************************** + glowbutton.cpp - description + ------------------- + begin : Thu Sep 6 2001 + copyright : (C) 2001 by Henning Burchardt + email : h_burchardt@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <math.h> +#include <iostream> +#include <vector> +#include <qmap.h> +#include <qpixmap.h> +#include <qpixmapcache.h> +#include <qbitmap.h> +#include <qpainter.h> +#include <qimage.h> +#include <qtimer.h> +#include <qtooltip.h> +#include <kdecoration.h> +#include <kiconeffect.h> +#include "glowbutton.h" + +namespace Glow +{ + +//----------------------------------------------------------------------------- +// PixmapCache +//----------------------------------------------------------------------------- + +QMap<QString, const QPixmap*> PixmapCache::m_pixmapMap; + +const QPixmap* PixmapCache::find(const QString& key) +{ + QMap<QString, const QPixmap*>::const_iterator it = + m_pixmapMap.find(key); + if( it != m_pixmapMap.end() ) + return *it; + else + return 0; +} + +void PixmapCache::insert(const QString& key, const QPixmap *pixmap) +{ + m_pixmapMap[key] = pixmap; +} + +void PixmapCache::erase(const QString& key) +{ + QMap<QString, const QPixmap*>::iterator it = + m_pixmapMap.find(key); + if (it != m_pixmapMap.end()) + { + delete *it; + m_pixmapMap.erase(it); + } +} + +void PixmapCache::clear() +{ + // delete all pixmaps in the cache + QMap<QString, const QPixmap*>::const_iterator it + = m_pixmapMap.begin(); + for(; it != m_pixmapMap.end(); ++it) + delete *it; + m_pixmapMap.clear(); +} + +//----------------------------------------------------------------------------- +// GlowButton +//----------------------------------------------------------------------------- + +GlowButton::GlowButton(QWidget *parent, const char *name, + const QString& tip, const int realizeBtns) + : QButton(parent, name) +{ + m_realizeButtons = realizeBtns; + + _steps = 0; + m_updateTime = 50; + m_pixmapName = QString::null; + + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); + m_pos = 0; + m_timerStatus = Stop; + + setTipText (tip); + setCursor(arrowCursor); +} + +GlowButton::~GlowButton() +{ +} + +void GlowButton::setTipText( const QString& tip ) +{ + if (KDecoration::options()->showTooltips()) + { + QToolTip::remove( this ); + QToolTip::add( this, tip ); + } +} + +QString GlowButton::getPixmapName() const +{ + return m_pixmapName; +} + +Qt::ButtonState GlowButton::lastButton() const +{ + return _last_button; +} + +void GlowButton::setPixmapName(const QString& pixmapName) +{ + m_pixmapName = pixmapName; + + const QPixmap *pixmap = PixmapCache::find(pixmapName); + if( ! pixmap ) + return; + + // set steps + _steps = pixmap->height()/pixmap->width() - 1; + + repaint(false); +} + +void GlowButton::paintEvent( QPaintEvent *e ) +{ + QWidget::paintEvent(e); + const QPixmap *pixmap = PixmapCache::find(m_pixmapName); + if( pixmap != 0 ) + { + int pos = m_pos>=0?m_pos:-m_pos; + QPainter p; + QPixmap pm (pixmap->size()); + p.begin(&pm); + const QPixmap * bg_pixmap = PixmapCache::find( + QString::number(parentWidget()->winId())); + p.drawPixmap (0, 0, *bg_pixmap, x(), y(), width(), height()); + p.drawPixmap (0, 0, *pixmap, 0, pos*height(), width(), height()); + p.end(); + p.begin(this); + p.drawPixmap (0, 0, pm); + p.end(); + } +} + +void GlowButton::enterEvent( QEvent *e ) +{ + if( m_pos<0 ) + m_pos=-m_pos; + m_timerStatus = Run; + if( ! m_timer->isActive() ) + m_timer->start(m_updateTime); + QButton::enterEvent(e); +} + +void GlowButton::leaveEvent( QEvent *e ) +{ + m_timerStatus = Stop; + if( ! m_timer->isActive() ) + m_timer->start(m_updateTime); + QButton::leaveEvent(e); +} + +void GlowButton::mousePressEvent( QMouseEvent *e ) +{ + _last_button = e->button(); + if( m_timer->isActive() ) + m_timer->stop(); + m_pos = _steps; + repaint(false); + // without pretending LeftButton, clicking on the button with MidButton + // or RightButton would cause unwanted titlebar action + QMouseEvent me (e->type(), e->pos(), e->globalPos(), + (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state()); + QButton::mousePressEvent(&me); +} + +void GlowButton::mouseReleaseEvent( QMouseEvent *e ) +{ + _last_button = e->button(); + QPoint p = mapToParent(mapFromGlobal(e->globalPos())); + if( ! m_timer->isActive() ) { + m_timer->start(m_updateTime); + } + if( ! geometry().contains(p) ) { + m_timerStatus = Stop; + } + QMouseEvent me (e->type(), e->pos(), e->globalPos(), + (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state()); + QButton::mouseReleaseEvent(&me); +} + +void GlowButton::slotTimeout() +{ + repaint(false); + + if( m_pos>=_steps-1 ) { + m_pos = -m_pos; + } + if( m_timerStatus==Stop ) { + if( m_pos==0 ) { + m_timer->stop(); + return; + } else if( m_pos>0 ) { + m_pos = -m_pos; + } + } + + m_pos++; +} + +//----------------------------------------------------------------------------- +// GlowButtonFactory +//----------------------------------------------------------------------------- + +GlowButtonFactory::GlowButtonFactory() +{ + _steps = 20; +} + +int GlowButtonFactory::getSteps() +{ + return _steps; +} + +void GlowButtonFactory::setSteps(int steps) +{ + _steps = steps; +} + +QPixmap * GlowButtonFactory::createGlowButtonPixmap( + const QImage & bg_image, + const QImage & fg_image, + const QImage & glow_image, + const QColor & color, + const QColor & glow_color) +{ + if (bg_image.size() != fg_image.size() + || fg_image.size() != glow_image.size()) { + std::cerr << "Image size error" << std::endl; + return new QPixmap(); + } + + QImage colorized_bg_image = bg_image.copy(); + KIconEffect::colorize (colorized_bg_image, color, 1.0); + + int w = colorized_bg_image.width(); + int h = colorized_bg_image.height(); + + QImage image (w, (_steps+1)*h, 32); + image.setAlphaBuffer (true); + for (int i=0; i<_steps+1; ++i) { + for (int y=0; y<h; ++y) { + uint * src1_line = (uint*) colorized_bg_image.scanLine (y); + uint * src2_line = (uint*) fg_image.scanLine (y); + uint * dst_line = (uint*) image.scanLine (i*h+y); + for (int x=0; x<w; ++x) { + int r = qRed (*(src1_line+x)); + int g = qGreen (*(src1_line+x)); + int b = qBlue (*(src1_line+x)); + int a = QMAX (qAlpha(*(src1_line+x)),qGray(*(src2_line+x))); + *(dst_line+x) = qRgba (r, g, b, a); + } + } + } + QPixmap * pixmap = new QPixmap (image); + QPainter painter (pixmap); + + bool dark = (qGray(color.rgb()) <= 127); + QImage fg_img (w, h, 32); + fg_img.setAlphaBuffer (true); + for (int y=0; y<h; ++y) { + uint * src_line = (uint*) fg_image.scanLine (y); + uint * dst_line = (uint*) fg_img.scanLine (y); + for (int x=0; x<w; ++x) { + int alpha = qGray (*(src_line+x)); + if (dark) + *(dst_line+x) = qRgba (255, 255, 255, alpha); + else + *(dst_line+x) = qRgba (0, 0, 0, alpha); + } + } + + int r = glow_color.red(); + int g = glow_color.green(); + int b = glow_color.blue(); + QImage glow_img (w, h, 32); + glow_img.setAlphaBuffer (true); + for (int i=0; i<_steps; ++i) { + painter.drawImage (0, i*h, fg_img); + for (int y=0; y<h; ++y) { + uint * src_line = (uint*) glow_image.scanLine(y); + uint * dst_line = (uint*) glow_img.scanLine(y); + for (int x=0; x<w; ++x) { + int alpha = + (int) (qGray (*(src_line+x)) * ((double) i/_steps)); + *(dst_line+x) = qRgba (r, g, b, alpha); + } + } + painter.drawImage (0, i*h, glow_img); + } + painter.drawImage (0, _steps*h, fg_img); + for (int y=0; y<h; ++y) { + uint * src_line = (uint*) glow_image.scanLine (y); + uint * dst_line = (uint*) glow_img.scanLine (y); + for (int x=0; x<w; ++x) { + int alpha = qGray (*(src_line+x)); + *(dst_line+x) = qRgba (r, g, b, alpha); + } + } + painter.drawImage (0, _steps*h, glow_img); + + return pixmap; +} + +GlowButton* GlowButtonFactory::createGlowButton( + QWidget *parent, const char* name, const QString& tip, const int realizeBtns) +{ + GlowButton *glowButton = new GlowButton(parent, name, tip, realizeBtns); + return glowButton; +} + +} + +#include "glowbutton.moc" + diff --git a/kwin-styles/glow/glowbutton.h b/kwin-styles/glow/glowbutton.h new file mode 100644 index 00000000..3d4f5e1d --- /dev/null +++ b/kwin-styles/glow/glowbutton.h @@ -0,0 +1,128 @@ +/*************************************************************************** + glowbutton.h - description + ------------------- + begin : Thu Sep 14 2001 + copyright : (C) 2001 by Henning Burchardt + email : h_burchardt@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef GLOW_BUTTON_H +#define GLOW_BUTTON_H + +#include <vector> +#include <qmap.h> +#include <qbutton.h> + +class QPixmap; +class QBitmap; +class QTimer; +class QString; + +namespace Glow +{ + +class PixmapCache +{ +public: + static const QPixmap* find(const QString& key); + static void insert(const QString& key, const QPixmap *pixmap); + static void erase(const QString& key); + static void clear(); +private: + static QMap<QString, const QPixmap*> m_pixmapMap; +}; + + +//----------------------------------------------------------------------------- + +class GlowButton : public QButton +{ + Q_OBJECT + +public: + GlowButton(QWidget *parent, const char* name, const QString& tip, const int realizeBtns); + ~GlowButton(); + + void setTipText( const QString& tip ); + + QString getPixmapName() const; + ButtonState lastButton() const; + + /** Sets the name of the pixmap in the pixmap cache. + * If no background pixmap is wanted use QString::null as name. */ + void setPixmapName(const QString& pixmapName); + +protected: + virtual void paintEvent( QPaintEvent * ); + virtual void enterEvent( QEvent * ); + virtual void leaveEvent( QEvent * ); + virtual void mousePressEvent( QMouseEvent * ); + virtual void mouseReleaseEvent( QMouseEvent * ); + +protected slots: + void slotTimeout(); + +private: + enum TimerStatus { Run, Stop }; + + int m_updateTime; + int _steps; + QString m_pixmapName; + + QTimer *m_timer; + int m_pos; + TimerStatus m_timerStatus; + + int m_realizeButtons; + ButtonState _last_button; +}; + +//----------------------------------------------------------------------------- + +class GlowButtonFactory +{ +public: + GlowButtonFactory(); + + int getSteps(); + + /** + * Sets the number of pixmaps used to create the glow effect of the + * glow buttons. + */ + void setSteps(int steps); + + /** + * Creates a background pixmap for a glow button. + * The pixmap will consist of sub pixmaps of the size of the button which + * are placed one below the other. Each sub pixmap is copied on the button + * in succession to create the glow effect. The last sub pixmap is used + * when the button is pressed. + */ + QPixmap * createGlowButtonPixmap( + const QImage & bg_image, +// const QImage & bg_alpha_image, + const QImage & fg_image, + const QImage & glow_image, + const QColor & color, + const QColor & glow_color); + + GlowButton* createGlowButton( + QWidget *parent, const char* name, const QString& tip, const int realizeBtns = Qt::LeftButton); + +private: + int _steps; +}; + +} // namespace + +#endif diff --git a/kwin-styles/glow/glowclient.cpp b/kwin-styles/glow/glowclient.cpp new file mode 100644 index 00000000..ed13f480 --- /dev/null +++ b/kwin-styles/glow/glowclient.cpp @@ -0,0 +1,902 @@ +/*************************************************************************** + glowclient.cpp - description + ------------------- + begin : Thu Sep 6 2001 + copyright : (C) 2001 by Henning Burchardt + email : h_burchardt@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <qapplication.h> +#include <qbitmap.h> +#include <qimage.h> +#include <qlayout.h> +#include <qpainter.h> +#include <qpixmap.h> +#include <kconfig.h> +#include <kdebug.h> +#include <klocale.h> +#include <kpixmapeffect.h> +#include <kpixmap.h> +#include <kstandarddirs.h> +#include <qlabel.h> +#include "resources.h" +#include "glowclient.h" +#include "glowbutton.h" + +namespace Glow +{ + +static int titleHeight; +static int SIDE_MARGIN; +static int BOTTOM_MARGIN; +static const int TITLE_MARGIN = 2; +static const int TITLE_SPACING = 1; +static int RESIZE_HANDLE_HEIGHT; + +//----------------------------------------------------------------------------- + +GlowClientConfig::GlowClientConfig() +{ + themeName = "default"; +} + +void GlowClientConfig::load(KDecorationFactory *factory) +{ + KConfig conf("kwinglowrc"); + conf.setGroup("General"); + + const QColor defaultCloseButtonColor(DEFAULT_CLOSE_BUTTON_COLOR); + const QColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR); + const QColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR); + const QColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR); + const QColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR); + + stickyButtonGlowColor = conf.readColorEntry( + "stickyButtonGlowColor", &defaultStickyButtonColor); + + helpButtonGlowColor = conf.readColorEntry( + "helpButtonGlowColor", &defaultHelpButtonColor); + + iconifyButtonGlowColor = conf.readColorEntry( + "iconifyButtonGlowColor", &defaultIconifyButtonColor); + + maximizeButtonGlowColor = conf.readColorEntry( + "maximizeButtonGlowColor", &defaultMaximizeButtonColor); + + closeButtonGlowColor = conf.readColorEntry( + "closeButtonGlowColor", &defaultCloseButtonColor); + + showResizeHandle = conf.readBoolEntry("showResizeHandle", true); + titlebarGradientType = conf.readNumEntry("titlebarGradientType", + KPixmapEffect::DiagonalGradient); + + themeName = conf.readEntry ("themeName", "default"); + + switch(KDecoration::options()->preferredBorderSize (factory)) { + case KDecoration::BorderLarge: + SIDE_MARGIN = 8; + BOTTOM_MARGIN = 6; + RESIZE_HANDLE_HEIGHT = 10; + break; + case KDecoration::BorderVeryLarge: + SIDE_MARGIN = 12; + BOTTOM_MARGIN = 12; + RESIZE_HANDLE_HEIGHT = 18; + break; + case KDecoration::BorderHuge: + SIDE_MARGIN = 18; + BOTTOM_MARGIN = 18; + RESIZE_HANDLE_HEIGHT = 27; + break; + case KDecoration::BorderVeryHuge: + SIDE_MARGIN = 27; + BOTTOM_MARGIN = 27; + RESIZE_HANDLE_HEIGHT = 40; + break; + case KDecoration::BorderOversized: + SIDE_MARGIN = 40; + BOTTOM_MARGIN = 40; + RESIZE_HANDLE_HEIGHT = 60; + break; + case KDecoration::BorderNormal: + default: + SIDE_MARGIN = 4; + BOTTOM_MARGIN = 2; + RESIZE_HANDLE_HEIGHT = 4; + } +} + +//----------------------------------------------------------------------------- + +GlowClientGlobals::~GlowClientGlobals() +{ + deletePixmaps(); + m_instance = 0; +} + +QString GlowClientGlobals::getPixmapName(PixmapType type, bool isActive) +{ + QString s = getPixmapTypeName(static_cast<PixmapType>(type)); + s += "|"; + s += isActive ? "Active" : "NotActive"; + return s; +} + +GlowClientGlobals::GlowClientGlobals() + : KDecorationFactory() +{ + _button_factory = new GlowButtonFactory(); + readConfig(); + readTheme (); + if (!createPixmaps()) + { + deletePixmaps(); + delete _theme; + config()->themeName = "default"; + readTheme(); + createPixmaps(); + } +} + +void GlowClientGlobals::readConfig() +{ + _config = new GlowClientConfig(); + _config->load(this); +} + +QValueList< GlowClientGlobals::BorderSize > +GlowClientGlobals::borderSizes() const +{ + // the list must be sorted + return QValueList< BorderSize >() << BorderNormal << + BorderLarge << BorderVeryLarge << BorderHuge << + BorderVeryHuge << BorderOversized; +} + +void GlowClientGlobals::readTheme() +{ + QString theme_config_file = KGlobal::dirs()->findResource ("data", + QString("kwin/glow-themes/") + config()->themeName + "/" + + config()->themeName + ".theme"); + if (theme_config_file.isNull()) + { + config()->themeName = "default"; + return; + } + + KConfig conf (theme_config_file); + _theme = new GlowTheme(default_glow_theme); + + _theme->buttonSize = conf.readSizeEntry ("buttonSize", + &_theme->buttonSize); + _theme->stickyOnPixmap = conf.readEntry ("stickyOnPixmap", + _theme->stickyOnPixmap); + _theme->stickyOffPixmap = conf.readEntry ("stickyOffPixmap", + _theme->stickyOffPixmap); + _theme->maximizeOnPixmap = conf.readEntry ("maximizeOnPixmap", + _theme->maximizeOnPixmap); + _theme->maximizeOffPixmap = conf.readEntry ("maximizeOffPixmap", + _theme->maximizeOffPixmap); + _theme->helpPixmap = conf.readEntry ("helpPixmap", + _theme->helpPixmap); + _theme->closePixmap = conf.readEntry ("closePixmap", + _theme->closePixmap); + _theme->iconifyPixmap = conf.readEntry ("iconifyPixmap", + _theme->iconifyPixmap); + _theme->stickyOnGlowPixmap = conf.readEntry ("stickyOnGlowPixmap", + _theme->stickyOnGlowPixmap); + _theme->stickyOffGlowPixmap = conf.readEntry ("stickyOffGlowPixmap", + _theme->stickyOffGlowPixmap); + _theme->maximizeOnGlowPixmap = conf.readEntry ("maximizeOnGlowPixmap", + _theme->maximizeOnGlowPixmap); + _theme->maximizeOffGlowPixmap = conf.readEntry ("maximizeOffGlowPixmap", + _theme->maximizeOffGlowPixmap); + _theme->helpGlowPixmap = conf.readEntry ("helpGlowPixmap", + _theme->helpGlowPixmap); + _theme->closeGlowPixmap = conf.readEntry ("closeGlowPixmap", + _theme->closeGlowPixmap); + _theme->iconifyGlowPixmap = conf.readEntry ("iconifyGlowPixmap", + _theme->iconifyGlowPixmap); + + titleHeight = QFontMetrics(KDecoration::options()->font(true)).height(); + if (titleHeight < SIDE_MARGIN) + titleHeight = SIDE_MARGIN; + if (titleHeight < _theme->buttonSize.height()) + titleHeight = _theme->buttonSize.height(); +} + +bool GlowClientGlobals::reset( unsigned long /*changed*/ ) +{ + deletePixmaps(); + delete _config; + readConfig(); + delete _theme; + readTheme (); + if (! createPixmaps()) + { + deletePixmaps(); + delete _theme; + _config->themeName = "default"; + readTheme(); + createPixmaps(); + } + return true; // FRAME +} + +bool GlowClientGlobals::supports( Ability ability ) +{ + switch( ability ) + { + case AbilityAnnounceButtons: + case AbilityButtonOnAllDesktops: + case AbilityButtonSpacer: + case AbilityButtonHelp: + case AbilityButtonMinimize: + case AbilityButtonMaximize: + case AbilityButtonClose: + return true; + default: + return false; + }; +} + +bool GlowClientGlobals::createPixmaps() +{ + for( int type=0; type<=Close; type++ ) { + if (! createPixmap(static_cast<PixmapType>(type), false)) + return false; + if (! createPixmap(static_cast<PixmapType>(type), true)) + return false; + } + + return true; +} + +void GlowClientGlobals::deletePixmaps() +{ + PixmapCache::clear(); +} + +const QString GlowClientGlobals::getPixmapTypeName(PixmapType type) +{ + switch(type) { + case (StickyOn): + return "StickyOn"; + case(StickyOff ): + return "StickyOff"; + case(Help): + return "Help"; + case(Iconify): + return "Iconify"; + case(MaximizeOn): + return "MaximizeOn"; + case(MaximizeOff): + return "MaximizeOff"; + case(Close): + return "Close"; + default: + return QString::null; + } +} + +bool GlowClientGlobals::createPixmap(PixmapType type, bool isActive) +{ + QString theme_dir = KGlobal::dirs()->findResource ("data", + QString("kwin/glow-themes/") + _config->themeName + "/"); + + QColor glow_color; + QColor color = options()->color(ColorButtonBg, isActive); + + QImage bg_image (theme_dir+_theme->backgroundPixmap); + QImage fg_image; + QImage glow_image; + + switch(type) { + case (StickyOn): + { + fg_image = QImage (theme_dir+_theme->stickyOnPixmap); + glow_image = QImage (theme_dir+_theme->stickyOnGlowPixmap); + glow_color = _config->stickyButtonGlowColor; + break; + } + case (StickyOff): + { + fg_image = QImage (theme_dir+_theme->stickyOffPixmap); + glow_image = QImage (theme_dir+_theme->stickyOffGlowPixmap); + glow_color = _config->stickyButtonGlowColor; + break; + } + case (Help): + { + fg_image = QImage (theme_dir+_theme->helpPixmap); + glow_image = QImage (theme_dir+_theme->helpGlowPixmap); + glow_color = _config->helpButtonGlowColor; + break; + } + case (Iconify): + { + fg_image = QImage (theme_dir+_theme->iconifyPixmap); + glow_image = QImage (theme_dir+_theme->iconifyGlowPixmap); + glow_color = _config->iconifyButtonGlowColor; + break; + } + case (MaximizeOn): + { + fg_image = QImage (theme_dir+_theme->maximizeOnPixmap); + glow_image = QImage (theme_dir+_theme->maximizeOnGlowPixmap); + glow_color = _config->maximizeButtonGlowColor; + break; + } + case (MaximizeOff): + { + fg_image = QImage (theme_dir+_theme->maximizeOffPixmap); + glow_image = QImage (theme_dir+_theme->maximizeOffGlowPixmap); + glow_color = _config->maximizeButtonGlowColor; + break; + } + case (Close): + { + fg_image = QImage (theme_dir+_theme->closePixmap); + glow_image = QImage (theme_dir+_theme->closeGlowPixmap); + glow_color = _config->closeButtonGlowColor; + break; + } + } + + if (bg_image.size() != _theme->buttonSize + || fg_image.size() != _theme->buttonSize + || glow_image.size() != _theme->buttonSize) + return false; + + QPixmap * glowPm = buttonFactory()->createGlowButtonPixmap( + bg_image, fg_image, glow_image, + color, glow_color); + if (glowPm->isNull()) + return false; + PixmapCache::insert(getPixmapName(type, isActive), glowPm); + return true; +} + +GlowClientGlobals *GlowClientGlobals::m_instance = 0; + +GlowClientGlobals *GlowClientGlobals::instance() +{ + if( ! m_instance ) + { + m_instance = new GlowClientGlobals(); + } + return m_instance; +} + +//----------------------------------------------------------------------------- + +GlowClient::GlowClient( KDecorationBridge* b, KDecorationFactory* f ) + : KDecoration( b, f ), + m_stickyButton(0), m_helpButton(0), m_minimizeButton(0), + m_maximizeButton(0), m_closeButton(0), + m_leftButtonLayout(0), m_rightButtonLayout(0), _main_layout(0) +{ +} + +void GlowClient::init() +{ + createMainWidget(WResizeNoErase | WStaticContents | WRepaintNoErase); + widget()->installEventFilter(this); + + createButtons(); + resetLayout(); +} + +GlowClient::~GlowClient() +{ + PixmapCache::erase(QString::number(widget()->winId())); +} + +void GlowClient::resizeEvent( QResizeEvent * ) +{ + doShape(); + widget()->repaint(false); +} + +void GlowClient::paintEvent( QPaintEvent * ) +{ + GlowClientConfig *conf = GlowClientGlobals::instance()->config(); + QRect r_this = widget()->rect(); + QRect r_title = _title_spacer->geometry(); + QColorGroup titleCg = options()->colorGroup(ColorTitleBar, isActive()); + QColorGroup titleBlendCg=options()->colorGroup(ColorTitleBlend, isActive()); + QColorGroup cg = widget()->colorGroup(); + QColor titleColor = options()->color(ColorTitleBar, isActive()); + QColor titleBlendColor = options()->color(ColorTitleBlend, isActive()); + QColor bgColor = widget()->colorGroup().background(); + QPainter p; + QPointArray pArray, pArray2, pArray3, pArray4; + + // pixmap for title bar + QSize tBSize(width(), r_title.height()); + QSize gradientPixmapSize (tBSize-QSize(3,3)); + if (! gradientPixmapSize.isValid()) + gradientPixmapSize = QSize(0,0); + KPixmap gradientPixmap(gradientPixmapSize); + if (! gradientPixmapSize.isNull()) + KPixmapEffect::gradient(gradientPixmap, titleColor, titleBlendColor, + (KPixmapEffect::GradientType) conf->titlebarGradientType); + + QPixmap * title_buffer = new QPixmap(tBSize); + p.begin(title_buffer); + if (! gradientPixmap.isNull()) + p.drawPixmap(2, 2, gradientPixmap); + + if (tBSize.width()>=3 && tBSize.height()>=3) + { + // draw caption + p.setFont(options()->font(isActive())); + p.setPen(options()->color(ColorFont, isActive())); + p.drawText(r_title.x(), 0, + r_title.width(), r_title.height(), + Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, caption()); + + // draw split color beneath buttons top right + pArray4 = QPointArray(4); + pArray4.setPoint(0, tBSize.width()-1, tBSize.height()/2-1); + pArray4.setPoint(1, r_title.x()+r_title.width()-1+tBSize.height()/2, + tBSize.height()/2-1); + pArray4.setPoint(2, r_title.x()+r_title.width()-1, tBSize.height()); + pArray4.setPoint(3, tBSize.width()-1, tBSize.height()); + p.setPen(Qt::NoPen); + p.setBrush(bgColor); + p.drawPolygon(pArray4); + + // draw borders + pArray = QPointArray(3); + pArray.setPoint(0, tBSize.width()-1, tBSize.height()/2-1); + pArray.setPoint(1, r_title.x()+r_title.width()-1+tBSize.height()/2, + tBSize.height()/2-1); + pArray.setPoint(2, r_title.x()+r_title.width()-1, tBSize.height()-1); + p.setPen(titleCg.mid()); + p.drawPolyline(pArray); + p.drawLine (0, tBSize.height()-1, r_title.x()+r_title.width()-1, tBSize.height()-1); + + pArray2 = QPointArray(3); + pArray2.setPoint(0, 1, tBSize.height()-2); + pArray2.setPoint(1, 1, 1); + pArray2.setPoint(2, tBSize.width()-2, 1); + p.setPen(titleCg.light()); + p.drawPolyline(pArray2); + } + + pArray3 = QPointArray(4); + pArray3.setPoint(0, 0, tBSize.height()-1); + pArray3.setPoint(1, 0, 0); + pArray3.setPoint(2, tBSize.width()-1, 0); + pArray3.setPoint(3, tBSize.width()-1, tBSize.height()-1); + p.setPen(Qt::black); + p.drawPolyline(pArray3); + p.end(); + + // insert title buffer in cache; before that, remove old buffer + PixmapCache::erase(QString::number(widget()->winId())); + PixmapCache::insert(QString::number(widget()->winId()), title_buffer); + + bitBlt(widget(), 0, 0, title_buffer); + for (unsigned int i=0; i<m_buttonList.size(); ++i) + m_buttonList[i]->repaint(false); + + p.begin(widget()); + p.setPen(Qt::black); + //----- + // draw borders + p.drawLine(0,tBSize.height(),0,r_this.height()-1); + p.drawLine(0,r_this.height()-1,r_this.width()-1,r_this.height()-1); + p.drawLine(r_this.width()-1,r_this.height()-1, + r_this.width()-1,tBSize.height()/2); + //----- + // fill content widget + p.fillRect(1, tBSize.height(), + r_this.width()-2, r_this.height()-tBSize.height()-1, + options()->colorGroup(ColorFrame, isActive()).background()); + p.end(); + + // paint resize handle if necessary + if(conf->showResizeHandle && isResizable() && ! isShade() + && width()>=2 && height() >= RESIZE_HANDLE_HEIGHT) + { + p.begin(widget()); + p.setPen (Qt::black); + p.drawLine (1, height() - RESIZE_HANDLE_HEIGHT, + width()-2, height() - RESIZE_HANDLE_HEIGHT); + p.end(); + } +} + +void GlowClient::showEvent( QShowEvent * ) +{ + doShape(); + widget()->repaint(false); +} + +void GlowClient::mouseDoubleClickEvent( QMouseEvent *e ) +{ + if(e->button() == LeftButton && _title_spacer->geometry().contains(e->pos())) + titlebarDblClickOperation(); +} + +void GlowClient::wheelEvent( QWheelEvent *e ) +{ + if (isSetShade() || QRect( 0, 0, width(), titleHeight ).contains(e->pos())) + titlebarMouseWheelOperation( e->delta()); +} + +void GlowClient::activeChange() +{ + updateButtonPixmaps(); + widget()->repaint(false); +} + +void GlowClient::iconChange() +{ + // we have no (t yet an) icon button, so do nothing +} + +void GlowClient::shadeChange() +{ +} + +void GlowClient::captionChange() +{ + widget()->update(_title_spacer->geometry()); +} + +QSize GlowClient::minimumSize() const +{ + return widget()->minimumSize(); +} + +void GlowClient::resize( const QSize& s ) +{ + widget()->resize( s ); +} + +void GlowClient::borders( int& left, int& right, int& top, int& bottom ) const +{ + left = right = SIDE_MARGIN; + top = titleHeight + TITLE_MARGIN + 1; + if (GlowClientGlobals::instance()->config()->showResizeHandle + && isResizable()) + bottom = RESIZE_HANDLE_HEIGHT; + else + bottom = BOTTOM_MARGIN; +} + +void GlowClient::desktopChange() +{ + if (isOnAllDesktops()) { + m_stickyButton->setPixmapName( + GlowClientGlobals::instance()->getPixmapName( + GlowClientGlobals::StickyOn, isActive())); + m_stickyButton->setTipText(i18n("Not on all desktops")); + } else { + m_stickyButton->setPixmapName( + GlowClientGlobals::instance()->getPixmapName( + GlowClientGlobals::StickyOff, isActive())); + m_stickyButton->setTipText(i18n("On all desktops")); + } +} + +void GlowClient::maximizeChange() +{ + if (maximizeMode() == MaximizeFull) { + m_maximizeButton->setPixmapName( + GlowClientGlobals::instance()->getPixmapName( + GlowClientGlobals::MaximizeOn, isActive())); + m_maximizeButton->setTipText(i18n("Restore")); + } else { + m_maximizeButton->setPixmapName( + GlowClientGlobals::instance()->getPixmapName( + GlowClientGlobals::MaximizeOff, isActive())); + m_maximizeButton->setTipText(i18n("Maximize")); + } +} + +KDecoration::Position GlowClient::mousePosition(const QPoint &pos) const +{ + Position m = PositionCenter; + + int bottomSize + = (GlowClientGlobals::instance()->config()->showResizeHandle) + ? RESIZE_HANDLE_HEIGHT : BOTTOM_MARGIN; + + const int range = 14 + 3*SIDE_MARGIN/2; + + if ( ( pos.x() > SIDE_MARGIN && pos.x() < width() - SIDE_MARGIN ) + && ( pos.y() > 4 && pos.y() < height() - bottomSize ) ) + m = PositionCenter; + else if ( pos.y() <= range && pos.x() <= range) + m = PositionTopLeft; + else if ( pos.y() >= height()-range && pos.x() >= width()-range) + m = PositionBottomRight; + else if ( pos.y() >= height()-range && pos.x() <= range) + m = PositionBottomLeft; + else if ( pos.y() <= range && pos.x() >= width()-range) + m = PositionTopRight; + else if ( pos.y() <= 4 ) + m = PositionTop; + else if ( pos.y() >= height()-bottomSize ) + m = PositionBottom; + else if ( pos.x() <= SIDE_MARGIN ) + m = PositionLeft; + else if ( pos.x() >= width()-SIDE_MARGIN ) + m = PositionRight; + else + m = PositionCenter; + + return m; +} + +void GlowClient::createButtons() +{ + GlowClientGlobals *globals = GlowClientGlobals::instance(); + GlowButtonFactory *factory = globals->buttonFactory(); + QSize size = globals->theme()->buttonSize; + + m_stickyButton = factory->createGlowButton(widget(), + "StickyButton", isOnAllDesktops()?i18n("Not on all desktops"):i18n("On all desktops"), LeftButton|RightButton); + m_stickyButton->setFixedSize(size); + connect(m_stickyButton, SIGNAL(clicked()), this, SLOT(toggleOnAllDesktops())); + m_buttonList.insert(m_buttonList.end(), m_stickyButton); + + m_helpButton = factory->createGlowButton(widget(), + "HelpButton", i18n("Help")); + m_helpButton->setFixedSize(size); + connect(m_helpButton, SIGNAL(clicked()), this, SLOT(showContextHelp())); + m_buttonList.insert(m_buttonList.end(), m_helpButton); + + m_minimizeButton = factory->createGlowButton(widget(), + "IconifyButton", i18n("Minimize")); + m_minimizeButton->setFixedSize(size); + connect(m_minimizeButton, SIGNAL(clicked()), this, SLOT(minimize())); + m_buttonList.insert(m_buttonList.end(), m_minimizeButton); + + m_maximizeButton=factory->createGlowButton(widget(), + "MaximizeButton", i18n("Maximize"), LeftButton|MidButton|RightButton); + m_maximizeButton->setFixedSize(size); + connect(m_maximizeButton, SIGNAL(clicked()), this, SLOT(slotMaximize())); + m_buttonList.insert(m_buttonList.end(), m_maximizeButton); + + m_closeButton = factory->createGlowButton(widget(), + "CloseButton", i18n("Close")); + m_closeButton->setFixedSize(size); + connect(m_closeButton, SIGNAL(clicked()), this, SLOT(closeWindow())); + m_buttonList.insert(m_buttonList.end(), m_closeButton); +} + +void GlowClient::resetLayout() +{ + _main_layout = new QVBoxLayout(widget(), 0, 0); + _main_layout->setResizeMode (QLayout::FreeResize); + + // update button positions and colors + updateButtonPositions(); + updateButtonPixmaps(); + + QBoxLayout * topLayout = new QBoxLayout(_main_layout, + QBoxLayout::LeftToRight, 0, 0); + topLayout->setMargin(0); + topLayout->setSpacing(TITLE_SPACING); + topLayout->addSpacing(SIDE_MARGIN); + QVBoxLayout *outerLeftLayout = new QVBoxLayout(topLayout); + outerLeftLayout->addSpacing(TITLE_MARGIN); + outerLeftLayout->addItem(m_leftButtonLayout); + outerLeftLayout->addSpacing(1); + topLayout->addSpacing(SIDE_MARGIN); + + _title_spacer = new QSpacerItem(0, titleHeight + TITLE_MARGIN + 1, + QSizePolicy::Expanding, QSizePolicy::Fixed); + topLayout->addItem(_title_spacer); + + topLayout->addSpacing(SIDE_MARGIN); + QVBoxLayout *outerRightLayout = new QVBoxLayout(topLayout); + outerRightLayout->addSpacing(TITLE_MARGIN); + outerRightLayout->addItem(m_rightButtonLayout); + outerRightLayout->addSpacing(1); + topLayout->addSpacing(SIDE_MARGIN); + + QBoxLayout *midLayout = new QBoxLayout( + _main_layout, QBoxLayout::LeftToRight, 0, 0); + midLayout->addSpacing(SIDE_MARGIN); + if(isPreview()) + midLayout->addWidget( + new QLabel( i18n( "<b><center>Glow preview</center></b>" ), widget())); + else + midLayout->addItem( new QSpacerItem( 0, 0 )); + midLayout->addSpacing(SIDE_MARGIN); + + if(GlowClientGlobals::instance()->config()->showResizeHandle + && isResizable() ) { + _bottom_spacer = new QSpacerItem(SIDE_MARGIN*2, + RESIZE_HANDLE_HEIGHT, QSizePolicy::Expanding, QSizePolicy::Minimum); + } else { + _bottom_spacer = new QSpacerItem(SIDE_MARGIN*2, + BOTTOM_MARGIN, QSizePolicy::Expanding, QSizePolicy::Minimum); + } + _main_layout->addItem (_bottom_spacer); + _main_layout->setStretchFactor(topLayout, 0); + _main_layout->setStretchFactor(midLayout, 1); +} + +void GlowClient::updateButtonPositions() +{ + QString buttons = options()->titleButtonsLeft() + "|" + + options()->titleButtonsRight(); + bool leftButtons=true; + + // hide all buttons + for( unsigned int i=0; i<m_buttonList.size(); i++ ) + m_buttonList[i]->hide(); + + m_leftButtonList.clear(); + m_rightButtonList.clear(); + + // reset left and right button layout + if(m_leftButtonLayout) + delete m_leftButtonLayout; + m_leftButtonLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); + m_leftButtonLayout->setMargin(0); + m_leftButtonLayout->setSpacing(TITLE_SPACING); + if(m_rightButtonLayout) + delete m_rightButtonLayout; + m_rightButtonLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); + m_rightButtonLayout->setMargin(0); + m_rightButtonLayout->setSpacing(TITLE_SPACING); + + for( unsigned int i=0; i<buttons.length(); i++ ) + { + char c = buttons[i].latin1(); + GlowButton *button = 0; + if( c=='S' ) // sticky + button = m_stickyButton; + else if( c=='H' && providesContextHelp() ) // help + button = m_helpButton; + else if( c=='I' && isMinimizable() ) // iconify + button = m_minimizeButton; + else if( c=='A' && isMaximizable() ) // maximize + button = m_maximizeButton; + else if( c=='X' && isCloseable() ) // close + button= m_closeButton; + else if( c=='_' ) // spacer item + { + if(leftButtons) + m_leftButtonLayout->addSpacing(4); + else + m_rightButtonLayout->addSpacing(4); + } + else if( c=='|' ) + leftButtons = false; + + if (button) { + button->show(); // show visible buttons + if (leftButtons) { + m_leftButtonList.insert(m_leftButtonList.end(), button); + m_leftButtonLayout->addWidget(button); + } else { + m_rightButtonList.insert(m_rightButtonList.end(), button); + m_rightButtonLayout->addWidget(button); + } + } + } +} + +void GlowClient::updateButtonPixmaps() +{ + GlowClientGlobals *globals = GlowClientGlobals::instance(); + + if ( isOnAllDesktops() ) { + m_stickyButton->setPixmapName(globals->getPixmapName( + GlowClientGlobals::StickyOn, isActive())); + } else { + m_stickyButton->setPixmapName(globals->getPixmapName( + GlowClientGlobals::StickyOff, isActive())); + } + m_helpButton->setPixmapName(globals->getPixmapName( + GlowClientGlobals::Help, isActive())); + + m_minimizeButton->setPixmapName(globals->getPixmapName( + GlowClientGlobals::Iconify, isActive())); + + if ( maximizeMode() == MaximizeFull ) { + m_maximizeButton->setPixmapName(globals->getPixmapName( + GlowClientGlobals::MaximizeOn, isActive())); + } else { + m_maximizeButton->setPixmapName(globals->getPixmapName( + GlowClientGlobals::MaximizeOff, isActive())); + } + m_closeButton->setPixmapName(globals->getPixmapName( + GlowClientGlobals::Close, isActive())); +} + +void GlowClient::doShape() +{ + QRegion mask(widget()->rect()); + // edges + + mask -= QRegion(width()-1,0,1,1); + mask -= QRegion(0,height()-1,1,1); + mask -= QRegion(width()-1,height()-1,1,1); + setMask(mask); +} + +bool GlowClient::isLeft(GlowButton *button) +{ + for( unsigned int i=0; i<m_leftButtonList.size(); i++ ) + if( m_leftButtonList[i] == button ) + return true; + return false; +} + +bool GlowClient::isRight(GlowButton *button) +{ + for( unsigned int i=0; i<m_rightButtonList.size(); i++ ) + if( m_rightButtonList[i] == button ) + return true; + return false; +} + +void GlowClient::slotMaximize() +{ + maximize(m_maximizeButton->lastButton()); +} + +bool GlowClient::eventFilter( QObject* o, QEvent* e ) +{ + if( o != widget()) + return false; + switch( e->type()) + { + case QEvent::Resize: + resizeEvent( static_cast< QResizeEvent* >( e )); + return true; + case QEvent::Paint: + paintEvent( static_cast< QPaintEvent* >( e )); + return true; + case QEvent::MouseButtonDblClick: + mouseDoubleClickEvent( static_cast< QMouseEvent* >( e )); + return true; + case QEvent::MouseButtonPress: + processMousePressEvent( static_cast< QMouseEvent* >( e )); + return true; + case QEvent::Show: + showEvent( static_cast< QShowEvent* >( e )); + return true; + case QEvent::Wheel: + wheelEvent( static_cast< QWheelEvent* >( e )); + return true; + default: + break; + } + return false; +} + +KDecoration* GlowClientGlobals::createDecoration( KDecorationBridge* bridge ) +{ + return new GlowClient( bridge, this ); +} + +} // end of namespace + +extern "C" +KDE_EXPORT KDecorationFactory* create_factory() +{ + return Glow::GlowClientGlobals::instance(); +} + +#include "glowclient.moc" + diff --git a/kwin-styles/glow/glowclient.h b/kwin-styles/glow/glowclient.h new file mode 100644 index 00000000..9de73126 --- /dev/null +++ b/kwin-styles/glow/glowclient.h @@ -0,0 +1,205 @@ +/*************************************************************************** + glowclient.h - description + ------------------- + begin : Thu Sep 6 2001 + copyright : (C) 2001 by Henning Burchardt + email : h_burchardt@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef GLOW_CLIENT_H +#define GLOW_CLIENT_H + +#include <vector> +#include <map> +#include <kdecoration.h> +#include <kdecorationfactory.h> + +class QPixmap; +class QBitmap; +class QTimer; +class QBoxLayout; +class QGridLayout; +class QVBoxLayout; +class QSpacerItem; + +namespace Glow +{ + +class GlowButton; +class GlowButtonFactory; + +//----------------------------------------------------------------------------- +// GlowTheme +//----------------------------------------------------------------------------- + +struct GlowTheme +{ + QSize buttonSize; + + QString backgroundPixmap; + QString backgroundAlphaPixmap; + + QString stickyOnPixmap; + QString stickyOffPixmap; + QString maximizeOnPixmap; + QString maximizeOffPixmap; + QString helpPixmap; + QString closePixmap; + QString iconifyPixmap; + + QString stickyOnGlowPixmap; + QString stickyOffGlowPixmap; + QString maximizeOnGlowPixmap; + QString maximizeOffGlowPixmap; + QString helpGlowPixmap; + QString closeGlowPixmap; + QString iconifyGlowPixmap; +}; + +static GlowTheme default_glow_theme = { + QSize (17, 17), + "background.png", "background_alpha.png", + "stickyon.png", "stickyoff.png", + "maximizeon.png", "maximizeoff.png", + "help.png", "close.png", "iconify.png", + "stickyon_glow.png", "stickyoff_glow.png", + "maximizeon_glow.png", "maximizeoff_glow.png", + "help_glow.png", "close_glow.png", "iconify_glow.png" }; + +//----------------------------------------------------------------------------- +// GlowClientConfig +//----------------------------------------------------------------------------- + +class GlowClientConfig +{ +public: + GlowClientConfig(); + + void load (KDecorationFactory *factory); + + QColor stickyButtonGlowColor; + QColor helpButtonGlowColor; + QColor iconifyButtonGlowColor; + QColor maximizeButtonGlowColor; + QColor closeButtonGlowColor; + bool showResizeHandle; + int titlebarGradientType; + QString themeName; +}; + +//----------------------------------------------------------------------------- +// GlowClientGlobals +//----------------------------------------------------------------------------- + +class GlowClientGlobals : public KDecorationFactory +{ +public: + enum PixmapType { StickyOn, StickyOff, Help, Iconify, MaximizeOn, + MaximizeOff, Close }; + + static GlowClientGlobals *instance(); + + ~GlowClientGlobals(); + + virtual KDecoration* createDecoration( KDecorationBridge* b ); + virtual bool reset( unsigned long changed ); + virtual bool supports( Ability ability ); + QValueList< GlowClientGlobals::BorderSize > borderSizes() const; + + QString getPixmapName(PixmapType type, bool isActive); + + GlowTheme * theme() const { return _theme; } + GlowClientConfig * config() const { return _config; } + GlowButtonFactory * buttonFactory() { return _button_factory; } + +private: + static GlowClientGlobals *m_instance; + + GlowTheme * _theme; + GlowClientConfig * _config; + GlowButtonFactory * _button_factory; + + GlowClientGlobals(); + void readConfig(); + void readTheme (); + bool createPixmaps(); + void deletePixmaps(); + bool createPixmap(PixmapType type,bool isActive); + const QString getPixmapTypeName(PixmapType type); +}; + +//----------------------------------------------------------------------------- +// GlowClient +//----------------------------------------------------------------------------- + +class GlowClient : public KDecoration +{ + Q_OBJECT +public: + GlowClient( KDecorationBridge* b, KDecorationFactory* f ); + ~GlowClient(); + + virtual void init(); + virtual void borders( int&, int&, int&, int& ) const; + virtual void resize( const QSize& ); + virtual QSize minimumSize() const; + +protected: + virtual void resizeEvent( QResizeEvent * ); + virtual void paintEvent( QPaintEvent * ); + virtual void showEvent( QShowEvent * ); + virtual void mouseDoubleClickEvent( QMouseEvent * ); + virtual void wheelEvent( QWheelEvent * ); + virtual void maximizeChange(); + virtual void activeChange(); + virtual void iconChange(); + virtual void desktopChange(); + virtual void shadeChange(); + virtual void captionChange(); + virtual Position mousePosition(const QPoint &) const; + virtual bool eventFilter( QObject* o, QEvent* e ); + +private: + std::vector<GlowButton*> m_buttonList; + std::vector<GlowButton*> m_leftButtonList; + std::vector<GlowButton*> m_rightButtonList; + GlowButton *m_stickyButton; + GlowButton *m_helpButton; + GlowButton *m_minimizeButton; + GlowButton *m_maximizeButton; + GlowButton *m_closeButton; + QBoxLayout *m_leftButtonLayout; + QBoxLayout *m_rightButtonLayout; + QSpacerItem * _bottom_spacer; + QSpacerItem * _title_spacer; + QVBoxLayout * _main_layout; + + void createButtons(); + void updateButtonPositions(); + /** + * Before this method is called we have to update the button + * positions with updateButtonPositions() because the pixmaps + * depend on the position + */ + void updateButtonPixmaps(); + void resetLayout(); + void doShape(); + bool isLeft(GlowButton *button); + bool isRight(GlowButton *button); + +protected slots: + void slotMaximize(); +}; + +} // namespace + +#endif diff --git a/kwin-styles/glow/resources.h b/kwin-styles/glow/resources.h new file mode 100644 index 00000000..fa575aed --- /dev/null +++ b/kwin-styles/glow/resources.h @@ -0,0 +1,11 @@ +#ifndef RESOURCES_H +#define RESOURCES_H + +#define DEFAULT_CLOSE_BUTTON_COLOR Qt::red +#define DEFAULT_MAXIMIZE_BUTTON_COLOR Qt::yellow +#define DEFAULT_ICONIFY_BUTTON_COLOR Qt::green +#define DEFAULT_HELP_BUTTON_COLOR Qt::white +#define DEFAULT_STICKY_BUTTON_COLOR Qt::white + +#endif + diff --git a/kwin-styles/glow/themes/Makefile.am b/kwin-styles/glow/themes/Makefile.am new file mode 100644 index 00000000..ec2725a7 --- /dev/null +++ b/kwin-styles/glow/themes/Makefile.am @@ -0,0 +1 @@ +SUBDIRS=default glass square glass_large glass_verylarge glass_huge diff --git a/kwin-styles/glow/themes/default/Makefile.am b/kwin-styles/glow/themes/default/Makefile.am new file mode 100644 index 00000000..881b15d4 --- /dev/null +++ b/kwin-styles/glow/themes/default/Makefile.am @@ -0,0 +1,17 @@ +linkdir = $(kde_datadir)/kwin/glow-themes/default +link_DATA = \ +background.png \ +help.png help_glow.png \ +close.png close_glow.png \ +iconify.png iconify_glow.png \ +maximizeoff.png maximizeoff_glow.png \ +maximizeon.png maximizeon_glow.png \ +stickyon.png stickyon_glow.png \ +stickyoff.png stickyoff_glow.png \ +default.theme + +EXTRA_DIST = $(link_DATA) + +###KMAKE-start (don't edit or delete this block) + +###KMAKE-end diff --git a/kwin-styles/glow/themes/default/background.png b/kwin-styles/glow/themes/default/background.png Binary files differnew file mode 100644 index 00000000..3fcbcdf5 --- /dev/null +++ b/kwin-styles/glow/themes/default/background.png diff --git a/kwin-styles/glow/themes/default/close.png b/kwin-styles/glow/themes/default/close.png Binary files differnew file mode 100644 index 00000000..898a368a --- /dev/null +++ b/kwin-styles/glow/themes/default/close.png diff --git a/kwin-styles/glow/themes/default/close_glow.png b/kwin-styles/glow/themes/default/close_glow.png Binary files differnew file mode 100644 index 00000000..69b36e92 --- /dev/null +++ b/kwin-styles/glow/themes/default/close_glow.png diff --git a/kwin-styles/glow/themes/default/default.theme b/kwin-styles/glow/themes/default/default.theme new file mode 100644 index 00000000..26f00feb --- /dev/null +++ b/kwin-styles/glow/themes/default/default.theme @@ -0,0 +1,19 @@ +buttonSize=17,17 + +backgroundPixmap=background.png + +stickyOnPixmap=stickyon.png +stickyOffPixmap=stickyoff.png +maximizeOnPixmap=maximizeon.png +maximizeOffPixmap=maximizeoff.png +helpPixmap=help.png +closePixmap=close.png +iconifyPixmap=iconify.png + +stickyOnGlowPixmap=stickyon_glow.png +stickyOffGlowPixmap=stickyoff_glow.png +maximizeOnGlowPixmap=maximizeon_glow.png +maximizeOffGlowPixmap=maximizeoff_glow.png +helpGlowPixmap=help_glow.png +closeGlowPixmap=close_glow.png +iconifyGlowPixmap=iconify_glow.png diff --git a/kwin-styles/glow/themes/default/help.png b/kwin-styles/glow/themes/default/help.png Binary files differnew file mode 100644 index 00000000..c3ed65ee --- /dev/null +++ b/kwin-styles/glow/themes/default/help.png diff --git a/kwin-styles/glow/themes/default/help_glow.png b/kwin-styles/glow/themes/default/help_glow.png Binary files differnew file mode 100644 index 00000000..79a5006a --- /dev/null +++ b/kwin-styles/glow/themes/default/help_glow.png diff --git a/kwin-styles/glow/themes/default/iconify.png b/kwin-styles/glow/themes/default/iconify.png Binary files differnew file mode 100644 index 00000000..94fc6338 --- /dev/null +++ b/kwin-styles/glow/themes/default/iconify.png diff --git a/kwin-styles/glow/themes/default/iconify_glow.png b/kwin-styles/glow/themes/default/iconify_glow.png Binary files differnew file mode 100644 index 00000000..8b4d1413 --- /dev/null +++ b/kwin-styles/glow/themes/default/iconify_glow.png diff --git a/kwin-styles/glow/themes/default/maximizeoff.png b/kwin-styles/glow/themes/default/maximizeoff.png Binary files differnew file mode 100644 index 00000000..e60cdc97 --- /dev/null +++ b/kwin-styles/glow/themes/default/maximizeoff.png diff --git a/kwin-styles/glow/themes/default/maximizeoff_glow.png b/kwin-styles/glow/themes/default/maximizeoff_glow.png Binary files differnew file mode 100644 index 00000000..25f4c8ec --- /dev/null +++ b/kwin-styles/glow/themes/default/maximizeoff_glow.png diff --git a/kwin-styles/glow/themes/default/maximizeon.png b/kwin-styles/glow/themes/default/maximizeon.png Binary files differnew file mode 100644 index 00000000..3976411f --- /dev/null +++ b/kwin-styles/glow/themes/default/maximizeon.png diff --git a/kwin-styles/glow/themes/default/maximizeon_glow.png b/kwin-styles/glow/themes/default/maximizeon_glow.png Binary files differnew file mode 100644 index 00000000..941ed849 --- /dev/null +++ b/kwin-styles/glow/themes/default/maximizeon_glow.png diff --git a/kwin-styles/glow/themes/default/stickyoff.png b/kwin-styles/glow/themes/default/stickyoff.png Binary files differnew file mode 100644 index 00000000..3600e326 --- /dev/null +++ b/kwin-styles/glow/themes/default/stickyoff.png diff --git a/kwin-styles/glow/themes/default/stickyoff_glow.png b/kwin-styles/glow/themes/default/stickyoff_glow.png Binary files differnew file mode 100644 index 00000000..5c9861a0 --- /dev/null +++ b/kwin-styles/glow/themes/default/stickyoff_glow.png diff --git a/kwin-styles/glow/themes/default/stickyon.png b/kwin-styles/glow/themes/default/stickyon.png Binary files differnew file mode 100644 index 00000000..a84941a3 --- /dev/null +++ b/kwin-styles/glow/themes/default/stickyon.png diff --git a/kwin-styles/glow/themes/default/stickyon_glow.png b/kwin-styles/glow/themes/default/stickyon_glow.png Binary files differnew file mode 100644 index 00000000..905653e5 --- /dev/null +++ b/kwin-styles/glow/themes/default/stickyon_glow.png diff --git a/kwin-styles/glow/themes/glass/Makefile.am b/kwin-styles/glow/themes/glass/Makefile.am new file mode 100644 index 00000000..f1d7e5d7 --- /dev/null +++ b/kwin-styles/glow/themes/glass/Makefile.am @@ -0,0 +1,17 @@ +linkdir = $(kde_datadir)/kwin/glow-themes/glass +link_DATA = \ +background.png \ +help.png help_glow.png \ +close.png close_glow.png \ +iconify.png iconify_glow.png \ +maximizeoff.png maximizeoff_glow.png \ +maximizeon.png maximizeon_glow.png \ +stickyon.png stickyon_glow.png \ +stickyoff.png stickyoff_glow.png \ +glass.theme + +EXTRA_DIST = $(link_DATA) + +###KMAKE-start (don't edit or delete this block) + +###KMAKE-end diff --git a/kwin-styles/glow/themes/glass/background.png b/kwin-styles/glow/themes/glass/background.png Binary files differnew file mode 100644 index 00000000..97d278a0 --- /dev/null +++ b/kwin-styles/glow/themes/glass/background.png diff --git a/kwin-styles/glow/themes/glass/close.png b/kwin-styles/glow/themes/glass/close.png Binary files differnew file mode 100644 index 00000000..8b61cfd2 --- /dev/null +++ b/kwin-styles/glow/themes/glass/close.png diff --git a/kwin-styles/glow/themes/glass/close_glow.png b/kwin-styles/glow/themes/glass/close_glow.png Binary files differnew file mode 100644 index 00000000..2be50e89 --- /dev/null +++ b/kwin-styles/glow/themes/glass/close_glow.png diff --git a/kwin-styles/glow/themes/glass/glass.theme b/kwin-styles/glow/themes/glass/glass.theme new file mode 100644 index 00000000..9facf271 --- /dev/null +++ b/kwin-styles/glow/themes/glass/glass.theme @@ -0,0 +1,19 @@ +buttonSize=19,19 + +backgroundPixmap=background.png + +stickyOnPixmap=stickyon.png +stickyOffPixmap=stickyoff.png +maximizeOnPixmap=maximizeon.png +maximizeOffPixmap=maximizeoff.png +helpPixmap=help.png +closePixmap=close.png +iconifyPixmap=iconify.png + +stickyOnGlowPixmap=stickyon_glow.png +stickyOffGlowPixmap=stickyoff_glow.png +maximizeOnGlowPixmap=maximizeon_glow.png +maximizeOffGlowPixmap=maximizeoff_glow.png +helpGlowPixmap=help_glow.png +closeGlowPixmap=close_glow.png +iconifyGlowPixmap=iconify_glow.png diff --git a/kwin-styles/glow/themes/glass/help.png b/kwin-styles/glow/themes/glass/help.png Binary files differnew file mode 100644 index 00000000..7a12fe88 --- /dev/null +++ b/kwin-styles/glow/themes/glass/help.png diff --git a/kwin-styles/glow/themes/glass/help_glow.png b/kwin-styles/glow/themes/glass/help_glow.png Binary files differnew file mode 100644 index 00000000..77976ff1 --- /dev/null +++ b/kwin-styles/glow/themes/glass/help_glow.png diff --git a/kwin-styles/glow/themes/glass/iconify.png b/kwin-styles/glow/themes/glass/iconify.png Binary files differnew file mode 100644 index 00000000..55b9f6a9 --- /dev/null +++ b/kwin-styles/glow/themes/glass/iconify.png diff --git a/kwin-styles/glow/themes/glass/iconify_glow.png b/kwin-styles/glow/themes/glass/iconify_glow.png Binary files differnew file mode 100644 index 00000000..ff741dbe --- /dev/null +++ b/kwin-styles/glow/themes/glass/iconify_glow.png diff --git a/kwin-styles/glow/themes/glass/maximizeoff.png b/kwin-styles/glow/themes/glass/maximizeoff.png Binary files differnew file mode 100644 index 00000000..b08d34c1 --- /dev/null +++ b/kwin-styles/glow/themes/glass/maximizeoff.png diff --git a/kwin-styles/glow/themes/glass/maximizeoff_glow.png b/kwin-styles/glow/themes/glass/maximizeoff_glow.png Binary files differnew file mode 100644 index 00000000..8ff43447 --- /dev/null +++ b/kwin-styles/glow/themes/glass/maximizeoff_glow.png diff --git a/kwin-styles/glow/themes/glass/maximizeon.png b/kwin-styles/glow/themes/glass/maximizeon.png Binary files differnew file mode 100644 index 00000000..8894007e --- /dev/null +++ b/kwin-styles/glow/themes/glass/maximizeon.png diff --git a/kwin-styles/glow/themes/glass/maximizeon_glow.png b/kwin-styles/glow/themes/glass/maximizeon_glow.png Binary files differnew file mode 100644 index 00000000..7fe3c840 --- /dev/null +++ b/kwin-styles/glow/themes/glass/maximizeon_glow.png diff --git a/kwin-styles/glow/themes/glass/stickyoff.png b/kwin-styles/glow/themes/glass/stickyoff.png Binary files differnew file mode 100644 index 00000000..d87cfe9d --- /dev/null +++ b/kwin-styles/glow/themes/glass/stickyoff.png diff --git a/kwin-styles/glow/themes/glass/stickyoff_glow.png b/kwin-styles/glow/themes/glass/stickyoff_glow.png Binary files differnew file mode 100644 index 00000000..f682df78 --- /dev/null +++ b/kwin-styles/glow/themes/glass/stickyoff_glow.png diff --git a/kwin-styles/glow/themes/glass/stickyon.png b/kwin-styles/glow/themes/glass/stickyon.png Binary files differnew file mode 100644 index 00000000..f044c134 --- /dev/null +++ b/kwin-styles/glow/themes/glass/stickyon.png diff --git a/kwin-styles/glow/themes/glass/stickyon_glow.png b/kwin-styles/glow/themes/glass/stickyon_glow.png Binary files differnew file mode 100644 index 00000000..0b468787 --- /dev/null +++ b/kwin-styles/glow/themes/glass/stickyon_glow.png diff --git a/kwin-styles/glow/themes/glass_huge/Makefile.am b/kwin-styles/glow/themes/glass_huge/Makefile.am new file mode 100644 index 00000000..b9631d1b --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/Makefile.am @@ -0,0 +1,17 @@ +linkdir = $(kde_datadir)/kwin/glow-themes/glass_huge +link_DATA = \ +background.png \ +help.png help_glow.png \ +close.png close_glow.png \ +iconify.png iconify_glow.png \ +maximizeoff.png maximizeoff_glow.png \ +maximizeon.png maximizeon_glow.png \ +stickyon.png stickyon_glow.png \ +stickyoff.png stickyoff_glow.png \ +glass_huge.theme + +EXTRA_DIST = $(link_DATA) + +###KMAKE-start (don't edit or delete this block) + +###KMAKE-end diff --git a/kwin-styles/glow/themes/glass_huge/background.png b/kwin-styles/glow/themes/glass_huge/background.png Binary files differnew file mode 100644 index 00000000..f69e109b --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/background.png diff --git a/kwin-styles/glow/themes/glass_huge/close.png b/kwin-styles/glow/themes/glass_huge/close.png Binary files differnew file mode 100644 index 00000000..3f1c7369 --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/close.png diff --git a/kwin-styles/glow/themes/glass_huge/close_glow.png b/kwin-styles/glow/themes/glass_huge/close_glow.png Binary files differnew file mode 100644 index 00000000..00b647dc --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/close_glow.png diff --git a/kwin-styles/glow/themes/glass_huge/glass_huge.theme b/kwin-styles/glow/themes/glass_huge/glass_huge.theme new file mode 100644 index 00000000..d8c41f52 --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/glass_huge.theme @@ -0,0 +1,19 @@ +buttonSize=40,40 + +backgroundPixmap=background.png + +stickyOnPixmap=stickyon.png +stickyOffPixmap=stickyoff.png +maximizeOnPixmap=maximizeon.png +maximizeOffPixmap=maximizeoff.png +helpPixmap=help.png +closePixmap=close.png +iconifyPixmap=iconify.png + +stickyOnGlowPixmap=stickyon_glow.png +stickyOffGlowPixmap=stickyoff_glow.png +maximizeOnGlowPixmap=maximizeon_glow.png +maximizeOffGlowPixmap=maximizeoff_glow.png +helpGlowPixmap=help_glow.png +closeGlowPixmap=close_glow.png +iconifyGlowPixmap=iconify_glow.png diff --git a/kwin-styles/glow/themes/glass_huge/help.png b/kwin-styles/glow/themes/glass_huge/help.png Binary files differnew file mode 100644 index 00000000..a391ce94 --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/help.png diff --git a/kwin-styles/glow/themes/glass_huge/help_glow.png b/kwin-styles/glow/themes/glass_huge/help_glow.png Binary files differnew file mode 100644 index 00000000..a8237795 --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/help_glow.png diff --git a/kwin-styles/glow/themes/glass_huge/iconify.png b/kwin-styles/glow/themes/glass_huge/iconify.png Binary files differnew file mode 100644 index 00000000..b3219692 --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/iconify.png diff --git a/kwin-styles/glow/themes/glass_huge/iconify_glow.png b/kwin-styles/glow/themes/glass_huge/iconify_glow.png Binary files differnew file mode 100644 index 00000000..a5950bcc --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/iconify_glow.png diff --git a/kwin-styles/glow/themes/glass_huge/maximizeoff.png b/kwin-styles/glow/themes/glass_huge/maximizeoff.png Binary files differnew file mode 100644 index 00000000..b6ca8c0b --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/maximizeoff.png diff --git a/kwin-styles/glow/themes/glass_huge/maximizeoff_glow.png b/kwin-styles/glow/themes/glass_huge/maximizeoff_glow.png Binary files differnew file mode 100644 index 00000000..deb8b29f --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/maximizeoff_glow.png diff --git a/kwin-styles/glow/themes/glass_huge/maximizeon.png b/kwin-styles/glow/themes/glass_huge/maximizeon.png Binary files differnew file mode 100644 index 00000000..bcccef1f --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/maximizeon.png diff --git a/kwin-styles/glow/themes/glass_huge/maximizeon_glow.png b/kwin-styles/glow/themes/glass_huge/maximizeon_glow.png Binary files differnew file mode 100644 index 00000000..410296b1 --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/maximizeon_glow.png diff --git a/kwin-styles/glow/themes/glass_huge/stickyoff.png b/kwin-styles/glow/themes/glass_huge/stickyoff.png Binary files differnew file mode 100644 index 00000000..db79fec8 --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/stickyoff.png diff --git a/kwin-styles/glow/themes/glass_huge/stickyoff_glow.png b/kwin-styles/glow/themes/glass_huge/stickyoff_glow.png Binary files differnew file mode 100644 index 00000000..ff8377b1 --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/stickyoff_glow.png diff --git a/kwin-styles/glow/themes/glass_huge/stickyon.png b/kwin-styles/glow/themes/glass_huge/stickyon.png Binary files differnew file mode 100644 index 00000000..c6b1f6bc --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/stickyon.png diff --git a/kwin-styles/glow/themes/glass_huge/stickyon_glow.png b/kwin-styles/glow/themes/glass_huge/stickyon_glow.png Binary files differnew file mode 100644 index 00000000..46d8470b --- /dev/null +++ b/kwin-styles/glow/themes/glass_huge/stickyon_glow.png diff --git a/kwin-styles/glow/themes/glass_large/Makefile.am b/kwin-styles/glow/themes/glass_large/Makefile.am new file mode 100644 index 00000000..b884ff55 --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/Makefile.am @@ -0,0 +1,17 @@ +linkdir = $(kde_datadir)/kwin/glow-themes/glass_large +link_DATA = \ +background.png \ +help.png help_glow.png \ +close.png close_glow.png \ +iconify.png iconify_glow.png \ +maximizeoff.png maximizeoff_glow.png \ +maximizeon.png maximizeon_glow.png \ +stickyon.png stickyon_glow.png \ +stickyoff.png stickyoff_glow.png \ +glass_large.theme + +EXTRA_DIST = $(link_DATA) + +###KMAKE-start (don't edit or delete this block) + +###KMAKE-end diff --git a/kwin-styles/glow/themes/glass_large/background.png b/kwin-styles/glow/themes/glass_large/background.png Binary files differnew file mode 100644 index 00000000..860e346f --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/background.png diff --git a/kwin-styles/glow/themes/glass_large/close.png b/kwin-styles/glow/themes/glass_large/close.png Binary files differnew file mode 100644 index 00000000..4e180281 --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/close.png diff --git a/kwin-styles/glow/themes/glass_large/close_glow.png b/kwin-styles/glow/themes/glass_large/close_glow.png Binary files differnew file mode 100644 index 00000000..59976dd3 --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/close_glow.png diff --git a/kwin-styles/glow/themes/glass_large/glass_large.theme b/kwin-styles/glow/themes/glass_large/glass_large.theme new file mode 100644 index 00000000..1fdf6832 --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/glass_large.theme @@ -0,0 +1,19 @@ +buttonSize=23,23 + +backgroundPixmap=background.png + +stickyOnPixmap=stickyon.png +stickyOffPixmap=stickyoff.png +maximizeOnPixmap=maximizeon.png +maximizeOffPixmap=maximizeoff.png +helpPixmap=help.png +closePixmap=close.png +iconifyPixmap=iconify.png + +stickyOnGlowPixmap=stickyon_glow.png +stickyOffGlowPixmap=stickyoff_glow.png +maximizeOnGlowPixmap=maximizeon_glow.png +maximizeOffGlowPixmap=maximizeoff_glow.png +helpGlowPixmap=help_glow.png +closeGlowPixmap=close_glow.png +iconifyGlowPixmap=iconify_glow.png diff --git a/kwin-styles/glow/themes/glass_large/help.png b/kwin-styles/glow/themes/glass_large/help.png Binary files differnew file mode 100644 index 00000000..464a7d49 --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/help.png diff --git a/kwin-styles/glow/themes/glass_large/help_glow.png b/kwin-styles/glow/themes/glass_large/help_glow.png Binary files differnew file mode 100644 index 00000000..21e94cd0 --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/help_glow.png diff --git a/kwin-styles/glow/themes/glass_large/iconify.png b/kwin-styles/glow/themes/glass_large/iconify.png Binary files differnew file mode 100644 index 00000000..c148f4bb --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/iconify.png diff --git a/kwin-styles/glow/themes/glass_large/iconify_glow.png b/kwin-styles/glow/themes/glass_large/iconify_glow.png Binary files differnew file mode 100644 index 00000000..9daa831b --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/iconify_glow.png diff --git a/kwin-styles/glow/themes/glass_large/maximizeoff.png b/kwin-styles/glow/themes/glass_large/maximizeoff.png Binary files differnew file mode 100644 index 00000000..40580530 --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/maximizeoff.png diff --git a/kwin-styles/glow/themes/glass_large/maximizeoff_glow.png b/kwin-styles/glow/themes/glass_large/maximizeoff_glow.png Binary files differnew file mode 100644 index 00000000..164aadbf --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/maximizeoff_glow.png diff --git a/kwin-styles/glow/themes/glass_large/maximizeon.png b/kwin-styles/glow/themes/glass_large/maximizeon.png Binary files differnew file mode 100644 index 00000000..34e9425a --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/maximizeon.png diff --git a/kwin-styles/glow/themes/glass_large/maximizeon_glow.png b/kwin-styles/glow/themes/glass_large/maximizeon_glow.png Binary files differnew file mode 100644 index 00000000..6038c045 --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/maximizeon_glow.png diff --git a/kwin-styles/glow/themes/glass_large/stickyoff.png b/kwin-styles/glow/themes/glass_large/stickyoff.png Binary files differnew file mode 100644 index 00000000..a29cde1a --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/stickyoff.png diff --git a/kwin-styles/glow/themes/glass_large/stickyoff_glow.png b/kwin-styles/glow/themes/glass_large/stickyoff_glow.png Binary files differnew file mode 100644 index 00000000..76c4781e --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/stickyoff_glow.png diff --git a/kwin-styles/glow/themes/glass_large/stickyon.png b/kwin-styles/glow/themes/glass_large/stickyon.png Binary files differnew file mode 100644 index 00000000..c805faf4 --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/stickyon.png diff --git a/kwin-styles/glow/themes/glass_large/stickyon_glow.png b/kwin-styles/glow/themes/glass_large/stickyon_glow.png Binary files differnew file mode 100644 index 00000000..7a6b9ec4 --- /dev/null +++ b/kwin-styles/glow/themes/glass_large/stickyon_glow.png diff --git a/kwin-styles/glow/themes/glass_verylarge/Makefile.am b/kwin-styles/glow/themes/glass_verylarge/Makefile.am new file mode 100644 index 00000000..f6a5582c --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/Makefile.am @@ -0,0 +1,17 @@ +linkdir = $(kde_datadir)/kwin/glow-themes/glass_verylarge +link_DATA = \ +background.png \ +help.png help_glow.png \ +close.png close_glow.png \ +iconify.png iconify_glow.png \ +maximizeoff.png maximizeoff_glow.png \ +maximizeon.png maximizeon_glow.png \ +stickyon.png stickyon_glow.png \ +stickyoff.png stickyoff_glow.png \ +glass_verylarge.theme + +EXTRA_DIST = $(link_DATA) + +###KMAKE-start (don't edit or delete this block) + +###KMAKE-end diff --git a/kwin-styles/glow/themes/glass_verylarge/background.png b/kwin-styles/glow/themes/glass_verylarge/background.png Binary files differnew file mode 100644 index 00000000..ed032232 --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/background.png diff --git a/kwin-styles/glow/themes/glass_verylarge/close.png b/kwin-styles/glow/themes/glass_verylarge/close.png Binary files differnew file mode 100644 index 00000000..15dc4b50 --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/close.png diff --git a/kwin-styles/glow/themes/glass_verylarge/close_glow.png b/kwin-styles/glow/themes/glass_verylarge/close_glow.png Binary files differnew file mode 100644 index 00000000..9207e37e --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/close_glow.png diff --git a/kwin-styles/glow/themes/glass_verylarge/glass_verylarge.theme b/kwin-styles/glow/themes/glass_verylarge/glass_verylarge.theme new file mode 100644 index 00000000..36368a8d --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/glass_verylarge.theme @@ -0,0 +1,19 @@ +buttonSize=30,30 + +backgroundPixmap=background.png + +stickyOnPixmap=stickyon.png +stickyOffPixmap=stickyoff.png +maximizeOnPixmap=maximizeon.png +maximizeOffPixmap=maximizeoff.png +helpPixmap=help.png +closePixmap=close.png +iconifyPixmap=iconify.png + +stickyOnGlowPixmap=stickyon_glow.png +stickyOffGlowPixmap=stickyoff_glow.png +maximizeOnGlowPixmap=maximizeon_glow.png +maximizeOffGlowPixmap=maximizeoff_glow.png +helpGlowPixmap=help_glow.png +closeGlowPixmap=close_glow.png +iconifyGlowPixmap=iconify_glow.png diff --git a/kwin-styles/glow/themes/glass_verylarge/help.png b/kwin-styles/glow/themes/glass_verylarge/help.png Binary files differnew file mode 100644 index 00000000..3a2d0c9d --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/help.png diff --git a/kwin-styles/glow/themes/glass_verylarge/help_glow.png b/kwin-styles/glow/themes/glass_verylarge/help_glow.png Binary files differnew file mode 100644 index 00000000..29e6edf9 --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/help_glow.png diff --git a/kwin-styles/glow/themes/glass_verylarge/iconify.png b/kwin-styles/glow/themes/glass_verylarge/iconify.png Binary files differnew file mode 100644 index 00000000..2d760e3d --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/iconify.png diff --git a/kwin-styles/glow/themes/glass_verylarge/iconify_glow.png b/kwin-styles/glow/themes/glass_verylarge/iconify_glow.png Binary files differnew file mode 100644 index 00000000..01f474e5 --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/iconify_glow.png diff --git a/kwin-styles/glow/themes/glass_verylarge/maximizeoff.png b/kwin-styles/glow/themes/glass_verylarge/maximizeoff.png Binary files differnew file mode 100644 index 00000000..4224aa05 --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/maximizeoff.png diff --git a/kwin-styles/glow/themes/glass_verylarge/maximizeoff_glow.png b/kwin-styles/glow/themes/glass_verylarge/maximizeoff_glow.png Binary files differnew file mode 100644 index 00000000..9327994a --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/maximizeoff_glow.png diff --git a/kwin-styles/glow/themes/glass_verylarge/maximizeon.png b/kwin-styles/glow/themes/glass_verylarge/maximizeon.png Binary files differnew file mode 100644 index 00000000..2d90482f --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/maximizeon.png diff --git a/kwin-styles/glow/themes/glass_verylarge/maximizeon_glow.png b/kwin-styles/glow/themes/glass_verylarge/maximizeon_glow.png Binary files differnew file mode 100644 index 00000000..3b9a6bf4 --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/maximizeon_glow.png diff --git a/kwin-styles/glow/themes/glass_verylarge/stickyoff.png b/kwin-styles/glow/themes/glass_verylarge/stickyoff.png Binary files differnew file mode 100644 index 00000000..a2c26583 --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/stickyoff.png diff --git a/kwin-styles/glow/themes/glass_verylarge/stickyoff_glow.png b/kwin-styles/glow/themes/glass_verylarge/stickyoff_glow.png Binary files differnew file mode 100644 index 00000000..c6e57e21 --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/stickyoff_glow.png diff --git a/kwin-styles/glow/themes/glass_verylarge/stickyon.png b/kwin-styles/glow/themes/glass_verylarge/stickyon.png Binary files differnew file mode 100644 index 00000000..56cde081 --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/stickyon.png diff --git a/kwin-styles/glow/themes/glass_verylarge/stickyon_glow.png b/kwin-styles/glow/themes/glass_verylarge/stickyon_glow.png Binary files differnew file mode 100644 index 00000000..f3778479 --- /dev/null +++ b/kwin-styles/glow/themes/glass_verylarge/stickyon_glow.png diff --git a/kwin-styles/glow/themes/square/Makefile.am b/kwin-styles/glow/themes/square/Makefile.am new file mode 100644 index 00000000..bcb698b0 --- /dev/null +++ b/kwin-styles/glow/themes/square/Makefile.am @@ -0,0 +1,17 @@ +linkdir = $(kde_datadir)/kwin/glow-themes/square +link_DATA = \ +background.png \ +help.png help_glow.png \ +close.png close_glow.png \ +iconify.png iconify_glow.png \ +maximizeoff.png maximizeoff_glow.png \ +maximizeon.png maximizeon_glow.png \ +stickyon.png stickyon_glow.png \ +stickyoff.png stickyoff_glow.png \ +square.theme + +EXTRA_DIST = $(link_DATA) + +###KMAKE-start (don't edit or delete this block) + +###KMAKE-end diff --git a/kwin-styles/glow/themes/square/background.png b/kwin-styles/glow/themes/square/background.png Binary files differnew file mode 100644 index 00000000..225af3a5 --- /dev/null +++ b/kwin-styles/glow/themes/square/background.png diff --git a/kwin-styles/glow/themes/square/close.png b/kwin-styles/glow/themes/square/close.png Binary files differnew file mode 100644 index 00000000..898a368a --- /dev/null +++ b/kwin-styles/glow/themes/square/close.png diff --git a/kwin-styles/glow/themes/square/close_glow.png b/kwin-styles/glow/themes/square/close_glow.png Binary files differnew file mode 100644 index 00000000..4cd1f1cb --- /dev/null +++ b/kwin-styles/glow/themes/square/close_glow.png diff --git a/kwin-styles/glow/themes/square/help.png b/kwin-styles/glow/themes/square/help.png Binary files differnew file mode 100644 index 00000000..c3ed65ee --- /dev/null +++ b/kwin-styles/glow/themes/square/help.png diff --git a/kwin-styles/glow/themes/square/help_glow.png b/kwin-styles/glow/themes/square/help_glow.png Binary files differnew file mode 100644 index 00000000..4cd1f1cb --- /dev/null +++ b/kwin-styles/glow/themes/square/help_glow.png diff --git a/kwin-styles/glow/themes/square/iconify.png b/kwin-styles/glow/themes/square/iconify.png Binary files differnew file mode 100644 index 00000000..94fc6338 --- /dev/null +++ b/kwin-styles/glow/themes/square/iconify.png diff --git a/kwin-styles/glow/themes/square/iconify_glow.png b/kwin-styles/glow/themes/square/iconify_glow.png Binary files differnew file mode 100644 index 00000000..4cd1f1cb --- /dev/null +++ b/kwin-styles/glow/themes/square/iconify_glow.png diff --git a/kwin-styles/glow/themes/square/maximizeoff.png b/kwin-styles/glow/themes/square/maximizeoff.png Binary files differnew file mode 100644 index 00000000..e60cdc97 --- /dev/null +++ b/kwin-styles/glow/themes/square/maximizeoff.png diff --git a/kwin-styles/glow/themes/square/maximizeoff_glow.png b/kwin-styles/glow/themes/square/maximizeoff_glow.png Binary files differnew file mode 100644 index 00000000..4cd1f1cb --- /dev/null +++ b/kwin-styles/glow/themes/square/maximizeoff_glow.png diff --git a/kwin-styles/glow/themes/square/maximizeon.png b/kwin-styles/glow/themes/square/maximizeon.png Binary files differnew file mode 100644 index 00000000..3976411f --- /dev/null +++ b/kwin-styles/glow/themes/square/maximizeon.png diff --git a/kwin-styles/glow/themes/square/maximizeon_glow.png b/kwin-styles/glow/themes/square/maximizeon_glow.png Binary files differnew file mode 100644 index 00000000..4cd1f1cb --- /dev/null +++ b/kwin-styles/glow/themes/square/maximizeon_glow.png diff --git a/kwin-styles/glow/themes/square/square.theme b/kwin-styles/glow/themes/square/square.theme new file mode 100644 index 00000000..26f00feb --- /dev/null +++ b/kwin-styles/glow/themes/square/square.theme @@ -0,0 +1,19 @@ +buttonSize=17,17 + +backgroundPixmap=background.png + +stickyOnPixmap=stickyon.png +stickyOffPixmap=stickyoff.png +maximizeOnPixmap=maximizeon.png +maximizeOffPixmap=maximizeoff.png +helpPixmap=help.png +closePixmap=close.png +iconifyPixmap=iconify.png + +stickyOnGlowPixmap=stickyon_glow.png +stickyOffGlowPixmap=stickyoff_glow.png +maximizeOnGlowPixmap=maximizeon_glow.png +maximizeOffGlowPixmap=maximizeoff_glow.png +helpGlowPixmap=help_glow.png +closeGlowPixmap=close_glow.png +iconifyGlowPixmap=iconify_glow.png diff --git a/kwin-styles/glow/themes/square/stickyoff.png b/kwin-styles/glow/themes/square/stickyoff.png Binary files differnew file mode 100644 index 00000000..3600e326 --- /dev/null +++ b/kwin-styles/glow/themes/square/stickyoff.png diff --git a/kwin-styles/glow/themes/square/stickyoff_glow.png b/kwin-styles/glow/themes/square/stickyoff_glow.png Binary files differnew file mode 100644 index 00000000..4cd1f1cb --- /dev/null +++ b/kwin-styles/glow/themes/square/stickyoff_glow.png diff --git a/kwin-styles/glow/themes/square/stickyon.png b/kwin-styles/glow/themes/square/stickyon.png Binary files differnew file mode 100644 index 00000000..a84941a3 --- /dev/null +++ b/kwin-styles/glow/themes/square/stickyon.png diff --git a/kwin-styles/glow/themes/square/stickyon_glow.png b/kwin-styles/glow/themes/square/stickyon_glow.png Binary files differnew file mode 100644 index 00000000..4cd1f1cb --- /dev/null +++ b/kwin-styles/glow/themes/square/stickyon_glow.png |