Completing move of kwm and kwindecoration to kwin/kcmkwin as discussed
on the kwin mailing list. - kwm has been renamed and moved to kwin/kcmkwin/kwinoptions. - kwindecoration has been moved to kwin/kcmkwin/kwindecoration. svn path=/trunk/kdebase/kcontrol/; revision=131923
This commit is contained in:
parent
e0435fea62
commit
4fdde98724
19 changed files with 3993 additions and 0 deletions
21
kcmkwin/kwindecoration/Makefile.am
Normal file
21
kcmkwin/kwindecoration/Makefile.am
Normal file
|
@ -0,0 +1,21 @@
|
|||
INCLUDES = $(all_includes)
|
||||
|
||||
kde_module_LTLIBRARIES = libkcm_kwindecoration.la
|
||||
|
||||
libkcm_kwindecoration_la_SOURCES = kwindecoration.cpp buttons.cpp kwindecorationIface.skel
|
||||
noinst_HEADERS = kwindecoration.h kwindecorationIface.h buttons.h
|
||||
|
||||
libkcm_kwindecoration_la_LDFLAGS = \
|
||||
-module -avoid-version $(all_libraries) -no-undefined
|
||||
|
||||
libkcm_kwindecoration_la_LIBADD = $(LIB_KDEUI)
|
||||
|
||||
METASOURCES = AUTO
|
||||
|
||||
messages:
|
||||
$(XGETTEXT) *.cpp -o $(podir)/kcmkwindecoration.pot
|
||||
|
||||
lnf_DATA = kwindecoration.desktop
|
||||
lnfdir = $(kde_appsdir)/Settings/LookNFeel
|
||||
|
||||
EXTRA_DIST = $(lnf_DATA)
|
561
kcmkwin/kwindecoration/buttons.cpp
Normal file
561
kcmkwin/kwindecoration/buttons.cpp
Normal file
|
@ -0,0 +1,561 @@
|
|||
/*
|
||||
$Id$
|
||||
|
||||
This is the new kwindecoration kcontrol module
|
||||
|
||||
Copyright (c) 2001
|
||||
Karol Szwed <gallium@kde.org>
|
||||
http://gallium.n3.net/
|
||||
|
||||
Supports new kwin configuration plugins, and titlebar button position
|
||||
modification via dnd interface.
|
||||
|
||||
Based on original "kwintheme" (Window Borders)
|
||||
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
|
||||
*/
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <klocale.h>
|
||||
#include "buttons.h"
|
||||
#include "pixmaps.h"
|
||||
|
||||
|
||||
// General purpose button globals (I know I shouldn't use them :)
|
||||
//===============================================================
|
||||
|
||||
enum Buttons{ BtnMenu=0, BtnSticky, BtnSpacer, BtnHelp,
|
||||
BtnMinimize, BtnMaximize, BtnClose, BtnCount };
|
||||
QListBoxPixmap* buttons[ BtnCount ];
|
||||
QPixmap* pixmaps[ BtnCount ];
|
||||
QPixmap* miniSpacer;
|
||||
|
||||
|
||||
//==============================================================
|
||||
|
||||
ButtonDrag::ButtonDrag( char btn, QWidget* parent, const char* name)
|
||||
: QStoredDrag( "kcontrol/kwindecoration_buttons", parent, name)
|
||||
{
|
||||
QByteArray payload(1);
|
||||
payload[0] = btn;
|
||||
setEncodedData( payload );
|
||||
}
|
||||
|
||||
|
||||
bool ButtonDrag::canDecode( QDragMoveEvent* e )
|
||||
{
|
||||
return e->provides( "kcontrol/kwindecoration_buttons" );
|
||||
}
|
||||
|
||||
|
||||
bool ButtonDrag::decode( QDropEvent* e, char& btn )
|
||||
{
|
||||
QByteArray payload = e->data( "kcontrol/kwindecoration_buttons" );
|
||||
if ( payload.size() )
|
||||
{
|
||||
e->accept();
|
||||
btn = payload[0];
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Implements the button drag source list box
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Converts the button character value to its index
|
||||
static int btnIndex( char btn )
|
||||
{
|
||||
switch (btn)
|
||||
{
|
||||
case 'M':
|
||||
return BtnMenu;
|
||||
break;
|
||||
case 'S':
|
||||
return BtnSticky;
|
||||
break;
|
||||
case '_':
|
||||
return BtnSpacer;
|
||||
break;
|
||||
case 'H':
|
||||
return BtnHelp;
|
||||
break;
|
||||
case 'I':
|
||||
return BtnMinimize;
|
||||
break;
|
||||
case 'A':
|
||||
return BtnMaximize;
|
||||
break;
|
||||
case 'X':
|
||||
return BtnClose;
|
||||
break;
|
||||
default:
|
||||
return -1; // Not found...
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Returns the pixmap of a button item
|
||||
const QPixmap* btnPixmap( char btn )
|
||||
{
|
||||
if (btn == '_')
|
||||
return miniSpacer;
|
||||
|
||||
int btnindex = btnIndex( btn );
|
||||
if (btnindex == -1)
|
||||
return NULL;
|
||||
|
||||
return buttons[btnindex]->pixmap();
|
||||
}
|
||||
|
||||
|
||||
|
||||
ButtonSource::ButtonSource( QWidget* parent, const char* name )
|
||||
: QListBox( parent, name)
|
||||
{
|
||||
// Create the listbox pixmaps
|
||||
pixmaps[ BtnMenu ] = new QPixmap( button_menu_xpm );
|
||||
pixmaps[ BtnSticky ] = new QPixmap( button_sticky_xpm );
|
||||
pixmaps[ BtnSpacer ] = new QPixmap( button_spacer_xpm );
|
||||
pixmaps[ BtnHelp ] = new QPixmap( button_help_xpm );
|
||||
pixmaps[ BtnMinimize ] = new QPixmap( button_minimize_xpm );
|
||||
pixmaps[ BtnMaximize ] = new QPixmap( button_maximize_xpm );
|
||||
pixmaps[ BtnClose ] = new QPixmap( button_close_xpm );
|
||||
miniSpacer = new QPixmap( titlebarspacer_xpm );
|
||||
|
||||
// Add all possible button/spacer types to the list box.
|
||||
buttons[ BtnMenu ] = new QListBoxPixmap( this, *pixmaps[BtnMenu], i18n("Menu") );
|
||||
buttons[ BtnSticky] = new QListBoxPixmap( this, *pixmaps[BtnSticky], i18n("Sticky") );
|
||||
buttons[ BtnSpacer ] = new QListBoxPixmap( this, *pixmaps[BtnSpacer], i18n("Spacer") );
|
||||
buttons[ BtnHelp ] = new QListBoxPixmap( this, *pixmaps[BtnHelp], i18n("Help") );
|
||||
buttons[ BtnMinimize ] = new QListBoxPixmap( this, *pixmaps[BtnMinimize], i18n("Minimize") );
|
||||
buttons[ BtnMaximize ] = new QListBoxPixmap( this, *pixmaps[BtnMaximize], i18n("Maximize") );
|
||||
buttons[ BtnClose ] = new QListBoxPixmap( this, *pixmaps[BtnClose], i18n("Close") );
|
||||
|
||||
spacerCount = 0; // No spacers inserted yet
|
||||
setAcceptDrops( TRUE );
|
||||
};
|
||||
|
||||
|
||||
ButtonSource::~ButtonSource()
|
||||
{
|
||||
for( int i = 0; i < BtnCount; i++)
|
||||
if (pixmaps[i])
|
||||
delete pixmaps[i];
|
||||
|
||||
if (miniSpacer)
|
||||
delete miniSpacer;
|
||||
}
|
||||
|
||||
|
||||
void ButtonSource::hideAllButtons()
|
||||
{
|
||||
// Hide all listbox items which are visible
|
||||
if (index( buttons[BtnMenu] ) != -1)
|
||||
takeItem( buttons[BtnMenu] );
|
||||
if (index( buttons[BtnSticky] )!= -1)
|
||||
takeItem( buttons[BtnSticky] );
|
||||
if (index( buttons[BtnHelp] ) != -1)
|
||||
takeItem( buttons[BtnHelp] );
|
||||
if (index( buttons[BtnMinimize] ) != -1)
|
||||
takeItem( buttons[BtnMinimize] );
|
||||
if (index( buttons[BtnMaximize] ) != -1)
|
||||
takeItem( buttons[BtnMaximize] );
|
||||
if (index( buttons[BtnClose] ) != -1)
|
||||
takeItem( buttons[BtnClose] );
|
||||
if (index( buttons[BtnSpacer] ) != -1)
|
||||
takeItem( buttons[BtnSpacer] );
|
||||
|
||||
spacerCount = 10; // 10 inserted spacers (max)
|
||||
}
|
||||
|
||||
void ButtonSource::showAllButtons()
|
||||
{
|
||||
// Hide all listbox items which are visible
|
||||
if (index( buttons[BtnMenu] ) == -1)
|
||||
insertItem( buttons[BtnMenu] );
|
||||
if (index( buttons[BtnSticky] )== -1)
|
||||
insertItem( buttons[BtnSticky] );
|
||||
if (index( buttons[BtnHelp] ) == -1)
|
||||
insertItem( buttons[BtnHelp] );
|
||||
if (index( buttons[BtnMinimize] ) == -1)
|
||||
insertItem( buttons[BtnMinimize] );
|
||||
if (index( buttons[BtnMaximize] ) == -1)
|
||||
insertItem( buttons[BtnMaximize] );
|
||||
if (index( buttons[BtnClose] ) == -1)
|
||||
insertItem( buttons[BtnClose] );
|
||||
if (index( buttons[BtnSpacer] ) == -1)
|
||||
insertItem( buttons[BtnSpacer] );
|
||||
|
||||
spacerCount = 0; // No inserted spacers
|
||||
}
|
||||
|
||||
|
||||
void ButtonSource::showButton( char btn )
|
||||
{
|
||||
// Ignore spacers (max 10)
|
||||
if (btn == '_')
|
||||
spacerCount--;
|
||||
|
||||
int btnindex = btnIndex(btn);
|
||||
|
||||
// Check if the item is already inserted...
|
||||
if ( (btnindex != -1) && (index( buttons[btnindex] ) == -1) )
|
||||
{
|
||||
setUpdatesEnabled( FALSE );
|
||||
insertItem( buttons[ btnindex ] );
|
||||
setUpdatesEnabled( TRUE );
|
||||
sort();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ButtonSource::hideButton( char btn )
|
||||
{
|
||||
// Ignore spacers (max 10)
|
||||
if (btn == '_')
|
||||
{
|
||||
spacerCount++;
|
||||
if (spacerCount != 10)
|
||||
return;
|
||||
}
|
||||
|
||||
int btnindex = btnIndex(btn);
|
||||
|
||||
// Check if the item is already removed...
|
||||
if ( (btnindex != -1) && (index( buttons[btnindex] ) != -1) )
|
||||
{
|
||||
setUpdatesEnabled( FALSE );
|
||||
// De-select before removal
|
||||
setSelected( buttons[ btnindex ], false );
|
||||
takeItem( buttons[ btnindex ] );
|
||||
setUpdatesEnabled( TRUE );
|
||||
sort();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char ButtonSource::convertToChar( QString s )
|
||||
{
|
||||
// Convert the item to its character representation
|
||||
if (s == i18n("Menu"))
|
||||
return 'M';
|
||||
else if (s == i18n("Sticky"))
|
||||
return 'S';
|
||||
else if (s == i18n("Spacer"))
|
||||
return '_';
|
||||
else if (s == i18n("Help"))
|
||||
return 'H';
|
||||
else if (s == i18n("Minimize"))
|
||||
return 'I';
|
||||
else if (s == i18n("Maximize"))
|
||||
return 'A';
|
||||
else if (s == i18n("Close"))
|
||||
return 'X';
|
||||
else
|
||||
return '?';
|
||||
}
|
||||
|
||||
|
||||
void ButtonSource::mousePressEvent( QMouseEvent* e )
|
||||
{
|
||||
// Make a selection before moving the mouse
|
||||
QListBox::mousePressEvent( e );
|
||||
|
||||
// Make sure we have at laest 1 item in the listbox
|
||||
if ( count() > 0 )
|
||||
{
|
||||
// Obtain currently selected item
|
||||
char btn = convertToChar( currentText() );
|
||||
ButtonDrag* bd = new ButtonDrag( btn, this );
|
||||
bd->dragCopy();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ButtonSource::dragMoveEvent( QDragMoveEvent* /* e */ )
|
||||
{
|
||||
// Do nothing...
|
||||
}
|
||||
|
||||
|
||||
void ButtonSource::dragEnterEvent( QDragEnterEvent* e )
|
||||
{
|
||||
if ( ButtonDrag::canDecode( e ) )
|
||||
e->accept();
|
||||
}
|
||||
|
||||
|
||||
void ButtonSource::dragLeaveEvent( QDragLeaveEvent* /* e */ )
|
||||
{
|
||||
// Do nothing...
|
||||
}
|
||||
|
||||
|
||||
void ButtonSource::dropEvent( QDropEvent* /* e */ )
|
||||
{
|
||||
// Allow the button to be removed from the ButtonDropSite
|
||||
emit buttonDropped();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// This class renders and handles the demo titlebar dropsite
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ButtonDropSite::ButtonDropSite( QWidget* parent, const char* name )
|
||||
: QFrame( parent, name )
|
||||
{
|
||||
setAcceptDrops( TRUE );
|
||||
setFrameShape( WinPanel );
|
||||
setFrameShadow( Raised );
|
||||
setMinimumHeight( 26 );
|
||||
setMaximumHeight( 26 );
|
||||
setMinimumWidth( 250 ); // Ensure buttons will fit
|
||||
|
||||
mouseClickPoint.setX(0);
|
||||
mouseClickPoint.setY(0);
|
||||
}
|
||||
|
||||
|
||||
ButtonDropSite::~ButtonDropSite()
|
||||
{
|
||||
// Do nothing...
|
||||
}
|
||||
|
||||
|
||||
void ButtonDropSite::dragMoveEvent( QDragMoveEvent* /* e */ )
|
||||
{
|
||||
// Do nothing...
|
||||
}
|
||||
|
||||
|
||||
void ButtonDropSite::dragEnterEvent( QDragEnterEvent* e )
|
||||
{
|
||||
if ( ButtonDrag::canDecode( e ) )
|
||||
e->accept();
|
||||
}
|
||||
|
||||
|
||||
void ButtonDropSite::dragLeaveEvent( QDragLeaveEvent* /* e */ )
|
||||
{
|
||||
// Do nothing...
|
||||
}
|
||||
|
||||
|
||||
void ButtonDropSite::dropEvent( QDropEvent* e )
|
||||
{
|
||||
char btn;
|
||||
if ( ButtonDrag::decode(e, btn) )
|
||||
{
|
||||
bool isleft;
|
||||
int strPos;
|
||||
|
||||
// If we are moving buttons around, remove the old item first.
|
||||
if (btn == '*')
|
||||
{
|
||||
btn = removeButtonAtPoint( mouseClickPoint );
|
||||
if (btn != '?')
|
||||
emit buttonRemoved( btn );
|
||||
}
|
||||
|
||||
if (btn != '?')
|
||||
{
|
||||
// Add the button to our button strings
|
||||
buttonInsertedAtPoint( e->pos(), isleft, strPos );
|
||||
|
||||
if (isleft)
|
||||
buttonsLeft.insert( strPos, btn );
|
||||
else
|
||||
buttonsRight.insert( strPos, btn );
|
||||
|
||||
repaint(false);
|
||||
|
||||
// Allow listbox to update itself
|
||||
emit buttonAdded( btn );
|
||||
emit changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Starts dragging a button...
|
||||
void ButtonDropSite::mousePressEvent( QMouseEvent* e )
|
||||
{
|
||||
mouseClickPoint = e->pos();
|
||||
|
||||
ButtonDrag* bd = new ButtonDrag( '*', this );
|
||||
bd->dragCopy();
|
||||
}
|
||||
|
||||
|
||||
int ButtonDropSite::buttonWidth( char btn )
|
||||
{
|
||||
if (btn == '_')
|
||||
return 6; // ensure this matches with the pixmap widths
|
||||
else
|
||||
return 20; // Assume characters given are all valid
|
||||
}
|
||||
|
||||
|
||||
// Computes the total space the buttons will take in the titlebar
|
||||
int ButtonDropSite::calcButtonStringWidth( const QString& s )
|
||||
{
|
||||
QChar ch;
|
||||
unsigned int offset = 0;
|
||||
|
||||
for(unsigned int i = 0; i < s.length(); i++)
|
||||
{
|
||||
ch = s[i];
|
||||
offset += buttonWidth( ch.latin1() );
|
||||
}
|
||||
return (int)offset;
|
||||
}
|
||||
|
||||
|
||||
// This slot is called after we drop on the item listbox...
|
||||
void ButtonDropSite::removeClickedButton()
|
||||
{
|
||||
if ( !mouseClickPoint.isNull() )
|
||||
{
|
||||
char btn = removeButtonAtPoint( mouseClickPoint );
|
||||
mouseClickPoint.setX(0);
|
||||
mouseClickPoint.setY(0);
|
||||
repaint(false);
|
||||
|
||||
emit buttonRemoved( btn );
|
||||
emit changed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Find the string and position at which to insert the new button...
|
||||
void ButtonDropSite::buttonInsertedAtPoint( QPoint p, bool& isleft, int& strPos )
|
||||
{
|
||||
int leftoffset = calcButtonStringWidth( buttonsLeft );
|
||||
int rightoffset = calcButtonStringWidth( buttonsRight );
|
||||
int posx = p.x() - 3;
|
||||
|
||||
// The centre of the titlebar text tells us whether to add to the left or right
|
||||
if ( posx < ( leftoffset - rightoffset + ((geometry().width() - 6) / 2)))
|
||||
isleft = true;
|
||||
else
|
||||
isleft = false;
|
||||
|
||||
QString s = isleft ? buttonsLeft : buttonsRight;
|
||||
int offset = isleft ? 0 : geometry().width() - 6 - rightoffset;
|
||||
QChar ch;
|
||||
|
||||
strPos = s.length();
|
||||
|
||||
for (unsigned int i = 0; i < s.length(); i++)
|
||||
{
|
||||
if ( posx < (offset + 5 ))
|
||||
{
|
||||
strPos = i;
|
||||
break;
|
||||
}
|
||||
ch = s[i];
|
||||
offset += buttonWidth( ch.latin1() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char ButtonDropSite::removeButtonAtPoint( QPoint p )
|
||||
{
|
||||
int offset = -1;
|
||||
bool isleft = false;
|
||||
|
||||
// Shrink contents rect by 1 to fit in the titlebar border
|
||||
QRect r = contentsRect();
|
||||
r.moveBy(1 , 1);
|
||||
r.setWidth( r.width() - 2 );
|
||||
r.setHeight( r.height() - 2 );
|
||||
|
||||
// Bail out if the borders were clicked
|
||||
if ( !r.contains(p) )
|
||||
return '?';
|
||||
|
||||
int posx = p.x();
|
||||
|
||||
// Is the point in the LHS/RHS button area?
|
||||
if ( (!buttonsLeft.isEmpty()) && (posx <= (calcButtonStringWidth( buttonsLeft )+3)) )
|
||||
{
|
||||
offset = 3;
|
||||
isleft = true;
|
||||
}
|
||||
else if ( (!buttonsRight.isEmpty()) && (posx >= geometry().width() - calcButtonStringWidth(buttonsRight) - 3))
|
||||
{
|
||||
offset = geometry().width() - calcButtonStringWidth(buttonsRight) - 3;
|
||||
isleft = false;
|
||||
}
|
||||
|
||||
// Step through the button strings and remove the appropriate button
|
||||
if (offset != -1)
|
||||
{
|
||||
QChar ch;
|
||||
QString s = isleft ? buttonsLeft : buttonsRight;
|
||||
|
||||
// Step through the items, to find the appropriate one to remove.
|
||||
for (unsigned int i = 0; i < s.length(); i++)
|
||||
{
|
||||
ch = s[i];
|
||||
offset += buttonWidth( ch.latin1() );
|
||||
if (posx <= offset)
|
||||
{
|
||||
s.remove( i, 1 ); // Remove the current button item
|
||||
if (isleft)
|
||||
buttonsLeft = s;
|
||||
else
|
||||
buttonsRight = s;
|
||||
return ch.latin1();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '?';
|
||||
}
|
||||
|
||||
|
||||
void ButtonDropSite::drawButtonString( QPainter* p, QString& s, int offset )
|
||||
{
|
||||
QChar ch;
|
||||
|
||||
for(unsigned int i = 0; i < s.length(); i++)
|
||||
{
|
||||
ch = s[i];
|
||||
p->drawPixmap( offset, 3, *btnPixmap(ch.latin1()) );
|
||||
offset += buttonWidth(ch.latin1());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ButtonDropSite::drawContents( QPainter* p )
|
||||
{
|
||||
int leftoffset = calcButtonStringWidth( buttonsLeft );
|
||||
int rightoffset = calcButtonStringWidth( buttonsRight );
|
||||
int offset = 3;
|
||||
|
||||
QRect r = contentsRect();
|
||||
|
||||
// Shrink by 1
|
||||
r.moveBy(1 + leftoffset, 1);
|
||||
r.setWidth( r.width() - 2 - leftoffset - rightoffset );
|
||||
r.setHeight( r.height() - 2 );
|
||||
|
||||
drawButtonString( p, buttonsLeft, offset );
|
||||
|
||||
QColor c1( 0x0A, 0x5F, 0x89 ); // KDE 2 titlebar default colour
|
||||
p->fillRect( r, c1 );
|
||||
p->setPen( Qt::white );
|
||||
p->setFont( QFont( "helvetica", 12, QFont::Bold) );
|
||||
p->drawText( r, AlignLeft | AlignVCenter, i18n("KDE") );
|
||||
|
||||
offset = geometry().width() - 3 - rightoffset;
|
||||
drawButtonString( p, buttonsRight, offset );
|
||||
}
|
||||
|
||||
#include "buttons.moc"
|
||||
// vim: ts=4
|
115
kcmkwin/kwindecoration/buttons.h
Normal file
115
kcmkwin/kwindecoration/buttons.h
Normal file
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
$Id$
|
||||
|
||||
This is the new kwindecoration kcontrol module
|
||||
|
||||
Copyright (c) 2001
|
||||
Karol Szwed <gallium@kde.org>
|
||||
http://gallium.n3.net/
|
||||
|
||||
Supports new kwin configuration plugins, and titlebar button position
|
||||
modification via dnd interface.
|
||||
|
||||
Based on original "kwintheme" (Window Borders)
|
||||
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
|
||||
*/
|
||||
|
||||
#ifndef __BUTTONS_H_
|
||||
#define __BUTTONS_H_
|
||||
|
||||
#include <qevent.h>
|
||||
#include <qdragobject.h>
|
||||
#include <qlistbox.h>
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class ButtonDrag: public QStoredDrag
|
||||
{
|
||||
public:
|
||||
ButtonDrag( char btn, QWidget* parent, const char* name=0 );
|
||||
~ButtonDrag() {};
|
||||
|
||||
static bool canDecode( QDragMoveEvent* e );
|
||||
static bool decode( QDropEvent* e, char& btn );
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class ButtonSource: public QListBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ButtonSource( QWidget* parent=0, const char* name=0 );
|
||||
~ButtonSource();
|
||||
|
||||
void hideAllButtons();
|
||||
void showAllButtons();
|
||||
|
||||
signals:
|
||||
void buttonDropped();
|
||||
|
||||
public slots:
|
||||
void hideButton( char btn );
|
||||
void showButton( char btn );
|
||||
|
||||
protected:
|
||||
void dragEnterEvent( QDragEnterEvent* e );
|
||||
void dragMoveEvent( QDragMoveEvent* e );
|
||||
void dragLeaveEvent( QDragLeaveEvent* e );
|
||||
void dropEvent( QDropEvent* e );
|
||||
void mousePressEvent( QMouseEvent* e );
|
||||
|
||||
private:
|
||||
char convertToChar( QString s );
|
||||
QString convertToString( char btn );
|
||||
|
||||
int spacerCount;
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class ButtonDropSite: public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ButtonDropSite( QWidget* parent=0, const char* name=0 );
|
||||
~ButtonDropSite();
|
||||
|
||||
// Allow external classes access our buttons - ensure buttons are
|
||||
// not duplicated however.
|
||||
QString buttonsLeft;
|
||||
QString buttonsRight;
|
||||
|
||||
signals:
|
||||
void buttonAdded( char c );
|
||||
void buttonRemoved( char c );
|
||||
void changed();
|
||||
|
||||
public slots:
|
||||
void removeClickedButton();
|
||||
|
||||
protected:
|
||||
void dragEnterEvent( QDragEnterEvent* e );
|
||||
void dragMoveEvent( QDragMoveEvent* e );
|
||||
void dragLeaveEvent( QDragLeaveEvent* e );
|
||||
void dropEvent( QDropEvent* e );
|
||||
void mousePressEvent( QMouseEvent* e );
|
||||
|
||||
void drawContents( QPainter* p );
|
||||
int buttonWidth( char btn );
|
||||
int calcButtonStringWidth( const QString& s );
|
||||
char removeButtonAtPoint( QPoint p );
|
||||
void buttonInsertedAtPoint( QPoint p, bool& isleft, int& strPos );
|
||||
void drawButtonString( QPainter* p, QString& s, int offset );
|
||||
|
||||
QPoint mouseClickPoint;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
// vim: ts=4
|
486
kcmkwin/kwindecoration/kwindecoration.cpp
Normal file
486
kcmkwin/kwindecoration/kwindecoration.cpp
Normal file
|
@ -0,0 +1,486 @@
|
|||
/*
|
||||
$Id$
|
||||
|
||||
This is the new kwindecoration kcontrol module
|
||||
|
||||
Copyright (c) 2001
|
||||
Karol Szwed <gallium@kde.org>
|
||||
http://gallium.n3.net/
|
||||
|
||||
Supports new kwin configuration plugins, and titlebar button position
|
||||
modification via dnd interface.
|
||||
|
||||
Based on original "kwintheme" (Window Borders)
|
||||
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
|
||||
*/
|
||||
|
||||
#include <qdir.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qlayout.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qlistbox.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <qtabwidget.h>
|
||||
#include <qvbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qfile.h>
|
||||
|
||||
#include <kapplication.h>
|
||||
#include <kdebug.h>
|
||||
#include <kdesktopfile.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kglobal.h>
|
||||
#include <klocale.h>
|
||||
#include <kdialog.h>
|
||||
#include <kgenericfactory.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <dcopclient.h>
|
||||
|
||||
#include "kwindecoration.h"
|
||||
|
||||
|
||||
// KCModule plugin interface
|
||||
// =========================
|
||||
typedef KGenericFactory<KWinDecorationModule, QWidget> KWinDecoFactory;
|
||||
K_EXPORT_COMPONENT_FACTORY( libkcm_kwindecoration, KWinDecoFactory("kcmkwindecoration") );
|
||||
|
||||
KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, const QStringList &)
|
||||
: KCModule(parent, name), DCOPObject("KWinClientDecoration")
|
||||
{
|
||||
KConfig kwinConfig("kwinrc");
|
||||
kwinConfig.setGroup("Style");
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
tabWidget = new QTabWidget( this );
|
||||
layout->addWidget( tabWidget );
|
||||
|
||||
// Page 1 (General Options)
|
||||
QVBox* page1 = new QVBox( tabWidget );
|
||||
page1->setSpacing( KDialog::spacingHint() );
|
||||
page1->setMargin( KDialog::marginHint() );
|
||||
|
||||
QGroupBox* btnGroup = new QGroupBox( 1, Qt::Horizontal, i18n("Window Decoration"), page1 );
|
||||
QWhatsThis::add( btnGroup,
|
||||
i18n("Select the window decoration. This is the look and feel of both "
|
||||
"the window borders and the window handle.") );
|
||||
decorationListBox = new QListBox( btnGroup );
|
||||
|
||||
QGroupBox* checkGroup = new QGroupBox( 1, Qt::Horizontal,
|
||||
i18n("General options (if available)"), page1 );
|
||||
cbUseCustomButtonPositions = new QCheckBox(
|
||||
i18n("Use custom titlebar button &positions"), checkGroup );
|
||||
QWhatsThis::add( cbUseCustomButtonPositions,
|
||||
i18n( "The appropriate settings can be found in the \"Buttons\" Tab. "
|
||||
"Please note that this option is not available on all styles yet!" ) );
|
||||
cbShowToolTips = new QCheckBox(
|
||||
i18n("&Show window button tooltips"), checkGroup );
|
||||
QWhatsThis::add( cbShowToolTips,
|
||||
i18n( "Enabling this checkbox will show window button tooltips. "
|
||||
"If this checkbox is off, no window button tooltips will be shown."));
|
||||
// Save this for later...
|
||||
// cbUseMiniWindows = new QCheckBox( i18n( "Render mini &titlebars for all windows"), checkGroup );
|
||||
// QWhatsThis::add( cbUseMiniWindows, i18n( "Note that this option is not available on all styles yet!" ) );
|
||||
|
||||
// Page 2 (Button Selector)
|
||||
buttonPage = new QVBox( tabWidget );
|
||||
buttonPage->setSpacing( KDialog::spacingHint() );
|
||||
buttonPage->setMargin( KDialog::marginHint() );
|
||||
|
||||
QGroupBox* buttonBox = new QGroupBox( 1, Qt::Horizontal,
|
||||
i18n("Titlebar Button Position"), buttonPage );
|
||||
|
||||
// Add nifty dnd button modification widgets
|
||||
QLabel* label = new QLabel( buttonBox );
|
||||
dropSite = new ButtonDropSite( buttonBox );
|
||||
label->setText( i18n( "To add or remove titlebar buttons, simply <i>drag</i> items "
|
||||
"between the available item list and the titlebar preview. Similarly, "
|
||||
"drag items within the titlebar preview to re-position them.") );
|
||||
buttonSource = new ButtonSource( buttonBox );
|
||||
|
||||
// Page 3 (Configure decoration via client plugin page)
|
||||
pluginPage = new QVBox( tabWidget );
|
||||
pluginPage->setSpacing( KDialog::spacingHint() );
|
||||
pluginPage->setMargin( KDialog::marginHint() );
|
||||
pluginObject = NULL;
|
||||
|
||||
// Load all installed decorations into memory
|
||||
// Set up the decoration lists and other UI settings
|
||||
findDecorations();
|
||||
createDecorationList();
|
||||
readConfig( &kwinConfig );
|
||||
resetPlugin( &kwinConfig );
|
||||
|
||||
tabWidget->insertTab( page1, i18n("&General") );
|
||||
tabWidget->insertTab( buttonPage, i18n("&Buttons") );
|
||||
tabWidget->insertTab( pluginPage, i18n("&Configure [") +
|
||||
decorationListBox->currentText() + i18n("]") );
|
||||
|
||||
tabWidget->setTabEnabled( buttonPage, cbUseCustomButtonPositions->isChecked() );
|
||||
|
||||
connect( dropSite, SIGNAL(buttonAdded(char)), buttonSource, SLOT(hideButton(char)) );
|
||||
connect( dropSite, SIGNAL(buttonRemoved(char)), buttonSource, SLOT(showButton(char)) );
|
||||
connect( buttonSource, SIGNAL(buttonDropped()), dropSite, SLOT(removeClickedButton()) );
|
||||
connect( dropSite, SIGNAL(changed()), this, SLOT(slotSelectionChanged()) );
|
||||
connect( buttonSource, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()) );
|
||||
connect( decorationListBox, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) );
|
||||
connect( decorationListBox, SIGNAL(highlighted(const QString&)),
|
||||
SLOT(slotDecorationHighlighted(const QString&)) );
|
||||
connect( cbUseCustomButtonPositions, SIGNAL(clicked()), SLOT(slotSelectionChanged()) );
|
||||
connect( cbUseCustomButtonPositions, SIGNAL(toggled(bool)), SLOT(slotEnableButtonTab(bool)) );
|
||||
connect( cbShowToolTips, SIGNAL(clicked()), SLOT(slotSelectionChanged()) );
|
||||
// connect( cbUseMiniWindows, SIGNAL(clicked()), SLOT(slotSelectionChanged()) );
|
||||
|
||||
// Allow kwin dcop signal to update our selection list
|
||||
connectDCOPSignal("kwin", 0, "dcopResetAllClients()", "dcopUpdateClientList()", false);
|
||||
}
|
||||
|
||||
|
||||
KWinDecorationModule::~KWinDecorationModule()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Find all theme desktop files in all 'data' dirs owned by kwin.
|
||||
// And insert these into a DecorationInfo structure
|
||||
void KWinDecorationModule::findDecorations()
|
||||
{
|
||||
QStringList dirList = KGlobal::dirs()->findDirs("data", "kwin");
|
||||
QStringList::ConstIterator it;
|
||||
|
||||
for (it = dirList.begin(); it != dirList.end(); it++)
|
||||
{
|
||||
QDir d(*it);
|
||||
if (d.exists())
|
||||
for (QFileInfoListIterator it(*d.entryInfoList()); it.current(); ++it)
|
||||
{
|
||||
QString filename(it.current()->absFilePath());
|
||||
if (KDesktopFile::isDesktopFile(filename))
|
||||
{
|
||||
KDesktopFile desktopFile(filename);
|
||||
QString libName = desktopFile.readEntry("X-KDE-Library");
|
||||
|
||||
if (!libName.isEmpty())
|
||||
{
|
||||
DecorationInfo di;
|
||||
di.name = desktopFile.readName();
|
||||
di.libraryName = libName;
|
||||
decorations.append( di );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Fills the decorationListBox with a list of available kwin decorations
|
||||
void KWinDecorationModule::createDecorationList()
|
||||
{
|
||||
QValueList<DecorationInfo>::ConstIterator it;
|
||||
|
||||
// Sync with kwin hardcoded KDE2 style which has no desktop item
|
||||
decorationListBox->insertItem( i18n("KDE2 default") );
|
||||
|
||||
for (it = decorations.begin(); it != decorations.end(); ++it)
|
||||
{
|
||||
DecorationInfo info = *it;
|
||||
decorationListBox->insertItem( info.name );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Reset the decoration plugin to what the user just selected
|
||||
void KWinDecorationModule::slotDecorationHighlighted( const QString& s )
|
||||
{
|
||||
KConfig kwinConfig("kwinrc");
|
||||
kwinConfig.setGroup("Style");
|
||||
|
||||
// Let the user see config options for the currently selected decoration
|
||||
resetPlugin( &kwinConfig, &s );
|
||||
tabWidget->changeTab( pluginPage, i18n("&Configure [") +
|
||||
decorationListBox->currentText() + i18n("]") );
|
||||
}
|
||||
|
||||
|
||||
// This is the selection handler setting
|
||||
void KWinDecorationModule::slotSelectionChanged()
|
||||
{
|
||||
emit changed(true);
|
||||
}
|
||||
|
||||
|
||||
void KWinDecorationModule::slotEnableButtonTab(bool on)
|
||||
{
|
||||
tabWidget->setTabEnabled( buttonPage, on );
|
||||
}
|
||||
|
||||
|
||||
QString KWinDecorationModule::decorationName( QString& libName )
|
||||
{
|
||||
QString decoName;
|
||||
|
||||
QValueList<DecorationInfo>::Iterator it;
|
||||
for( it = decorations.begin(); it != decorations.end(); ++it )
|
||||
if ( (*it).libraryName == libName )
|
||||
{
|
||||
decoName = (*it).name;
|
||||
break;
|
||||
}
|
||||
|
||||
return decoName;
|
||||
}
|
||||
|
||||
|
||||
QString KWinDecorationModule::decorationLibName( const QString& name )
|
||||
{
|
||||
QString libName;
|
||||
|
||||
// Find the corresponding library name to that of
|
||||
// the current plugin name
|
||||
QValueList<DecorationInfo>::Iterator it;
|
||||
for( it = decorations.begin(); it != decorations.end(); ++it )
|
||||
if ( (*it).name == name )
|
||||
{
|
||||
libName = (*it).libraryName;
|
||||
break;
|
||||
}
|
||||
|
||||
if (libName.isEmpty())
|
||||
libName = "libkwindefault";
|
||||
|
||||
return libName;
|
||||
}
|
||||
|
||||
|
||||
// Loads/unloads and inserts the decoration config plugin into the
|
||||
// pluginPage, allowing for dynamic configuration of decorations
|
||||
void KWinDecorationModule::resetPlugin( KConfig* conf, const QString* currentDecoName )
|
||||
{
|
||||
// Config names are "libkwinicewm_config"
|
||||
// for "libkwinicewm" kwin client
|
||||
|
||||
QString oldName = oldLibraryName;
|
||||
oldName += "_config";
|
||||
|
||||
QString currentName;
|
||||
if (currentDecoName)
|
||||
currentName = decorationLibName( *currentDecoName ); // Use what the user selected
|
||||
else
|
||||
currentName = currentLibraryName; // Use what was read from readConfig()
|
||||
|
||||
currentName += "_config";
|
||||
|
||||
// Delete old plugin widget if it exists
|
||||
if (pluginObject)
|
||||
delete pluginObject;
|
||||
|
||||
// Use klibloader for library manipulation
|
||||
KLibLoader* loader = KLibLoader::self();
|
||||
|
||||
// Free the old library if possible
|
||||
if (!oldLibraryName.isNull())
|
||||
loader->unloadLibrary( QFile::encodeName(oldName) );
|
||||
|
||||
KLibrary* library = loader->library( QFile::encodeName(currentName) );
|
||||
if (library != NULL)
|
||||
{
|
||||
void* alloc_ptr = library->symbol("allocate_config");
|
||||
|
||||
if (alloc_ptr != NULL)
|
||||
{
|
||||
allocatePlugin = (QObject* (*)(KConfig* conf, QWidget* parent))alloc_ptr;
|
||||
pluginObject = allocatePlugin( conf, pluginPage );
|
||||
|
||||
// connect required signals and slots together...
|
||||
connect( pluginObject, SIGNAL(changed()), this, SLOT(slotSelectionChanged()) );
|
||||
connect( this, SIGNAL(pluginLoad(KConfig*)), pluginObject, SLOT(load(KConfig*)) );
|
||||
connect( this, SIGNAL(pluginSave(KConfig*)), pluginObject, SLOT(save(KConfig*)) );
|
||||
connect( this, SIGNAL(pluginDefaults()), pluginObject, SLOT(defaults()) );
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Display a message telling the user that the current decoration
|
||||
// does not have any configurable options (extended plugin interface not found)
|
||||
QWidget* plugin = new QGroupBox( 1, Qt::Horizontal, "", pluginPage );
|
||||
(void) new QLabel(
|
||||
i18n("<H3>No Configurable Options Available</H3>"
|
||||
"Sorry, no configurable options are available for the "
|
||||
"currently selected decoration."), plugin );
|
||||
|
||||
plugin->show();
|
||||
pluginObject = plugin;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Reads the kwin config settings, and sets all UI controls to those settings
|
||||
// Updating the config plugin if required
|
||||
void KWinDecorationModule::readConfig( KConfig* conf )
|
||||
{
|
||||
// General tab
|
||||
// ============
|
||||
cbUseCustomButtonPositions->setChecked( conf->readBoolEntry("CustomButtonPositions", false));
|
||||
tabWidget->setTabEnabled( buttonPage, cbUseCustomButtonPositions->isChecked() );
|
||||
cbShowToolTips->setChecked( conf->readBoolEntry("ShowToolTips", true ));
|
||||
// cbUseMiniWindows->setChecked( conf->readBoolEntry("MiniWindowBorders", false));
|
||||
|
||||
// Find the corresponding decoration name to that of
|
||||
// the current plugin library name
|
||||
|
||||
oldLibraryName = currentLibraryName;
|
||||
currentLibraryName = conf->readEntry("PluginLib", "libkwindefault");
|
||||
QString decoName = decorationName( currentLibraryName );
|
||||
|
||||
// If we are using the "default" kde client, use the "default" entry.
|
||||
if (decoName.isEmpty())
|
||||
decorationListBox->setSelected( 0, true );
|
||||
else
|
||||
// Update the decoration listbox
|
||||
decorationListBox->setSelected( decorationListBox->findItem( decoName ), true);
|
||||
|
||||
// Buttons tab
|
||||
// ============
|
||||
// Menu and sticky buttons are default on LHS
|
||||
dropSite->buttonsLeft = conf->readEntry("ButtonsOnLeft", "MS");
|
||||
// Help, Minimize, Maximize and Close are default on RHS
|
||||
dropSite->buttonsRight = conf->readEntry("ButtonsOnRight", "HIAX");
|
||||
dropSite->repaint(false);
|
||||
|
||||
buttonSource->showAllButtons();
|
||||
|
||||
// Step through the button lists, and hide the dnd button source items
|
||||
unsigned int i;
|
||||
for(i = 0; i < dropSite->buttonsLeft.length(); i++)
|
||||
buttonSource->hideButton( dropSite->buttonsLeft[i].latin1() );
|
||||
for(i = 0; i < dropSite->buttonsRight.length(); i++)
|
||||
buttonSource->hideButton( dropSite->buttonsRight[i].latin1() );
|
||||
|
||||
emit changed(false);
|
||||
}
|
||||
|
||||
|
||||
// Writes the selected user configuration to the kwin config file
|
||||
void KWinDecorationModule::writeConfig( KConfig* conf )
|
||||
{
|
||||
QString name = decorationListBox->currentText();
|
||||
QString libName = decorationLibName( name );
|
||||
|
||||
KConfig kwinConfig("kwinrc");
|
||||
kwinConfig.setGroup("Style");
|
||||
|
||||
// General settings
|
||||
conf->writeEntry("PluginLib", libName);
|
||||
conf->writeEntry("CustomButtonPositions", cbUseCustomButtonPositions->isChecked());
|
||||
conf->writeEntry("ShowToolTips", cbShowToolTips->isChecked());
|
||||
// conf->writeEntry("MiniWindowBorders", cbUseMiniWindows->isChecked());
|
||||
|
||||
// Button settings
|
||||
conf->writeEntry("ButtonsOnLeft", dropSite->buttonsLeft );
|
||||
conf->writeEntry("ButtonsOnRight", dropSite->buttonsRight );
|
||||
|
||||
oldLibraryName = currentLibraryName;
|
||||
currentLibraryName = libName;
|
||||
|
||||
// We saved, so tell kcmodule that there have been no new user changes made.
|
||||
emit changed(false);
|
||||
}
|
||||
|
||||
|
||||
void KWinDecorationModule::dcopUpdateClientList()
|
||||
{
|
||||
// Changes the current active ListBox item, and
|
||||
// Loads a new plugin configuration tab if required.
|
||||
KConfig kwinConfig("kwinrc");
|
||||
kwinConfig.setGroup("Style");
|
||||
|
||||
readConfig( &kwinConfig );
|
||||
resetPlugin( &kwinConfig );
|
||||
}
|
||||
|
||||
|
||||
// Virutal functions required by KCModule
|
||||
void KWinDecorationModule::load()
|
||||
{
|
||||
KConfig kwinConfig("kwinrc");
|
||||
kwinConfig.setGroup("Style");
|
||||
|
||||
// Reset by re-reading the config
|
||||
// The plugin doesn't need changing, as we have not saved
|
||||
readConfig( &kwinConfig );
|
||||
emit pluginLoad( &kwinConfig );
|
||||
}
|
||||
|
||||
|
||||
void KWinDecorationModule::save()
|
||||
{
|
||||
KConfig kwinConfig("kwinrc");
|
||||
kwinConfig.setGroup("Style");
|
||||
|
||||
writeConfig( &kwinConfig );
|
||||
emit pluginSave( &kwinConfig );
|
||||
|
||||
kwinConfig.sync();
|
||||
resetKWin();
|
||||
// resetPlugin() will get called via the above DCOP function
|
||||
}
|
||||
|
||||
|
||||
void KWinDecorationModule::defaults()
|
||||
{
|
||||
// Set the KDE defaults
|
||||
cbUseCustomButtonPositions->setChecked( false );
|
||||
cbShowToolTips->setChecked( true );
|
||||
// cbUseMiniWindows->setChecked( false);
|
||||
// Don't set default for now
|
||||
// decorationListBox->setSelected( 0, true ); // KDE2 default client
|
||||
|
||||
dropSite->buttonsLeft = "MS";
|
||||
dropSite->buttonsRight= "HIAX";
|
||||
dropSite->repaint(false);
|
||||
|
||||
buttonSource->showAllButtons();
|
||||
buttonSource->hideButton('M');
|
||||
buttonSource->hideButton('S');
|
||||
buttonSource->hideButton('H');
|
||||
buttonSource->hideButton('I');
|
||||
buttonSource->hideButton('A');
|
||||
buttonSource->hideButton('X');
|
||||
|
||||
// Set plugin defaults
|
||||
emit pluginDefaults();
|
||||
}
|
||||
|
||||
|
||||
QString KWinDecorationModule::quickHelp() const
|
||||
{
|
||||
return i18n( "<h1>Window Manager Decoration</h1>"
|
||||
"This module allows you to choose the window border decorations, "
|
||||
"as well as titlebar button positions and custom decoration options.");
|
||||
}
|
||||
|
||||
|
||||
const KAboutData* KWinDecorationModule::aboutData() const
|
||||
{
|
||||
KAboutData* about =
|
||||
new KAboutData(I18N_NOOP("kcmkwindecoration"),
|
||||
I18N_NOOP("Window Decoration Control Module"),
|
||||
0, 0, KAboutData::License_GPL,
|
||||
I18N_NOOP("(c) 2001 Karol Szwed"));
|
||||
about->addAuthor("Karol Szwed", 0, "gallium@kde.org");
|
||||
return about;
|
||||
}
|
||||
|
||||
|
||||
void KWinDecorationModule::resetKWin()
|
||||
{
|
||||
bool ok = kapp->dcopClient()->send("kwin", "KWinInterface",
|
||||
"reconfigure()", QByteArray());
|
||||
if (!ok)
|
||||
kdDebug() << "kcmkwindecoration: Could not reconfigure kwin" << endl;
|
||||
}
|
||||
|
||||
#include "kwindecoration.moc"
|
||||
// vim: ts=4
|
||||
|
117
kcmkwin/kwindecoration/kwindecoration.desktop
Normal file
117
kcmkwin/kwindecoration/kwindecoration.desktop
Normal file
|
@ -0,0 +1,117 @@
|
|||
[Desktop Entry]
|
||||
Exec=kcmshell kwindecoration
|
||||
Icon=kcmkwm
|
||||
Type=Application
|
||||
DocPath=kcontrol/window-deco.html
|
||||
|
||||
X-KDE-ModuleType=Library
|
||||
X-KDE-Library=kwindecoration
|
||||
X-KDE-FactoryName=kwindecoration
|
||||
|
||||
Name=Window Decoration
|
||||
Name[af]=VENSTER VERSIERING
|
||||
Name[az]=Pəncərə Dekorasiyası
|
||||
Name[bg]=Декорация на прозорец
|
||||
Name[cs]=Dekorace okna
|
||||
Name[da]=Vinduesdekoration
|
||||
Name[de]=Fensterdekorationen
|
||||
Name[el]=Διακόσμηση Παραθύρων
|
||||
Name[eo]=Fenestroaspekto
|
||||
Name[es]=Decoración de ventanas
|
||||
Name[et]=Akna dekoratsioonid
|
||||
Name[fi]=Ikkunoiden kehys
|
||||
Name[fr]=Décoration des fenêtres
|
||||
Name[he]=תונולח יטושיק
|
||||
Name[hu]=Ablakstílus
|
||||
Name[is]=Gluggaskreyting
|
||||
Name[it]=Decorazione finestra
|
||||
Name[ja]=ウィンドウ装飾
|
||||
Name[ko]=창 모양새
|
||||
Name[lt]=Lango dekoracija
|
||||
Name[lv]=Loga Dekorācija
|
||||
Name[mt]=Dekorazzjoni tal-Windows
|
||||
Name[nl]=Vensterdecoratie
|
||||
Name[no_NY]=Vindaugsdekorasjon
|
||||
Name[pl]=Dekoracja okna
|
||||
Name[pt_BR]=Decoração da Janela
|
||||
Name[pt]=Decoração da Janela
|
||||
Name[ru]=Оформление окон
|
||||
Name[sk]=Dekorácia okna
|
||||
Name[sl]=Okraski okna
|
||||
Name[sr]=Okviri prozora
|
||||
Name[sv]=Fönsterdekoration
|
||||
Name[ta]=º¡Çà «Äí¸¡Ãõ
|
||||
Name[tr]=Pencere Dekorasyonu
|
||||
Name[uk]=Обрамлення вікон
|
||||
Name[vi]=BềEtrí cửa sềE
|
||||
Name[zh_CN.GB2312]=窗口修饰
|
||||
|
||||
Comment=Window border theme
|
||||
Comment[af]=VENSTER GRENS TEMA
|
||||
Comment[az]=Pəncərə kənarı örtüsü
|
||||
Comment[bg]=Тема за рамката на прозорец
|
||||
Comment[cs]=Motiv okraje oken
|
||||
Comment[da]=Vindues kanttema
|
||||
Comment[de]=Design für Fensterrahmen
|
||||
Comment[el]=θέμα περιθωρίων παραθύρου
|
||||
Comment[eo]=Fenestrorando-etoso
|
||||
Comment[es]=Tema de bordes de ventanas
|
||||
Comment[et]=Akna dekoratsioonide teemad
|
||||
Comment[fi]=Ikkunoiden reunojen teema
|
||||
Comment[fr]=Thème de bordure des fenêtres
|
||||
Comment[he]=תונולחה תולובג ןונגס יוניש
|
||||
Comment[hu]=Ablakszegély-téma
|
||||
Comment[is]=Þema fyrir gluggakanta
|
||||
Comment[it]=Tema bordo finestre
|
||||
Comment[ja]=ウィンドウ枠テーマ
|
||||
Comment[ko]=창 테두리 테마
|
||||
Comment[lt]=Langų ribų tema
|
||||
Comment[lv]=Loga rāmja tēma
|
||||
Comment[mt]=Tema tal-bordura tal-windows
|
||||
Comment[nl]=Vensterrandthema
|
||||
Comment[no_NY]=Tema for vindaugskantar
|
||||
Comment[pl]=Motyw brzegu okna
|
||||
Comment[pt_BR]=Tema do contorno da janela
|
||||
Comment[pt]=Tema do contorno da janela
|
||||
Comment[ru]=тема границ окон
|
||||
Comment[sk]=Téma okraja okien
|
||||
Comment[sl]=Tema robov oken
|
||||
Comment[sv]=Tema för fönsterkanter
|
||||
Comment[ta]=º¡Çà µÃ ¯Õ¸Õ
|
||||
Comment[tr]=Pencere kenarı teması
|
||||
Comment[uk]=Тема для країв вікон
|
||||
Comment[vi]=Theme của viền Cửa sềE
|
||||
Comment[zh_CN.GB2312]=Windows 边框主题
|
||||
Comment[zh_TW.Big5]=Windows 邊界佈景
|
||||
|
||||
Keywords=kwin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration
|
||||
Keywords[af]=KWIN,VENSTER,BESTUURDER,GRENS,STYL,TEMA,KYK,GEVOEL,UITLEG,KNOPPIE,HANDVATSELe,RAND,KWM,VERSIERING
|
||||
Keywords[az]=kwin,pəncərə,idarəçi,kənar,tərz,örtü,görünüş,toxuma,yer,düymə,applet,kənar,kwm,dekorasiya,bəzək
|
||||
Keywords[cs]=kwin,okno,správce,okraj,styl,motiv,vzhled,rozvržení,tlačítko,úchytka,hrana,kwm,dekorace
|
||||
Keywords[da]=kwin,vindue,håndtering,kant,stil,tema,udseende,fornemmelse,layout,knapper,håndtag,kant,kwm,dekoration
|
||||
Keywords[de]=KWin,Kwm,Fenster,Manager,Rahmen,Design,Stil,Theme,Optik,Erscheinungsbild,Layout,Knöpfe,Ränder,Dekorationen
|
||||
Keywords[eo]=kwin,fenestro,administrilo,rando,stilo,etoso,aspekto,konduto,aranĝo,butono,eĝo,kwm,ornamo
|
||||
Keywords[es]=kwin,ventana,administrador,borde,estilo,tema,aspecto,comportamiento,disposición,botón,asa,esquina,kwm,decoración
|
||||
Keywords[et]=kwin,aken,haldur,piire,stiil,teema,välimus,kasutamine,nupud,serv,kwm,dekoratsioon
|
||||
Keywords[fi]=kwin,ikkuna,ikkunamanageri,ikkunoinnin hallintaohjelma,tausta,tyyli,teema,ulkonäkö,tuntuma,ulkoasu,painike,kahva,kulma,kwm,kehys
|
||||
Keywords[fr]=kwin,fenêtre,gestionnaire,bordure,style,thème,apparence,ergonomie,disposition,bouton,poignée,bord,kwm,décoration
|
||||
Keywords[he]=טושיק,הצק,תידי,רותפכ,הגוצת,הסירפ,השוחת,הארמ,אשונ תכרע,הכרע,ןונגס,תרגסמ,לובג,להנמ,תונולח,תונולחה להנמ
|
||||
Keywords[hu]=KWin,ablak,kezelő,szegély,stílus,téma,kinézet,megjelenés,elrendezés,nyomógomb,fogantyú,perem,kwm,ablakstílus
|
||||
Keywords[is]=kwin,gluggi,gluggastjóri,gluggar,kantar,rammi,skreyting,þema,stíll,útlit,takki,kwm,skraut
|
||||
Keywords[it]=kwin,window,manager,bordo,stile,tema,aspetto,feel,layout,pulsante,kwm,decorazione
|
||||
Keywords[ja]=kwin, ウィンドウ, マネージャ, 枠, スタイル, テーマ, ルック, フィール, レイアウト, ボタン, ハンドル エッジ, kwm, 装飾
|
||||
Keywords[lt]=kwin,window,manager,border,style,theme,look,feel,layout,buttons,handle,edge,kwm,decoration,langas,tvarkyklė,rėmelis,stilius,tema,žiūrėti,jausti,išdėstymas,mygtukai,kraštas,dekoracija
|
||||
Keywords[lv]=kwin, logs, menedžeris, rāmis, stils, tēma, skats, gars, izkārtojums, poga, rokturis, stūris, kwm, dekorācija
|
||||
Keywords[mt]=kwin, window, manager, border, bordura, stil, tema, apparenza, style, theme, look, feel, layout, tqassim, użu, button, handle, edge, kwm, decoration
|
||||
Keywords[nl]=kwin,window,manager,rand,stijl,theme,thema.look,uiterlijk,gedrag,feel,layout,opmaak,button,knoppen,handle,rand,kwm,decoratie,window manager,venster,vensterbeheer
|
||||
Keywords[no_NY]=kwin,vindauge,kant,bord,stil,tema,utsjånad,bunad,knapp,handtak,kwm,dekorasjon
|
||||
Keywords[pl]=kwin,okno,menedżer,brzeg,styl,motyw,wygląd,zachowanie,układ,przycisk,uchwyt,krawędź,kwm,dekoracja
|
||||
Keywords[pt_BR]=kwin, janela, gestor, contorno, estilo, tema, aparência, comportamento, visual, botão, pega, extremo, kwm, decoração
|
||||
Keywords[pt]=kwin, janela, gestor, contorno, estilo, tema, aparência, comportamento, visual, botão, pega, extremo, kwm, decoração
|
||||
Keywords[sk]=kwin,okno,správa,okraj,štýl,téma,vzhľad,rozloženie,tlačidlo,hrana,kwm,dekorácia,oblasť
|
||||
Keywords[sl]=kwin,okno,upravljalnik,rob,meja,slog,stil,tema,pogled,občutek,gumb,ročaj,rob,kwm,okrasek
|
||||
Keywords[sv]=kwin,fönster,hanterare,kant,stil,tema,utseende,känsla,layout,knapp,hantera,kant,kwm,dekoration
|
||||
Keywords[tr]=kwin,pencere,yönetici,kenar,stil,tema,görünüş,doku,yerleşim,düğme,tutamaç,kenar,kwm,dekorasyon
|
||||
Keywords[uk]=kwin,вікно,менеджер,границя,стиль,тема,вигляд,поведінка,розклад,кнопка,handle,край,kwm,обрамлення
|
||||
Keywords[vi]=kwin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration,cửa sềEtrình quản lí,viền,kiểu,cạnh,bềEtrí
|
||||
Keywords[zh_CN.GB2312]=kwin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration,窗口,管理器,边界,风格,主题,观感,部局,按钮,边缘,装饰
|
105
kcmkwin/kwindecoration/kwindecoration.h
Normal file
105
kcmkwin/kwindecoration/kwindecoration.h
Normal file
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
$Id$
|
||||
|
||||
This is the new kwindecoration kcontrol module
|
||||
|
||||
Copyright (c) 2001
|
||||
Karol Szwed <gallium@kde.org>
|
||||
http://gallium.n3.net/
|
||||
|
||||
Supports new kwin configuration plugins, and titlebar button position
|
||||
modification via dnd interface.
|
||||
|
||||
Based on original "kwintheme" (Window Borders)
|
||||
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
|
||||
*/
|
||||
|
||||
#ifndef KWINDECORATION_H
|
||||
#define KWINDECORATION_H
|
||||
|
||||
#include <kcmodule.h>
|
||||
#include <dcopobject.h>
|
||||
#include <buttons.h>
|
||||
#include <kconfig.h>
|
||||
#include <klibloader.h>
|
||||
|
||||
#include "kwindecorationIface.h"
|
||||
|
||||
class QListBox;
|
||||
class QCheckBox;
|
||||
class QTabWidget;
|
||||
class QVBox;
|
||||
|
||||
// Stores themeName and its corresponding library Name
|
||||
struct DecorationInfo
|
||||
{
|
||||
QString name;
|
||||
QString libraryName;
|
||||
};
|
||||
|
||||
|
||||
class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
KWinDecorationModule(QWidget* parent, const char* name, const QStringList &);
|
||||
~KWinDecorationModule();
|
||||
|
||||
virtual void load();
|
||||
virtual void save();
|
||||
virtual void defaults();
|
||||
|
||||
QString quickHelp() const;
|
||||
const KAboutData* aboutData() const;
|
||||
|
||||
virtual void dcopUpdateClientList();
|
||||
|
||||
signals:
|
||||
void changed(bool);
|
||||
void pluginLoad( KConfig* conf );
|
||||
void pluginSave( KConfig* conf );
|
||||
void pluginDefaults();
|
||||
|
||||
protected slots:
|
||||
// Allows us to turn "save" on
|
||||
void slotSelectionChanged();
|
||||
void slotEnableButtonTab(bool on);
|
||||
void slotDecorationHighlighted( const QString& s );
|
||||
|
||||
private:
|
||||
void readConfig( KConfig* conf );
|
||||
void writeConfig( KConfig* conf );
|
||||
void findDecorations();
|
||||
void createDecorationList();
|
||||
void updateSelection();
|
||||
QString decorationLibName( const QString& name );
|
||||
QString decorationName ( QString& libName );
|
||||
void resetPlugin( KConfig* conf, const QString* currentDecoName = 0 );
|
||||
void resetKWin();
|
||||
|
||||
QTabWidget* tabWidget;
|
||||
|
||||
// Page 1
|
||||
QListBox* decorationListBox;
|
||||
QValueList<DecorationInfo> decorations;
|
||||
QCheckBox* cbUseCustomButtonPositions;
|
||||
// QCheckBox* cbUseMiniWindows;
|
||||
QCheckBox* cbShowToolTips;
|
||||
|
||||
// Page 2
|
||||
ButtonDropSite* dropSite;
|
||||
ButtonSource* buttonSource;
|
||||
|
||||
// Page 3
|
||||
QObject* pluginObject;
|
||||
QString currentLibraryName;
|
||||
QString oldLibraryName;
|
||||
QVBox* pluginPage;
|
||||
QVBox* buttonPage;
|
||||
QObject* (*allocatePlugin)( KConfig* conf, QWidget* parent );
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
// vim: ts=4
|
29
kcmkwin/kwindecoration/kwindecorationIface.h
Normal file
29
kcmkwin/kwindecoration/kwindecorationIface.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
This is the new kwindecoration kcontrol module
|
||||
|
||||
Copyright (c) 2001
|
||||
Karol Szwed (gallium) <karlmail@usa.net>
|
||||
http://gallium.n3.net/
|
||||
|
||||
Supports new kwin configuration plugins, and titlebar button position
|
||||
modification via dnd interface.
|
||||
|
||||
Based on original "kwintheme" (Window Borders)
|
||||
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
|
||||
*/
|
||||
|
||||
#ifndef __KWINDECORATIONIFACE_H
|
||||
#define __KWINDECORATIONIFACE_H
|
||||
|
||||
#include <dcopobject.h>
|
||||
|
||||
class KWinDecorationIface: virtual public DCOPObject
|
||||
{
|
||||
K_DCOP
|
||||
public:
|
||||
|
||||
k_dcop:
|
||||
virtual void dcopUpdateClientList()=0;
|
||||
};
|
||||
|
||||
#endif
|
339
kcmkwin/kwindecoration/pixmaps.h
Normal file
339
kcmkwin/kwindecoration/pixmaps.h
Normal file
|
@ -0,0 +1,339 @@
|
|||
/*
|
||||
$Id$
|
||||
|
||||
This is the new kwindecoration kcontrol module
|
||||
|
||||
Copyright (c) 2001
|
||||
Karol Szwed <gallium@kde.org>
|
||||
http://gallium.n3.net/
|
||||
|
||||
Supports new kwin configuration plugins, and titlebar button position
|
||||
modification via dnd interface.
|
||||
|
||||
Based on original "kwintheme" (Window Borders)
|
||||
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
|
||||
*/
|
||||
|
||||
|
||||
// Button pixmaps (screenshots of kde1 buttons which all people know well now)
|
||||
// ============================================================================
|
||||
|
||||
/* XPM */
|
||||
const char * button_close_xpm[] = {
|
||||
"20 20 16 1",
|
||||
" c None",
|
||||
". c #F3F3F3",
|
||||
"+ c #F2F2F2",
|
||||
"@ c #F1F1F1",
|
||||
"# c #FFFFFF",
|
||||
"$ c #6E6E6E",
|
||||
"% c #F0F0F0",
|
||||
"& c #EFEFEF",
|
||||
"* c #EEEEEE",
|
||||
"= c #EDEDED",
|
||||
"- c #ECECEC",
|
||||
"; c #EBEBEB",
|
||||
"> c #EAEAEA",
|
||||
", c #E9E9E9",
|
||||
"' c #E8E8E8",
|
||||
") c #E7E7E7",
|
||||
"....................",
|
||||
"....................",
|
||||
"++++++++++++++++++++",
|
||||
"@@@@@@@@@@@@@@@@@@@@",
|
||||
"@@@@#$@@@@@@@@#$@@@@",
|
||||
"%%%%#$$%%%%%%#$$%%%%",
|
||||
"&&&&&#$$&&&&#$$&&&&&",
|
||||
"&&&&&&#$$&&#$$&&&&&&",
|
||||
"*******#$$#$$*******",
|
||||
"========#$$$========",
|
||||
"========#$$$========",
|
||||
"-------#$$#$$-------",
|
||||
";;;;;;#$$;;#$$;;;;;;",
|
||||
";;;;;#$$;;;;#$$;;;;;",
|
||||
">>>>#$$>>>>>>#$$>>>>",
|
||||
",,,,#$,,,,,,,,#$,,,,",
|
||||
",,,,,,,,,,,,,,,,,,,,",
|
||||
"''''''''''''''''''''",
|
||||
"))))))))))))))))))))",
|
||||
"))))))))))))))))))))"};
|
||||
|
||||
|
||||
/* XPM */
|
||||
const char * button_help_xpm[] = {
|
||||
"20 20 16 1",
|
||||
" c None",
|
||||
". c #F3F3F3",
|
||||
"+ c #F2F2F2",
|
||||
"@ c #F1F1F1",
|
||||
"# c #6E6E6E",
|
||||
"$ c #F0F0F0",
|
||||
"% c #FFFFFF",
|
||||
"& c #EFEFEF",
|
||||
"* c #EEEEEE",
|
||||
"= c #EDEDED",
|
||||
"- c #ECECEC",
|
||||
"; c #EBEBEB",
|
||||
"> c #EAEAEA",
|
||||
", c #E9E9E9",
|
||||
"' c #E8E8E8",
|
||||
") c #E7E7E7",
|
||||
"....................",
|
||||
"....................",
|
||||
"++++++++++++++++++++",
|
||||
"@@@@@@@@@@@@@@@@@@@@",
|
||||
"@@@@@@@@#####@@@@@@@",
|
||||
"$$$$$$$##%%%##$$$$$$",
|
||||
"&&&&&&&##%&&##%&&&&&",
|
||||
"&&&&&&&&%%&&##%&&&&&",
|
||||
"***********##%%*****",
|
||||
"==========##%%======",
|
||||
"=========##%%=======",
|
||||
"---------##%--------",
|
||||
";;;;;;;;;;%%;;;;;;;;",
|
||||
";;;;;;;;;##;;;;;;;;;",
|
||||
">>>>>>>>>##%>>>>>>>>",
|
||||
",,,,,,,,,,%%,,,,,,,,",
|
||||
",,,,,,,,,,,,,,,,,,,,",
|
||||
"''''''''''''''''''''",
|
||||
"))))))))))))))))))))",
|
||||
"))))))))))))))))))))"};
|
||||
|
||||
/* XPM */
|
||||
const char * button_maximize_xpm[] = {
|
||||
"20 20 16 1",
|
||||
" c None",
|
||||
". c #F3F3F3",
|
||||
"+ c #F2F2F2",
|
||||
"@ c #F1F1F1",
|
||||
"# c #FFFFFF",
|
||||
"$ c #F0F0F0",
|
||||
"% c #6E6E6E",
|
||||
"& c #EFEFEF",
|
||||
"* c #EEEEEE",
|
||||
"= c #EDEDED",
|
||||
"- c #ECECEC",
|
||||
"; c #EBEBEB",
|
||||
"> c #EAEAEA",
|
||||
", c #E9E9E9",
|
||||
"' c #E8E8E8",
|
||||
") c #E7E7E7",
|
||||
"....................",
|
||||
"....................",
|
||||
"++++++++++++++++++++",
|
||||
"@@@@@@@@@@@@@@@@@@@@",
|
||||
"@@@@###########@@@@@",
|
||||
"$$$$#%%%%%%%%%%$$$$$",
|
||||
"&&&&#%&&&&&&&#%&&&&&",
|
||||
"&&&&#%&&&&&&&#%&&&&&",
|
||||
"****#%*******#%*****",
|
||||
"====#%=======#%=====",
|
||||
"====#%=======#%=====",
|
||||
"----#%-------#%-----",
|
||||
";;;;#%;;;;;;;#%;;;;;",
|
||||
";;;;#%########%;;;;;",
|
||||
">>>>#%%%%%%%%%%>>>>>",
|
||||
",,,,,,,,,,,,,,,,,,,,",
|
||||
",,,,,,,,,,,,,,,,,,,,",
|
||||
"''''''''''''''''''''",
|
||||
"))))))))))))))))))))",
|
||||
"))))))))))))))))))))"};
|
||||
|
||||
/* XPM */
|
||||
const char * button_menu_xpm[] = {
|
||||
"20 20 21 1",
|
||||
" c None",
|
||||
". c #F3F3F3",
|
||||
"+ c #F2F2F2",
|
||||
"@ c #000000",
|
||||
"# c #F1F1F1",
|
||||
"$ c #FFFFFF",
|
||||
"% c #C3C3C3",
|
||||
"& c #F0F0F0",
|
||||
"* c #EFEFEF",
|
||||
"= c #FFFFC0",
|
||||
"- c #FFDCA8",
|
||||
"; c #EEEEEE",
|
||||
"> c #C05800",
|
||||
", c #EDEDED",
|
||||
"' c #ECECEC",
|
||||
") c #EBEBEB",
|
||||
"! c #808080",
|
||||
"~ c #EAEAEA",
|
||||
"{ c #E9E9E9",
|
||||
"] c #E8E8E8",
|
||||
"^ c #E7E7E7",
|
||||
"....................",
|
||||
"....................",
|
||||
"+++++++++@@+++++++++",
|
||||
"####@@@@@$$@@@@@####",
|
||||
"####@$$@%%%%@$$@####",
|
||||
"&&&@@$$@@@@@@$$@&&&&",
|
||||
"***@=@$$$$$$$$$@****",
|
||||
"***@-@$%%%%%%$$@****",
|
||||
";;;;>=@$$$$$$$$@;;;;",
|
||||
",,,,@-@$%%%%%$$@,,,,",
|
||||
",,,,@>=@$$$$$$$@,,,,",
|
||||
"''''@@-@$%%%%$$@''''",
|
||||
"))))@!>=@$$$$$$@))))",
|
||||
"))))@$@-@$$$$$$@))))",
|
||||
"~~~~@$!>@$$$$$$@~~~~",
|
||||
"{{{{@$$!@$$$$$$@{{{{",
|
||||
"{{{{@!!!!!!!!!!@{{{{",
|
||||
"]]]]@@@@@@@@@@@@]]]]",
|
||||
"^^^^^^^^^^^^^^^^^^^^",
|
||||
"^^^^^^^^^^^^^^^^^^^^"};
|
||||
|
||||
/* XPM */
|
||||
const char * button_minimize_xpm[] = {
|
||||
"20 20 16 1",
|
||||
" c None",
|
||||
". c #F3F3F3",
|
||||
"+ c #F2F2F2",
|
||||
"@ c #F1F1F1",
|
||||
"# c #F0F0F0",
|
||||
"$ c #EFEFEF",
|
||||
"% c #EEEEEE",
|
||||
"& c #FFFFFF",
|
||||
"* c #EDEDED",
|
||||
"= c #6E6E6E",
|
||||
"- c #ECECEC",
|
||||
"; c #EBEBEB",
|
||||
"> c #EAEAEA",
|
||||
", c #E9E9E9",
|
||||
"' c #E8E8E8",
|
||||
") c #E7E7E7",
|
||||
"....................",
|
||||
"....................",
|
||||
"++++++++++++++++++++",
|
||||
"@@@@@@@@@@@@@@@@@@@@",
|
||||
"@@@@@@@@@@@@@@@@@@@@",
|
||||
"####################",
|
||||
"$$$$$$$$$$$$$$$$$$$$",
|
||||
"$$$$$$$$$$$$$$$$$$$$",
|
||||
"%%%%%%%%%&&&%%%%%%%%",
|
||||
"*********&*=********",
|
||||
"*********&==********",
|
||||
"--------------------",
|
||||
";;;;;;;;;;;;;;;;;;;;",
|
||||
";;;;;;;;;;;;;;;;;;;;",
|
||||
">>>>>>>>>>>>>>>>>>>>",
|
||||
",,,,,,,,,,,,,,,,,,,,",
|
||||
",,,,,,,,,,,,,,,,,,,,",
|
||||
"''''''''''''''''''''",
|
||||
"))))))))))))))))))))",
|
||||
"))))))))))))))))))))"};
|
||||
|
||||
|
||||
/* XPM */
|
||||
const char * button_sticky_xpm[] = {
|
||||
"20 20 17 1",
|
||||
" c None",
|
||||
". c #F3F3F3",
|
||||
"+ c #F2F2F2",
|
||||
"@ c #F1F1F1",
|
||||
"# c #F0F0F0",
|
||||
"$ c #6E6E6E",
|
||||
"% c #EFEFEF",
|
||||
"& c #FFFFFF",
|
||||
"* c #EEEEEE",
|
||||
"= c #B7B7B7",
|
||||
"- c #EDEDED",
|
||||
"; c #ECECEC",
|
||||
"> c #EBEBEB",
|
||||
", c #EAEAEA",
|
||||
"' c #E9E9E9",
|
||||
") c #E8E8E8",
|
||||
"! c #E7E7E7",
|
||||
"....................",
|
||||
"....................",
|
||||
"++++++++++++++++++++",
|
||||
"@@@@@@@@@@@@@@@@@@@@",
|
||||
"@@@@@@@@@@@@@@@@@@@@",
|
||||
"########$$#####$####",
|
||||
"%%%%%%%%$&$%%%$$%%%%",
|
||||
"%%%%%%%%$&&$$$&$%%%%",
|
||||
"**&&&&&&$=&=&=&$****",
|
||||
"--======$=&=&=&$----",
|
||||
"--$$$$$$$==$=$=$----",
|
||||
";;;;;;;;$=$$$$$$;;;;",
|
||||
">>>>>>>>$$$>>>$$>>>>",
|
||||
">>>>>>>>$$>>>>>$>>>>",
|
||||
",,,,,,,,,,,,,,,,,,,,",
|
||||
"''''''''''''''''''''",
|
||||
"''''''''''''''''''''",
|
||||
"))))))))))))))))))))",
|
||||
"!!!!!!!!!!!!!!!!!!!!",
|
||||
"!!!!!!!!!!!!!!!!!!!!"};
|
||||
|
||||
/* XPM */
|
||||
const char * button_spacer_xpm[] = {
|
||||
"20 20 15 1",
|
||||
" c None",
|
||||
". c #F3F3F3",
|
||||
"+ c #F2F2F2",
|
||||
"@ c #F1F1F1",
|
||||
"# c #F0F0F0",
|
||||
"$ c #6E6E6E",
|
||||
"% c #EFEFEF",
|
||||
"& c #EEEEEE",
|
||||
"* c #EDEDED",
|
||||
"= c #ECECEC",
|
||||
"- c #EBEBEB",
|
||||
"; c #EAEAEA",
|
||||
"> c #E9E9E9",
|
||||
", c #E8E8E8",
|
||||
"' c #E7E7E7",
|
||||
"....................",
|
||||
"....................",
|
||||
"++++++++++++++++++++",
|
||||
"@@@@@@@@@@@@@@@@@@@@",
|
||||
"@@@@@@@@@@@@@@@@@@@@",
|
||||
"######$######$######",
|
||||
"%%%%%$$%%%%%%$$%%%%%",
|
||||
"%%%%$$%%%%%%%%$$%%%%",
|
||||
"&&&$$&&&&&&&&&&$$&&&",
|
||||
"**$$************$$**",
|
||||
"***$$**********$$***",
|
||||
"====$$========$$====",
|
||||
"-----$$------$$-----",
|
||||
"------$------$------",
|
||||
";;;;;;;;;;;;;;;;;;;;",
|
||||
">>>>>>>>>>>>>>>>>>>>",
|
||||
">>>>>>>>>>>>>>>>>>>>",
|
||||
",,,,,,,,,,,,,,,,,,,,",
|
||||
"''''''''''''''''''''",
|
||||
"''''''''''''''''''''"};
|
||||
|
||||
/* XPM */
|
||||
const char * titlebarspacer_xpm[] = {
|
||||
"6 20 7 1",
|
||||
" c None",
|
||||
". c #FFFFFF",
|
||||
"+ c #E9E9E9",
|
||||
"@ c #D3D3D3",
|
||||
"# c #BEBEBE",
|
||||
"$ c #A8A8A8",
|
||||
"% c #929292",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%",
|
||||
".+@#$%"};
|
||||
|
||||
// vim: ts=4
|
12
kcmkwin/kwinoptions/AUTHORS
Normal file
12
kcmkwin/kwinoptions/AUTHORS
Normal file
|
@ -0,0 +1,12 @@
|
|||
Please use http://bugs.kde.org to report bugs.
|
||||
The following authors may have retired by the time you read this :-)
|
||||
|
||||
KWM Configuration Module:
|
||||
|
||||
Pat Dowler (dowler@pt1B1106.FSH.UVic.CA)
|
||||
|
||||
Bernd Wuebben <wuebben@kde.org>
|
||||
|
||||
Conversion to kcontrol applet:
|
||||
|
||||
Matthias Hoelzer (hoelzer@physik.uni-wuerzburg.de)
|
51
kcmkwin/kwinoptions/ChangeLog
Normal file
51
kcmkwin/kwinoptions/ChangeLog
Normal file
|
@ -0,0 +1,51 @@
|
|||
1999-03-06 Mario Weilguni <mweilguni@kde.org>
|
||||
|
||||
* changes for Qt 2.0
|
||||
|
||||
1998-11-29 Alex Zepeda <garbanzo@hooked.net>
|
||||
|
||||
* pics/Makefile.am, pics/mini/Makefile.am: Install icons from their
|
||||
"proper" subdirectories.
|
||||
|
||||
1998-11-20 Cristian Tibirna <ctibirna@gch.ulaval.ca>
|
||||
|
||||
* advanced.[cpp,h]: fixed bugs. Mostly a disgusting one:
|
||||
no lists saving for the special options (Decor, Focus a.o.)
|
||||
|
||||
1998-11-09 Cristian Tibirna <ctibirna@gch.ulaval.ca>
|
||||
|
||||
* advanced.[cpp,h] : new tab for some of the last of the
|
||||
kwm's options which remained out of the GUI config:
|
||||
CtrlTab, TraverseAll, AltTabeMode, Button3Grab and
|
||||
the filter lists for decorations, focus, stickyness,
|
||||
session management ignore ( I kinda disklike the solution
|
||||
I got for the latest)
|
||||
|
||||
1998-11-06 Cristian Tibirna <ctibirna@gch.ulaval.ca>
|
||||
|
||||
* titlebar.[cpp,h] : added title alignment config
|
||||
|
||||
1998-10-23 Cristian Tibirna <ctibirna@gch.ulaval.ca>
|
||||
|
||||
* titlebar.cpp: completed what Matthias started (took out
|
||||
useless checks)
|
||||
* widows.cpp: make autoRaise toggling clearer
|
||||
|
||||
1998-10-22 Matthias Ettrich <ettrich@kde.org>
|
||||
|
||||
* titlebar.cpp: less options on titlebar doubleclick
|
||||
|
||||
1998-10-21 Cristian Tibirna <ctibirna@gch.ulaval.ca>
|
||||
|
||||
* desktop.[cpp,h]: now with consistent layout use
|
||||
resizeEvent() deleted
|
||||
|
||||
1998-10-19 Cristian Tibirna <ctibirna@gch.ulaval.ca>
|
||||
|
||||
* windows.[cpp,h]: now with consistent layout use
|
||||
resizeEvent() deleted
|
||||
|
||||
1998-10-18 Cristian Tibirna <ctibirna@gch.ulaval.ca>
|
||||
|
||||
* titlebar.[cpp,h]: fixed the (in)activetitleebar pixmap selection
|
||||
1998-10-21 (still buggy, don't quite understand why)
|
25
kcmkwin/kwinoptions/Makefile.am
Normal file
25
kcmkwin/kwinoptions/Makefile.am
Normal file
|
@ -0,0 +1,25 @@
|
|||
# $Id$
|
||||
# kdebase/kcontrol/kwm
|
||||
|
||||
METASOURCES = AUTO
|
||||
INCLUDES = $(all_includes)
|
||||
|
||||
kde_module_LTLIBRARIES = libkcm_kwinoptions.la
|
||||
|
||||
libkcm_kwinoptions_la_SOURCES = windows.cpp mouse.cpp main.cpp
|
||||
libkcm_kwinoptions_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined
|
||||
libkcm_kwinoptions_la_LIBADD = $(LIB_KDEUI)
|
||||
|
||||
noinst_HEADERS = windows.h mouse.h main.h
|
||||
|
||||
messages:
|
||||
$(XGETTEXT) *.cpp -o $(podir)/kcmkwm.pot
|
||||
|
||||
data_DATA = kwinoptions.desktop
|
||||
datadir = $(kde_appsdir)/Settings/LookNFeel
|
||||
|
||||
install-data-local: uninstall.desktop
|
||||
$(mkinstalldirs) $(kde_appsdir)/Settings/LookNFeel/Windows
|
||||
$(INSTALL_DATA) $(srcdir)/uninstall.desktop $(kde_appsdir)/Settings/LookNFeel/Windows/actions.desktop
|
||||
$(INSTALL_DATA) $(srcdir)/uninstall.desktop $(kde_appsdir)/Settings/LookNFeel/Windows/kwinmouse.desktop
|
||||
$(INSTALL_DATA) $(srcdir)/uninstall.desktop $(kde_appsdir)/Settings/LookNFeel/Windows/mouse.desktop
|
92
kcmkwin/kwinoptions/kwinoptions.desktop
Normal file
92
kcmkwin/kwinoptions/kwinoptions.desktop
Normal file
|
@ -0,0 +1,92 @@
|
|||
[Desktop Entry]
|
||||
Icon=kcmkwm
|
||||
Type=Application
|
||||
Exec=kcmshell kwinoptions
|
||||
DocPath=kcontrol/window-behavior.html
|
||||
|
||||
X-KDE-ModuleType=Library
|
||||
X-KDE-Library=kwinoptions
|
||||
X-KDE-FactoryName=kwinoptions
|
||||
|
||||
Name=Window Behavior
|
||||
Name[af]=VENSTER GEDRAG
|
||||
Name[az]=Pəncərə Davranışı
|
||||
Name[bg]=Поведение на прозореца
|
||||
Name[br]=Emzalc'h ar prenester
|
||||
Name[bs]=Funkcioniranje prozora
|
||||
Name[ca]=Comportament de les finestres
|
||||
Name[cs]=Chování oken
|
||||
Name[da]=Vinduesopførsel
|
||||
Name[de]=Fenstereigenschaften
|
||||
Name[el]=Συμπεριφορά Παραθύρων
|
||||
Name[en_GB]=Window Behaviour
|
||||
Name[eo]=Fenestrokonduto
|
||||
Name[es]=Comportamiento de ventanas
|
||||
Name[et]=Akende käitumine
|
||||
Name[eu]=Lehioen Portamoldea
|
||||
Name[fi]=Ikkunoiden toiminta
|
||||
Name[fr]=Comportement des fenêtres
|
||||
Name[gl]=Comportamento das Fiestras
|
||||
Name[he]=תונולח
|
||||
Name[hr]=Funkcioniranje prozora
|
||||
Name[hu]=Ablakbeállítások
|
||||
Name[is]=Hegðun Glugga
|
||||
Name[it]=Comportamento delle finestre
|
||||
Name[ja]=ウィンドウの挙動
|
||||
Name[ko]=창 움직임
|
||||
Name[lt]=Langų elgsena
|
||||
Name[lv]=Loga izturēšanās
|
||||
Name[mi]=Whanonga Matapihi
|
||||
Name[mk]=Прозорци
|
||||
Name[mt]=Imġieba tal-Window
|
||||
Name[nl]=Venstergedrag
|
||||
Name[no]=Vindu-oppførsel
|
||||
Name[no_NY]=Vindaugsåtferd
|
||||
Name[oc]=Comportament de las finestras
|
||||
Name[pl]=Zachowanie okna
|
||||
Name[pt_BR]=Comportamento das Janelas
|
||||
Name[pt]=Comportamento das Janelas
|
||||
Name[ru]=Поведение окна
|
||||
Name[sk]=Spôsob režimu okna
|
||||
Name[sl]=Obnašanje oken
|
||||
Name[sr]=Ponašanje prozora
|
||||
Name[sv]=Fönsterbeteende
|
||||
Name[ta]=º¡Çà ¿¼ò¨¾
|
||||
Name[tr]=Pencere Davranışı
|
||||
Name[uk]=Поведінка вікон
|
||||
Name[vi]=Thái đềEcủa cửa sềEbehavior)
|
||||
Name[zh_CN.GB2312]=窗口行为
|
||||
Name[zh_TW.Big5]=視窗行為
|
||||
|
||||
Keywords=focus,placement,window behaviour,animation,raise,auto raise,windows,frame,titlebar,doubleclick
|
||||
Keywords[af]=FOKUS,PLASING,VENSTER OPTREDE,ANIMASIE,LIG,OUTO LIG,VENSTERs,RAAM,TITELBAR,DUBBEL KLIEK
|
||||
Keywords[az]=fokus,fokus davranış şəkli,pəncərə yeri,pəncərə davranışı,Yer davranış şəkli,animasiya,Qaldır,Avtomatik Qaldır,çərçicə,cüt tıqla
|
||||
Keywords[cs]=Zaměření,Umístění oken,Chování oken,Animace,Okna,Rámeček,Titulek,Dvojklik
|
||||
Keywords[da]=fokus,placering,vinduesopførsel,animering,Hæv,autohæv,vinduer,ramme,titellinie,dobbeltklik
|
||||
Keywords[de]=Fokus,Aktivierung,Fensterplatzierung,Fensterverhalten,Vordergrund,Animation,Autom. im Vordergrund,Fenster,Rahmen,Titelleiste,Doppelklick
|
||||
Keywords[el]=εστίαση,τοποθέτηση,συμπεριφορά παραθύρων,animation,ανύψωση,αυτόματη ανύψωση,παράθυρα,πλαίσιο,γραμμή τίτλου,διπλό κλικ
|
||||
Keywords[eo]=fokuso,lokigo,fenestrokonduto,spektaklo,malfonigo,aŭtomalfonigo,fenestro,kadro,titollistelo,duklako
|
||||
Keywords[es]=foco,ubicación,comportamiento de ventanas,animación,subir,auto subir,ventanas,marco,barra de título,doble pulsación
|
||||
Keywords[et]=fookus,asetus,akende käitumine,animatsioon,tõstmine,automaatne tõstmine,aknad,raam,tiitliriba,topeltklikk
|
||||
Keywords[fi]=fokus,sijoittaminen,ikkunan toiminta,animaatio,nosto,automaattinosto,ikkunat,kehys,otsikkorivi,tuplanapsautus
|
||||
Keywords[fr]=focus,gestion du focus,fenêtre,placement des fenêtres,comportement des fenêtres,animation,fenêtres,barre de titre,double clic,souris,boutons de la souris,dessus,dessous,raise,auto raise
|
||||
Keywords[he]=הלופכ הציחל,תרתוכ תרוש,תרגסמ,תונולח,המדקל תיטמוטוא האבה,המדקל האבה,השפנה,היצמינא,תונולח תוגהנתה,םוקימ,תודקמתה
|
||||
Keywords[hu]=fókuszálási módszer,ablakelhelyezés,az ablakok viselkedése,animáció,felemelés,automatikus felemelés,ablakok,keret,címsor,dupla kattintás
|
||||
Keywords[is]=virkni glugga,staðsetning,hegðun,högun glugga,hækka,hækka sjálfkrafa,gluggar,titilslá,titilrönd,tvísmella
|
||||
Keywords[it]=politica focus, piazzamento finestre, comportamento finestre,animazione,alza,alza automaticamente,finestre,cornice,barra titolo,doppio clic
|
||||
Keywords[ja]=フォーカス,配置,ウィンドウの挙動,アニメーション,前へ,自動的に前へ,ウィンドウ,フレーム,タイトルバー,ダブルクリック
|
||||
Keywords[ko]=focus,placement,window behaviour,animation,raise,auto raise,windows,frame,titlebar,doubleclick,포커스,촛점,초점,창 움직임,숨김,올리기,내리기,스스로 올리기,창,제목줄,타이틀 바,두번 누르기,더블 클릭
|
||||
Keywords[lt]=focus,placement,window behaviour,animation,raise,auto raise,windows,frame,titlebar,doubleclick,lango išdėstymas,elgesys,langai,rėmelis,lango antraštė
|
||||
Keywords[lv]=fokuss,novietojums,loga izturēšanās,animācija,celt,auto celt,logi,kadrs,titlujosla,dubultklikšķis
|
||||
Keywords[nl]=focusbeleid,vensterplaatsing,venstergedrag,focus,window,plaatsing,plaatsingbeleid,animatie,voorgrond,vensters,frame,kader,dubbelklikken
|
||||
Keywords[no]=fokuspolitikk,vinduplassering,vinduoppfrsel
|
||||
Keywords[no_NY]=fokus,vindaugsplassering,vindaugsåtferd,plassering,animasjon,hev,autohev,vindauge,ramme,tittellinje,dobbelklikk
|
||||
Keywords[pl]=ognisko,układanie okien,zachowanie okien,animacja,podniesienie,automatyczne podniesienie,okna,ramka,belka tytułowa,podwójne kliknięcie
|
||||
Keywords[pt_BR]=foco,posicionamento,comportamento das janelas,política de foco,posicionamento de janelas,Política de posicionamento,animação,elevar,auto-elevar,clique duplo,barra de título,moldura,frame,janelas
|
||||
Keywords[pt]=política de primeiro plano,colocação das janelas,comportamento das janelas,animação,elevar,auto-elevar,janelas,moldura,título,duplo 'click'
|
||||
Keywords[sk]=umiestnenie okna, spôsob práce okna,fokus,chovanie okna,animácia,automatické vyzdvihnutie,dvojklik,titulok,rám
|
||||
Keywords[sl]=politika fokusiranja,postavitev oken,obnašanje oken,animacija,dvig,samodejni dvig,okna,okvir,naslovna letev,dvojni klik
|
||||
Keywords[sv]=fokus,placering,fönsterbeteende,animering,höj,höj automatiskt,fönster,ram,titelrad,dubbelklick
|
||||
Keywords[tr]=odak,odak davranış biçimi,pencere yerleşimi,pencere davranışı,Yerleşim davranış biçimi,animasyon,Kaldır,Otomatik Kaldır,çerçeve,çift tıkla
|
||||
Keywords[uk]=фокуса,вікна,поведінка вікна,розташовування,анімація,підняти,підніматиавтоматично,вікна,рамки,заголовок,подвійне клацання
|
||||
Keywords[zh_CN.GB2312]=focus,placement,window behaviour,animation,raise,auto raise,windows,frame,titlebar,doubleclick,焦点,窗口放置,窗口行为,动画,窗口
|
123
kcmkwin/kwinoptions/main.cpp
Normal file
123
kcmkwin/kwinoptions/main.cpp
Normal file
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
*
|
||||
* Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <qlayout.h>
|
||||
|
||||
#include <dcopclient.h>
|
||||
|
||||
#include <kapplication.h>
|
||||
#include <kglobal.h>
|
||||
#include <klocale.h>
|
||||
#include <kconfig.h>
|
||||
#include <kgenericfactory.h>
|
||||
|
||||
#include "mouse.h"
|
||||
#include "windows.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
typedef KGenericFactory<KWinOptions, QWidget> KWinOptFactory;
|
||||
K_EXPORT_COMPONENT_FACTORY( libkcm_kwinoptions, KWinOptFactory("kcmkwm") );
|
||||
/*
|
||||
extern "C" {
|
||||
KCModule *create_kwinoptions ( QWidget *parent, const char* name)
|
||||
{
|
||||
//CT there's need for decision: kwm or kwin?
|
||||
KGlobal::locale()->insertCatalogue("kcmkwm");
|
||||
return new KWinOptions( parent, name);
|
||||
}
|
||||
}
|
||||
*/
|
||||
KWinOptions::KWinOptions(QWidget *parent, const char *name, const QStringList &)
|
||||
: KCModule(parent, name)
|
||||
{
|
||||
mConfig = new KConfig("kwinrc", false, true);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
tab = new QTabWidget(this);
|
||||
layout->addWidget(tab);
|
||||
|
||||
mFocus = new KFocusConfig(mConfig, this, "KWin Focus Config");
|
||||
tab->addTab(mFocus, i18n("&Focus"));
|
||||
connect(mFocus, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
|
||||
mActions = new KActionsConfig(mConfig, this, "KWin Actions");
|
||||
tab->addTab(mActions, i18n("&Actions"));
|
||||
connect(mActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
|
||||
mMoving = new KMovingConfig(mConfig, this, "KWin Moving");
|
||||
tab->addTab(mMoving, i18n("&Moving"));
|
||||
connect(mMoving, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
|
||||
mAdvanced = new KAdvancedConfig(mConfig, this, "KWin Advanced");
|
||||
tab->addTab(mAdvanced, i18n("Ad&vanced"));
|
||||
connect(mAdvanced, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
}
|
||||
|
||||
|
||||
void KWinOptions::load()
|
||||
{
|
||||
mConfig->reparseConfiguration();
|
||||
mFocus->load();
|
||||
mActions->load();
|
||||
mMoving->load();
|
||||
mAdvanced->load();
|
||||
}
|
||||
|
||||
|
||||
void KWinOptions::save()
|
||||
{
|
||||
mFocus->save();
|
||||
mActions->save();
|
||||
mMoving->save();
|
||||
mAdvanced->save();
|
||||
|
||||
// Send signal to kwin
|
||||
mConfig->sync();
|
||||
if ( !kapp->dcopClient()->isAttached() )
|
||||
kapp->dcopClient()->attach();
|
||||
kapp->dcopClient()->send("kwin*", "", "reconfigure()", "");
|
||||
}
|
||||
|
||||
|
||||
void KWinOptions::defaults()
|
||||
{
|
||||
mFocus->defaults();
|
||||
mActions->defaults();
|
||||
mMoving->defaults();
|
||||
mAdvanced->defaults();
|
||||
}
|
||||
|
||||
QString KWinOptions::quickHelp() const
|
||||
{
|
||||
return i18n("<h1>Window Behavior</h1> Here you can customize the way windows behave when being"
|
||||
" moved, resized or clicked on. You can also specify a focus policy as well as a placement"
|
||||
" policy for new windows. "
|
||||
" <p>Please note that this configuration will not take effect if you don't use"
|
||||
" KWin as your window manager. If you do use a different window manager, please refer to its documentation"
|
||||
" for how to customize window behavior.");
|
||||
}
|
||||
|
||||
void KWinOptions::moduleChanged(bool state)
|
||||
{
|
||||
emit changed(state);
|
||||
}
|
||||
|
||||
|
||||
#include "main.moc"
|
67
kcmkwin/kwinoptions/main.h
Normal file
67
kcmkwin/kwinoptions/main.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* main.h
|
||||
*
|
||||
* Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
|
||||
*
|
||||
* Requires the Qt widget libraries, available at no cost at
|
||||
* http://www.troll.no/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __MAIN_H__
|
||||
#define __MAIN_H__
|
||||
|
||||
#include <qtabwidget.h>
|
||||
#include <kcmodule.h>
|
||||
|
||||
class KConfig;
|
||||
class KFocusConfig;
|
||||
class KActionsConfig;
|
||||
class KAdvancedConfig;
|
||||
|
||||
class KWinOptions : public KCModule
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
KWinOptions(QWidget *parent, const char *name, const QStringList &);
|
||||
|
||||
void load();
|
||||
void save();
|
||||
void defaults();
|
||||
QString quickHelp() const;
|
||||
|
||||
|
||||
protected slots:
|
||||
|
||||
void moduleChanged(bool state);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
QTabWidget *tab;
|
||||
|
||||
KFocusConfig *mFocus;
|
||||
KActionsConfig *mActions;
|
||||
KMovingConfig *mMoving;
|
||||
KAdvancedConfig *mAdvanced;
|
||||
|
||||
KConfig *mConfig;
|
||||
};
|
||||
|
||||
#endif
|
506
kcmkwin/kwinoptions/mouse.cpp
Normal file
506
kcmkwin/kwinoptions/mouse.cpp
Normal file
|
@ -0,0 +1,506 @@
|
|||
/*
|
||||
*
|
||||
* Copyright (c) 1998 Matthias Ettrich <ettrich@kde.org>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qlayout.h>
|
||||
#include <qvgroupbox.h>
|
||||
#include <qgrid.h>
|
||||
#include <qsizepolicy.h>
|
||||
|
||||
#include <dcopclient.h>
|
||||
#include <klocale.h>
|
||||
#include <kconfig.h>
|
||||
#include <kdialog.h>
|
||||
#include <kglobalsettings.h>
|
||||
#include <kseparator.h>
|
||||
#include <kshortcut.h> // For KKeyNative::keyboardHasMetaKey()
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include "mouse.h"
|
||||
#include "mouse.moc"
|
||||
|
||||
|
||||
KActionsConfig::~KActionsConfig ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
KActionsConfig::KActionsConfig (KConfig *_config, QWidget * parent, const char *name)
|
||||
: KCModule (parent, name), config(_config)
|
||||
{
|
||||
QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3;
|
||||
QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
|
||||
QGrid *grid;
|
||||
QGroupBox *box;
|
||||
QLabel *label;
|
||||
QString strMouseButton1, strMouseButton3;
|
||||
QString txtButton1, txtButton3;
|
||||
QStringList items;
|
||||
bool leftHandedMouse = ( KGlobalSettings::mouseSettings().handed == KGlobalSettings::KMouseSettings::LeftHanded);
|
||||
|
||||
/** Titlebar doubleclick ************/
|
||||
|
||||
QHBoxLayout *hlayout = new QHBoxLayout(layout);
|
||||
|
||||
label = new QLabel(i18n("&Titlebar double-click:"), this);
|
||||
hlayout->addWidget(label);
|
||||
QWhatsThis::add( label, i18n("Here you can customize mouse click behavior when double clicking on the"
|
||||
" titlebar of a window.") );
|
||||
|
||||
QComboBox* combo = new QComboBox(this);
|
||||
combo->insertItem(i18n("Maximize"));
|
||||
combo->insertItem(i18n("Maximize (vertical only)"));
|
||||
combo->insertItem(i18n("Maximize (horizontal only)"));
|
||||
combo->insertItem(i18n("Shade"));
|
||||
combo->insertItem(i18n("Lower"));
|
||||
combo->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
hlayout->addWidget(combo);
|
||||
coTiDbl = combo;
|
||||
QWhatsThis::add(combo, i18n("Behavior on <em>double</em> click into the titlebar."));
|
||||
|
||||
label->setBuddy(combo);
|
||||
|
||||
/** Titlebar and frame **************/
|
||||
|
||||
box = new QVGroupBox( i18n("Titlebar and frame"), this, "Titlebar and frame");
|
||||
box->layout()->setMargin(KDialog::marginHint());
|
||||
box->layout()->setSpacing(KDialog::spacingHint());
|
||||
layout->addWidget(box);
|
||||
QWhatsThis::add( box, i18n("Here you can customize mouse click behavior when clicking on the"
|
||||
" titlebar or the frame of a window.") );
|
||||
|
||||
grid = new QGrid(4, Qt::Vertical, box);
|
||||
|
||||
|
||||
new QLabel(grid); // dummy
|
||||
|
||||
strMouseButton1 = i18n("Left Button:");
|
||||
txtButton1 = i18n("In this row you can customize left click behavior when clicking into"
|
||||
" the titlebar or the frame.");
|
||||
|
||||
strMouseButton3 = i18n("Right Button:");
|
||||
txtButton3 = i18n("In this row you can customize right click behavior when clicking into"
|
||||
" the titlebar or the frame." );
|
||||
|
||||
if ( leftHandedMouse )
|
||||
{
|
||||
qSwap(strMouseButton1, strMouseButton3);
|
||||
qSwap(txtButton1, txtButton3);
|
||||
}
|
||||
|
||||
label = new QLabel(strMouseButton1, grid);
|
||||
QWhatsThis::add( label, txtButton1);
|
||||
|
||||
label = new QLabel(i18n("Middle Button:"), grid);
|
||||
QWhatsThis::add( label, i18n("In this row you can customize middle click behavior when clicking into"
|
||||
" the titlebar or the frame.") );
|
||||
|
||||
label = new QLabel(strMouseButton3, grid);
|
||||
QWhatsThis::add( label, txtButton3);
|
||||
|
||||
|
||||
label = new QLabel(i18n("Active"), grid);
|
||||
label->setAlignment(AlignCenter);
|
||||
QWhatsThis::add( label, i18n("In this column you can customize mouse clicks into the titlebar"
|
||||
" or the frame of an active window.") );
|
||||
|
||||
// Titlebar and frame, active, mouse button 1
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertItem(i18n("Raise"));
|
||||
combo->insertItem(i18n("Lower"));
|
||||
combo->insertItem(i18n("Operations menu"));
|
||||
combo->insertItem(i18n("Toggle raise and lower"));
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coTiAct1 = combo;
|
||||
|
||||
txtButton1 = i18n("Behavior on <em>left</em> click into the titlebar or frame of an "
|
||||
"<em>active</em> window.");
|
||||
|
||||
txtButton3 = i18n("Behavior on <em>right</em> click into the titlebar or frame of an "
|
||||
"<em>active</em> window.");
|
||||
|
||||
// Be nice to left handed users
|
||||
if ( leftHandedMouse ) qSwap(txtButton1, txtButton3);
|
||||
|
||||
QWhatsThis::add(combo, txtButton1);
|
||||
|
||||
// Titlebar and frame, active, mouse button 2
|
||||
|
||||
items << i18n("Raise")
|
||||
<< i18n("Lower")
|
||||
<< i18n("Operations menu")
|
||||
<< i18n("Toggle raise and lower")
|
||||
<< i18n("Nothing")
|
||||
<< i18n("Shade");
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coTiAct2 = combo;
|
||||
QWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>active</em> window."));
|
||||
|
||||
// Titlebar and frame, active, mouse button 3
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coTiAct3 = combo;
|
||||
QWhatsThis::add(combo, txtButton3 );
|
||||
|
||||
txtButton1 = i18n("Behavior on <em>left</em> click into the titlebar or frame of an "
|
||||
"<em>inactive</em> window.");
|
||||
|
||||
txtButton3 = i18n("Behavior on <em>right</em> click into the titlebar or frame of an "
|
||||
"<em>inactive</em> window.");
|
||||
|
||||
// Be nice to left handed users
|
||||
if ( leftHandedMouse ) qSwap(txtButton1, txtButton3);
|
||||
|
||||
label = new QLabel(i18n("Inactive"), grid);
|
||||
label->setAlignment(AlignCenter);
|
||||
QWhatsThis::add( label, i18n("In this column you can customize mouse clicks into the titlebar"
|
||||
" or the frame of an inactive window.") );
|
||||
|
||||
items.clear();
|
||||
items << i18n("Activate and raise")
|
||||
<< i18n("Activate and lower")
|
||||
<< i18n("Activate")
|
||||
<< i18n("Shade");
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coTiInAct1 = combo;
|
||||
QWhatsThis::add(combo, txtButton1);
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coTiInAct2 = combo;
|
||||
QWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>inactive</em> window."));
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coTiInAct3 = combo;
|
||||
QWhatsThis::add(combo, txtButton3);
|
||||
|
||||
/** Inactive inner window ******************/
|
||||
|
||||
box = new QVGroupBox(i18n("Inactive inner window"), this, "Inactive inner window");
|
||||
box->layout()->setMargin(KDialog::marginHint());
|
||||
box->layout()->setSpacing(KDialog::spacingHint());
|
||||
layout->addWidget(box);
|
||||
QWhatsThis::add( box, i18n("Here you can customize mouse click behavior when clicking on an inactive"
|
||||
" inner window ('inner' means: not titlebar, not frame).") );
|
||||
|
||||
grid = new QGrid(3, Qt::Vertical, box);
|
||||
|
||||
strMouseButton1 = i18n("Left Button:");
|
||||
txtButton1 = i18n("In this row you can customize left click behavior when clicking into"
|
||||
" the titlebar or the frame.");
|
||||
|
||||
strMouseButton3 = i18n("Right Button:");
|
||||
txtButton3 = i18n("In this row you can customize right click behavior when clicking into"
|
||||
" the titlebar or the frame." );
|
||||
|
||||
if ( leftHandedMouse )
|
||||
{
|
||||
qSwap(strMouseButton1, strMouseButton3);
|
||||
qSwap(txtButton1, txtButton3);
|
||||
}
|
||||
|
||||
strWin1 = i18n("In this row you can customize left click behavior when clicking into"
|
||||
" an inactive inner window ('inner' means: not titlebar, not frame).");
|
||||
|
||||
strWin3 = i18n("In this row you can customize right click behavior when clicking into"
|
||||
" an inactive inner window ('inner' means: not titlebar, not frame).");
|
||||
|
||||
// Be nice to lefties
|
||||
if ( leftHandedMouse ) qSwap(strWin1, strWin3);
|
||||
|
||||
label = new QLabel(strMouseButton1, grid);
|
||||
QWhatsThis::add( label, strWin1 );
|
||||
|
||||
label = new QLabel(i18n("Middle Button:"), grid);
|
||||
strWin2 = i18n("In this row you can customize middle click behavior when clicking into"
|
||||
" an inactive inner window ('inner' means: not titlebar, not frame).");
|
||||
QWhatsThis::add( label, strWin2 );
|
||||
|
||||
label = new QLabel(strMouseButton3, grid);
|
||||
QWhatsThis::add( label, strWin3 );
|
||||
|
||||
items.clear();
|
||||
items << i18n("Activate, raise and pass click")
|
||||
<< i18n("Activate and pass click")
|
||||
<< i18n("Activate")
|
||||
<< i18n("Activate and raise");
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coWin1 = combo;
|
||||
QWhatsThis::add( combo, strWin1 );
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coWin2 = combo;
|
||||
QWhatsThis::add( combo, strWin2 );
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coWin3 = combo;
|
||||
QWhatsThis::add( combo, strWin3 );
|
||||
|
||||
|
||||
/** Inner window, titlebar and frame **************/
|
||||
|
||||
box = new QVGroupBox(i18n("Inner window, titlebar and frame"), this, "Inner window, titlebar and frame");
|
||||
box->layout()->setMargin(KDialog::marginHint());
|
||||
box->layout()->setSpacing(KDialog::spacingHint());
|
||||
layout->addWidget(box);
|
||||
QWhatsThis::add( box, i18n("Here you can customize KDE's behavior when clicking somewhere into"
|
||||
" a window while pressing a modifier key."));
|
||||
|
||||
grid = new QGrid(4, Qt::Vertical, box);
|
||||
|
||||
// Labels
|
||||
label = new QLabel(i18n("Modifier Key:"), grid);
|
||||
|
||||
strAllKey = i18n("Here you select whether holding the Meta key or Alt key "
|
||||
"will allow you to perform the following actions.");
|
||||
QWhatsThis::add( label, strAllKey );
|
||||
|
||||
label = new QLabel(i18n("Modifier Key + Middle Button:"), grid);
|
||||
strAll2 = i18n("Here you can customize KDE's behavior when middle clicking into a window"
|
||||
" while pressing the modifier key.");
|
||||
QWhatsThis::add( label, strAll2 );
|
||||
|
||||
|
||||
strMouseButton1 = i18n("Modifier Key + Left Button:");
|
||||
strAll1 = i18n("In this row you can customize left click behavior when clicking into"
|
||||
" the titlebar or the frame.");
|
||||
|
||||
strMouseButton3 = i18n("Modifier Key + Right Button:");
|
||||
strAll3 = i18n("In this row you can customize right click behavior when clicking into"
|
||||
" the titlebar or the frame." );
|
||||
|
||||
if ( leftHandedMouse )
|
||||
{
|
||||
qSwap(strMouseButton1, strMouseButton3);
|
||||
qSwap(strAll1, strAll3);
|
||||
}
|
||||
|
||||
label = new QLabel(strMouseButton1, grid);
|
||||
QWhatsThis::add( label, strAll1);
|
||||
|
||||
label = new QLabel(strMouseButton3, grid);
|
||||
QWhatsThis::add( label, strAll3);
|
||||
|
||||
// Combo's
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertItem(i18n("Meta"));
|
||||
combo->insertItem(i18n("Alt"));
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coAllKey = combo;
|
||||
QWhatsThis::add( combo, strAllKey );
|
||||
|
||||
items.clear();
|
||||
items << i18n("Move")
|
||||
<< i18n("Toggle raise and lower")
|
||||
<< i18n("Resize")
|
||||
<< i18n("Raise")
|
||||
<< i18n("Lower")
|
||||
<< i18n("Nothing");
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coAll1 = combo;
|
||||
QWhatsThis::add( combo, strAll1 );
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coAll2 = combo;
|
||||
QWhatsThis::add( combo, strAll2 );
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
|
||||
coAll3 = combo;
|
||||
QWhatsThis::add( combo, strAll3 );
|
||||
|
||||
layout->addStretch();
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
void KActionsConfig::setComboText(QComboBox* combo, const char* text){
|
||||
int i;
|
||||
QString s = i18n(text); // no problem. These are already translated!
|
||||
for (i=0;i<combo->count();i++){
|
||||
if (s==combo->text(i)){
|
||||
combo->setCurrentItem(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const char* KActionsConfig::functionTiDbl(int i)
|
||||
{
|
||||
switch (i){
|
||||
case 0: return "Maximize"; break;
|
||||
case 1: return "Maximize (vertical only)"; break;
|
||||
case 2: return "Maximize (horizontal only)"; break;
|
||||
case 3: return "Shade"; break;
|
||||
case 4: return "Lower"; break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
const char* KActionsConfig::functionTiAc(int i)
|
||||
{
|
||||
switch (i){
|
||||
case 0: return "Raise"; break;
|
||||
case 1: return "Lower"; break;
|
||||
case 2: return "Operations menu"; break;
|
||||
case 3: return "Toggle raise and lower"; break;
|
||||
case 4: return "Nothing"; break;
|
||||
case 5: return "Shade"; break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
const char* KActionsConfig::functionTiInAc(int i)
|
||||
{
|
||||
switch (i){
|
||||
case 0: return "Activate and raise"; break;
|
||||
case 1: return "Activate and lower"; break;
|
||||
case 2: return "Activate"; break;
|
||||
case 3: return "Shade"; break;
|
||||
case 4: return ""; break;
|
||||
case 5: return ""; break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
const char* KActionsConfig::functionWin(int i)
|
||||
{
|
||||
switch (i){
|
||||
case 0: return "Activate, raise and pass click"; break;
|
||||
case 1: return "Activate and pass click"; break;
|
||||
case 2: return "Activate"; break;
|
||||
case 3: return "Activate and raise"; break;
|
||||
case 4: return ""; break;
|
||||
case 5: return ""; break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
const char* KActionsConfig::functionAllKey(int i)
|
||||
{
|
||||
switch (i){
|
||||
case 0: return "Meta"; break;
|
||||
case 1: return "Alt"; break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
const char* KActionsConfig::functionAll(int i)
|
||||
{
|
||||
switch (i){
|
||||
case 0: return "Move"; break;
|
||||
case 1: return "Toggle raise and lower"; break;
|
||||
case 2: return "Resize"; break;
|
||||
case 3: return "Raise"; break;
|
||||
case 4: return "Lower"; break;
|
||||
case 5: return "Nothing"; break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
void KActionsConfig::load()
|
||||
{
|
||||
config->setGroup("Windows");
|
||||
setComboText(coTiDbl, config->readEntry("TitlebarDoubleClickCommand","Shade").ascii());
|
||||
|
||||
config->setGroup( "MouseBindings");
|
||||
setComboText(coTiAct1,config->readEntry("CommandActiveTitlebar1","Raise").ascii());
|
||||
setComboText(coTiAct2,config->readEntry("CommandActiveTitlebar2","Lower").ascii());
|
||||
setComboText(coTiAct3,config->readEntry("CommandActiveTitlebar3","Operations menu").ascii());
|
||||
setComboText(coTiInAct1,config->readEntry("CommandInactiveTitlebar1","Activate and raise").ascii());
|
||||
setComboText(coTiInAct2,config->readEntry("CommandInactiveTitlebar2","Activate and lower").ascii());
|
||||
setComboText(coTiInAct3,config->readEntry("CommandInactiveTitlebar3","Activate").ascii());
|
||||
setComboText(coWin1,config->readEntry("CommandWindow1","Activate, raise and pass click").ascii());
|
||||
setComboText(coWin2,config->readEntry("CommandWindow2","Activate and pass click").ascii());
|
||||
setComboText(coWin3,config->readEntry("CommandWindow3","Activate and pass click").ascii());
|
||||
setComboText(coAllKey,config->readEntry("CommandAllKey","Alt").ascii());
|
||||
setComboText(coAll1,config->readEntry("CommandAll1","Move").ascii());
|
||||
setComboText(coAll2,config->readEntry("CommandAll2","Toggle raise and lower").ascii());
|
||||
setComboText(coAll3,config->readEntry("CommandAll3","Resize").ascii());
|
||||
}
|
||||
|
||||
// many widgets connect to this slot
|
||||
void KActionsConfig::slotChanged()
|
||||
{
|
||||
emit changed(true);
|
||||
}
|
||||
|
||||
void KActionsConfig::save()
|
||||
{
|
||||
config->setGroup("Windows");
|
||||
config->writeEntry("TitlebarDoubleClickCommand", functionTiDbl( coTiDbl->currentItem() ) );
|
||||
|
||||
config->setGroup("MouseBindings");
|
||||
config->writeEntry("CommandActiveTitlebar1", functionTiAc(coTiAct1->currentItem()));
|
||||
config->writeEntry("CommandActiveTitlebar2", functionTiAc(coTiAct2->currentItem()));
|
||||
config->writeEntry("CommandActiveTitlebar3", functionTiAc(coTiAct3->currentItem()));
|
||||
config->writeEntry("CommandInactiveTitlebar1", functionTiInAc(coTiInAct1->currentItem()));
|
||||
config->writeEntry("CommandInactiveTitlebar2", functionTiInAc(coTiInAct2->currentItem()));
|
||||
config->writeEntry("CommandInactiveTitlebar3", functionTiInAc(coTiInAct3->currentItem()));
|
||||
config->writeEntry("CommandWindow1", functionWin(coWin1->currentItem()));
|
||||
config->writeEntry("CommandWindow2", functionWin(coWin2->currentItem()));
|
||||
config->writeEntry("CommandWindow3", functionWin(coWin3->currentItem()));
|
||||
config->writeEntry("CommandAllKey", functionAllKey(coAllKey->currentItem()));
|
||||
config->writeEntry("CommandAll1", functionAll(coAll1->currentItem()));
|
||||
config->writeEntry("CommandAll2", functionAll(coAll2->currentItem()));
|
||||
config->writeEntry("CommandAll3", functionAll(coAll3->currentItem()));
|
||||
}
|
||||
|
||||
void KActionsConfig::defaults()
|
||||
{
|
||||
setComboText(coTiAct1,"Raise");
|
||||
setComboText(coTiAct2,"Lower");
|
||||
setComboText(coTiAct3,"Operations menu");
|
||||
setComboText(coTiInAct1,"Activate and raise");
|
||||
setComboText(coTiInAct2,"Activate and lower");
|
||||
setComboText(coTiInAct3,"Activate");
|
||||
setComboText(coWin1,"Activate, raise and pass click");
|
||||
setComboText(coWin2,"Activate and pass click");
|
||||
setComboText(coWin3,"Activate and pass click");
|
||||
setComboText(coAllKey, KKeyNative::keyboardHasMetaKey() ? "Meta" : "Alt");
|
||||
setComboText (coAll1,"Move");
|
||||
setComboText(coAll2,"Toggle raise and lower");
|
||||
setComboText(coAll3,"Resize");
|
||||
}
|
79
kcmkwin/kwinoptions/mouse.h
Normal file
79
kcmkwin/kwinoptions/mouse.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* mouse.h
|
||||
*
|
||||
* Copyright (c) 1998 Matthias Ettrich <ettrich@kde.org>
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __KKWMMOUSECONFIG_H__
|
||||
#define __KKWMMOUSECONFIG_H__
|
||||
|
||||
class QComboBox;
|
||||
class KConfig;
|
||||
|
||||
#include <kcmodule.h>
|
||||
|
||||
class KActionsConfig : public KCModule
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
KActionsConfig( KConfig *_config, QWidget *parent=0, const char* name=0 );
|
||||
~KActionsConfig( );
|
||||
|
||||
void load();
|
||||
void save();
|
||||
void defaults();
|
||||
|
||||
private slots:
|
||||
void slotChanged();
|
||||
|
||||
private:
|
||||
QComboBox* coTiDbl;
|
||||
|
||||
QComboBox* coTiAct1;
|
||||
QComboBox* coTiAct2;
|
||||
QComboBox* coTiAct3;
|
||||
QComboBox* coTiInAct1;
|
||||
QComboBox* coTiInAct2;
|
||||
QComboBox* coTiInAct3;
|
||||
|
||||
QComboBox* coWin1;
|
||||
QComboBox* coWin2;
|
||||
QComboBox* coWin3;
|
||||
|
||||
QComboBox* coAllKey;
|
||||
QComboBox* coAll1;
|
||||
QComboBox* coAll2;
|
||||
QComboBox* coAll3;
|
||||
|
||||
KConfig *config;
|
||||
|
||||
const char* functionTiDbl(int);
|
||||
const char* functionTiAc(int);
|
||||
const char* functionTiInAc(int);
|
||||
const char* functionWin(int);
|
||||
const char* functionAllKey(int);
|
||||
const char* functionAll(int);
|
||||
|
||||
void setComboText(QComboBox* combo, const char* text);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
2
kcmkwin/kwinoptions/uninstall.desktop
Normal file
2
kcmkwin/kwinoptions/uninstall.desktop
Normal file
|
@ -0,0 +1,2 @@
|
|||
[Desktop Entry]
|
||||
Hidden=true
|
1045
kcmkwin/kwinoptions/windows.cpp
Normal file
1045
kcmkwin/kwinoptions/windows.cpp
Normal file
File diff suppressed because it is too large
Load diff
218
kcmkwin/kwinoptions/windows.h
Normal file
218
kcmkwin/kwinoptions/windows.h
Normal file
|
@ -0,0 +1,218 @@
|
|||
/*
|
||||
* windows.h
|
||||
*
|
||||
* Copyright (c) 1997 Patrick Dowler dowler@morgul.fsh.uvic.ca
|
||||
* Copyright (c) 2001 Waldo Bastian bastian@kde.org
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __KWINDOWCONFIG_H__
|
||||
#define __KWINDOWCONFIG_H__
|
||||
|
||||
#include <kcmodule.h>
|
||||
#include <config.h>
|
||||
|
||||
class QRadioButton;
|
||||
class QCheckBox;
|
||||
class QPushButton;
|
||||
class QComboBox;
|
||||
class QLabel;
|
||||
class QSlider;
|
||||
class QButtonGroup;
|
||||
class QSpinBox;
|
||||
class QVButtonGroup;
|
||||
|
||||
class KIntNumInput;
|
||||
|
||||
#define TRANSPARENT 0
|
||||
#define OPAQUE 1
|
||||
|
||||
#define CLICK_TO_FOCUS 0
|
||||
#define FOCUS_FOLLOW_MOUSE 1
|
||||
|
||||
#define TITLEBAR_PLAIN 0
|
||||
#define TITLEBAR_SHADED 1
|
||||
|
||||
#define RESIZE_TRANSPARENT 0
|
||||
#define RESIZE_OPAQUE 1
|
||||
|
||||
#define SMART_PLACEMENT 0
|
||||
#define CASCADE_PLACEMENT 1
|
||||
#define RANDOM_PLACEMENT 2
|
||||
#define INTERACTIVE_PLACEMENT 3
|
||||
#define MANUAL_PLACEMENT 4
|
||||
|
||||
#define CLICK_TO_FOCUS 0
|
||||
#define FOCUS_FOLLOWS_MOUSE 1
|
||||
#define FOCUS_UNDER_MOUSE 2
|
||||
#define FOCUS_STRICTLY_UNDER_MOUSE 3
|
||||
|
||||
class QSpinBox;
|
||||
|
||||
class KFocusConfig : public KCModule
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KFocusConfig( KConfig *_config, QWidget *parent=0, const char* name=0 );
|
||||
~KFocusConfig();
|
||||
|
||||
void load();
|
||||
void save();
|
||||
void defaults();
|
||||
|
||||
private slots:
|
||||
void setAutoRaiseEnabled();
|
||||
void autoRaiseOnTog(bool);//CT 23Oct1998
|
||||
void clickRaiseOnTog(bool);
|
||||
void slotChanged();
|
||||
|
||||
private:
|
||||
|
||||
int getFocus( void );
|
||||
int getAutoRaiseInterval( void );
|
||||
|
||||
void setFocus(int);
|
||||
void setAutoRaiseInterval(int);
|
||||
void setAutoRaise(bool);
|
||||
void setClickRaise(bool);
|
||||
void setAltTabMode(bool);
|
||||
void setTraverseAll(bool);
|
||||
|
||||
QButtonGroup *fcsBox;
|
||||
QComboBox *focusCombo;
|
||||
QCheckBox *autoRaiseOn;
|
||||
QCheckBox *clickRaiseOn;
|
||||
KIntNumInput *autoRaise;
|
||||
QLabel *alabel;
|
||||
//CT QLabel *sec;
|
||||
|
||||
QButtonGroup *kbdBox;
|
||||
QRadioButton *kdeMode;
|
||||
QRadioButton *cdeMode;
|
||||
QCheckBox *traverseAll;
|
||||
|
||||
KConfig *config;
|
||||
};
|
||||
|
||||
class KMovingConfig : public KCModule
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KMovingConfig( KConfig *config, QWidget *parent=0, const char* name=0 );
|
||||
~KMovingConfig();
|
||||
|
||||
void load();
|
||||
void save();
|
||||
void defaults();
|
||||
|
||||
private slots:
|
||||
void slotChanged();
|
||||
|
||||
private:
|
||||
|
||||
int getMove( void );
|
||||
bool getMinimizeAnim( void );
|
||||
int getMinimizeAnimSpeed( void );
|
||||
int getResizeOpaque ( void );
|
||||
int getPlacement( void ); //CT
|
||||
|
||||
void setMove(int);
|
||||
void setMinimizeAnim(bool,int);
|
||||
void setResizeOpaque(int);
|
||||
void setPlacement(int); //CT
|
||||
void setMoveResizeMaximized(bool);
|
||||
|
||||
QButtonGroup *windowsBox;
|
||||
QCheckBox *opaque;
|
||||
|
||||
QCheckBox *resizeOpaqueOn;
|
||||
QCheckBox* minimizeAnimOn;
|
||||
QSlider *minimizeAnimSlider;
|
||||
QLabel *minimizeAnimSlowLabel, *minimizeAnimFastLabel;
|
||||
QCheckBox *moveResizeMaximized;
|
||||
|
||||
QComboBox *placementCombo;
|
||||
|
||||
KConfig *config;
|
||||
|
||||
int getBorderSnapZone();
|
||||
void setBorderSnapZone( int );
|
||||
int getWindowSnapZone();
|
||||
void setWindowSnapZone( int );
|
||||
|
||||
QVButtonGroup *MagicBox;
|
||||
KIntNumInput *BrdrSnap, *WndwSnap;
|
||||
QCheckBox *OverlapSnap;
|
||||
|
||||
};
|
||||
|
||||
class KAdvancedConfig : public KCModule
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KAdvancedConfig( KConfig *config, QWidget *parent=0, const char* name=0 );
|
||||
~KAdvancedConfig();
|
||||
|
||||
void load();
|
||||
void save();
|
||||
void defaults();
|
||||
|
||||
private slots:
|
||||
void slotChanged();
|
||||
void shadeHoverChanged(bool);
|
||||
|
||||
//copied from kcontrol/konq/kwindesktop, aleXXX
|
||||
void setEBorders();
|
||||
|
||||
void setXinerama(bool);
|
||||
|
||||
private:
|
||||
|
||||
int getShadeHoverInterval (void );
|
||||
void setAnimateShade(bool);
|
||||
void setShadeHover(bool);
|
||||
void setShadeHoverInterval(int);
|
||||
|
||||
QCheckBox *animateShade;
|
||||
QButtonGroup *shBox;
|
||||
QCheckBox *shadeHoverOn;
|
||||
KIntNumInput *shadeHover;
|
||||
QLabel *shlabel;
|
||||
|
||||
#ifdef HAVE_XINERAMA
|
||||
QButtonGroup *xineramaBox;
|
||||
QCheckBox *xineramaEnable;
|
||||
QCheckBox *xineramaMovementEnable;
|
||||
QCheckBox *xineramaPlacementEnable;
|
||||
QCheckBox *xineramaMaximizeEnable;
|
||||
#endif
|
||||
|
||||
KConfig *config;
|
||||
|
||||
int getElectricBorders( void );
|
||||
int getElectricBorderDelay();
|
||||
void setElectricBorders( int );
|
||||
void setElectricBorderDelay( int );
|
||||
|
||||
QVButtonGroup *electricBox;
|
||||
QRadioButton *active_disable;
|
||||
QRadioButton *active_move;
|
||||
QRadioButton *active_always;
|
||||
KIntNumInput *delays;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in a new issue