- Removing patch by Diego Iastrubini that attempted to fix the bidi issues in

clients by adding an unnecessary 'enable-bidi' checkbox which was never agreed
  upon on the kwin mailing list.

  The use of --reverse is sufficient without needing this checkbox.
  Please discuss largish patches like these first, especially during a feature
  freeze!

  (Everyone also seems to forget the kwin-styles in kdeartwork)

- Make clients look the same with --reverse instead of the broken state they
  were in previously. If the button ordering is not to your liking in reverse
  mode, just change the button positions. (Or send patches for those clients
  that have not got these features yet).

- Clean up popupMenu handling somewhat.

- Remove a global static object in keramik.

svn path=/trunk/kdebase/kwin/; revision=174079
icc-effect-5.14.5
Karol Szwed 2002-08-27 15:12:14 +00:00
parent 8e7f66bc65
commit a33f4313ab
30 changed files with 329 additions and 550 deletions

View File

@ -405,37 +405,22 @@ B2Client::B2Client( Workspace *ws, WId w, QWidget *parent,
titlebar->setMinimumWidth(16);
titlebar->setFixedHeight(20);
QHBoxLayout *titleLayout = new QHBoxLayout(titlebar);
titleLayout->setSpacing(1);
QBoxLayout *titleLayout = new QBoxLayout(titlebar, QBoxLayout::LeftToRight, 0, 1, 0);
titleLayout->addSpacing(3);
if (options->customButtonPositions())
{
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows())){
addButtons( options->titleButtonsRight(), tips, titlebar, titleLayout );
titleLayout->addItem(titlebar->captionSpacer);
addButtons( options->titleButtonsLeft(), tips, titlebar, titleLayout );
}
else{
addButtons( options->titleButtonsLeft(), tips, titlebar, titleLayout );
titleLayout->addItem(titlebar->captionSpacer);
addButtons( options->titleButtonsRight(), tips, titlebar, titleLayout );
}
addButtons( options->titleButtonsLeft(), tips, titlebar, titleLayout );
titleLayout->addItem(titlebar->captionSpacer);
addButtons( options->titleButtonsRight(), tips, titlebar, titleLayout );
} else {
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows())){
addButtons( "IAX", tips, titlebar, titleLayout );
titleLayout->addItem(titlebar->captionSpacer);
addButtons( "MSH", tips, titlebar, titleLayout );
}
else{
addButtons( "MSH", tips, titlebar, titleLayout );
titleLayout->addItem(titlebar->captionSpacer);
addButtons( "IAX", tips, titlebar, titleLayout );
}
addButtons( "MSH", tips, titlebar, titleLayout );
titleLayout->addItem(titlebar->captionSpacer);
addButtons( "IAX", tips, titlebar, titleLayout );
}
titleLayout->addSpacing(3);
QColor c = options->colorGroup(Options::TitleBar, isActive()).
color(QColorGroup::Button);
@ -450,15 +435,13 @@ B2Client::B2Client( Workspace *ws, WId w, QWidget *parent,
}
void B2Client::addButtons(const QString& s, const QString tips[],
B2Titlebar* tb, QHBoxLayout* titleLayout)
B2Titlebar* tb, QBoxLayout* titleLayout)
{
int str_len = s.length();
if (str_len <= 0)
if (s.length() <= 0)
return;
for(unsigned int i = 0; i < s.length(); i++) {
switch( (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
? s[str_len-i-1].latin1():s[i].latin1()) {
switch(s[i].latin1()) {
case 'M': // Menu button
if (!button[BtnMenu]) {
button[BtnMenu] = new B2Button(this, tb, tips[BtnMenu]);
@ -794,9 +777,10 @@ void B2Client::activeChange(bool on)
void B2Client::menuButtonPressed()
{
QPoint pos = button[BtnMenu]->mapToGlobal(button[BtnMenu]->
rect().bottomLeft());
workspace()->showWindowMenu( pos.x(), pos.y(), this );
QPoint menupoint = button[BtnMenu]->mapToGlobal(button[BtnMenu]->
rect().bottomLeft());
workspace()->showWindowMenu( menupoint, this );
button[BtnMenu]->setDown(false);
}
void B2Client::slotReset()

View File

@ -17,7 +17,7 @@
#include "../../kwinbutton.h"
class QSpacerItem;
class QHBoxLayout;
class QBoxLayout;
class QGridLayout;
namespace KWinInternal {
@ -111,7 +111,7 @@ private slots:
void maxButtonClicked();
private:
void addButtons(const QString& s, const QString tips[],
B2Titlebar* tb, QHBoxLayout* titleLayout);
B2Titlebar* tb, QBoxLayout* titleLayout);
void positionButtons();
void calcHiddenButtons();
enum ButtonType{BtnMenu=0, BtnSticky, BtnIconify, BtnMax, BtnClose,

View File

@ -603,18 +603,18 @@ KDEDefaultClient::KDEDefaultClient( Workspace *ws, WId w, QWidget *parent,
// No flicker thanks
setBackgroundMode( QWidget::NoBackground );
// Set button pointers to NULL so we can track things
for(int i=0; i < KDEDefaultClient::BtnCount; i++)
button[i] = NULL;
// Set button pointers to NULL so we can track things
for(int i=0; i < KDEDefaultClient::BtnCount; i++)
button[i] = NULL;
// Finally, toolWindows look small
if ( isTool() ) {
titleHeight = toolTitleHeight;
largeButtons = largeToolButtons;
}
else {
titleHeight = normalTitleHeight;
largeButtons = true;
titleHeight = toolTitleHeight;
largeButtons = largeToolButtons;
}
else {
titleHeight = normalTitleHeight;
largeButtons = true;
}
// Pack the windowWrapper() window within a grid
@ -624,58 +624,47 @@ KDEDefaultClient::KDEDefaultClient( Workspace *ws, WId w, QWidget *parent,
g->addRowSpacing(2, 1); // line under titlebar
g->addWidget(windowWrapper(), 3, 1);
// without the next line, unshade flickers
g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
// without the next line, unshade flickers
g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed,
QSizePolicy::Expanding ) );
g->setRowStretch(3, 10); // Wrapped window
// Determine the size of the lower grab bar
if ( showGrabBar && (!isTool()) )
g->addRowSpacing(4, 8); // bottom handles
else
g->addRowSpacing(4, 4); // bottom handles
// Determine the size of the lower grab bar
if ( showGrabBar && (!isTool()) )
g->addRowSpacing(4, 8); // bottom handles
else
g->addRowSpacing(4, 4); // bottom handles
g->addColSpacing(0, 4);
g->addColSpacing(2, 4);
// Pack the titlebar HBox with items
hb = new QHBoxLayout();
hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0 );
hb->setResizeMode( QLayout::FreeResize );
g->addLayout ( hb, 1, 1 );
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
addClientButtons( options->titleButtonsRight() );
else
addClientButtons( options->titleButtonsLeft() );
titlebar = new QSpacerItem( 10, titleHeight, QSizePolicy::Expanding, QSizePolicy::Minimum );
titlebar = new QSpacerItem( 10, titleHeight, QSizePolicy::Expanding,
QSizePolicy::Minimum );
hb->addItem(titlebar);
hb->addSpacing(2);
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
addClientButtons( options->titleButtonsLeft(), false );
else
addClientButtons( options->titleButtonsRight(), false );
}
void KDEDefaultClient::addClientButtons( const QString& s, bool isLeft )
{
if (s.length() > 0){
unsigned int i = 0;
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
i = s.length() - 1;
//for( ; (i < s.length()) && (i) ;) { // i>=0
for( ; ( i < s.length()) ;) { // i>=0
if (s.length() > 0)
for(unsigned int i = 0; i < s.length(); i++) {
switch( s[i].latin1() )
{
// Menu button
case 'M':
if (!button[BtnMenu])
{
button[BtnMenu] = new KDEDefaultButton(this, "menu",
button[BtnMenu] = new KDEDefaultButton(this, "menu",
largeButtons, isLeft, false, NULL, i18n("Menu"));
connect( button[BtnMenu], SIGNAL(pressed()),
connect( button[BtnMenu], SIGNAL(pressed()),
this, SLOT(menuButtonPressed()) );
hb->addWidget( button[BtnMenu] );
}
@ -685,10 +674,10 @@ void KDEDefaultClient::addClientButtons( const QString& s, bool isLeft )
case 'S':
if (!button[BtnSticky])
{
button[BtnSticky] = new KDEDefaultButton(this, "sticky",
button[BtnSticky] = new KDEDefaultButton(this, "sticky",
largeButtons, isLeft, true, NULL, i18n("Sticky"));
button[BtnSticky]->turnOn( isSticky() );
connect( button[BtnSticky], SIGNAL(clicked()),
connect( button[BtnSticky], SIGNAL(clicked()),
this, SLOT(toggleSticky()) );
hb->addWidget( button[BtnSticky] );
}
@ -696,7 +685,7 @@ void KDEDefaultClient::addClientButtons( const QString& s, bool isLeft )
// Help button
case 'H':
if( providesContextHelp() && (!button[BtnHelp]) )
if( providesContextHelp() && (!button[BtnHelp]) )
{
button[BtnHelp] = new KDEDefaultButton(this, "help",
largeButtons, isLeft, true, question_bits,
@ -711,10 +700,10 @@ void KDEDefaultClient::addClientButtons( const QString& s, bool isLeft )
case 'I':
if ( (!button[BtnIconify]) && isMinimizable())
{
button[BtnIconify] = new KDEDefaultButton(this, "iconify",
button[BtnIconify] = new KDEDefaultButton(this, "iconify",
largeButtons, isLeft, true, iconify_bits,
i18n("Minimize"));
connect( button[BtnIconify], SIGNAL( clicked()),
connect( button[BtnIconify], SIGNAL( clicked()),
this, SLOT(iconify()) );
hb->addWidget( button[BtnIconify] );
}
@ -724,10 +713,10 @@ void KDEDefaultClient::addClientButtons( const QString& s, bool isLeft )
case 'A':
if ( (!button[BtnMax]) && isMaximizable())
{
button[BtnMax] = new KDEDefaultButton(this, "maximize",
button[BtnMax] = new KDEDefaultButton(this, "maximize",
largeButtons, isLeft, true, maximize_bits,
i18n("Maximize"));
connect( button[BtnMax], SIGNAL( clicked()),
connect( button[BtnMax], SIGNAL( clicked()),
this, SLOT(slotMaximize()) );
hb->addWidget( button[BtnMax] );
}
@ -737,10 +726,10 @@ void KDEDefaultClient::addClientButtons( const QString& s, bool isLeft )
case 'X':
if (!button[BtnClose])
{
button[BtnClose] = new KDEDefaultButton(this, "close",
button[BtnClose] = new KDEDefaultButton(this, "close",
largeButtons, isLeft, true, close_bits,
i18n("Close"));
connect( button[BtnClose], SIGNAL( clicked()),
connect( button[BtnClose], SIGNAL( clicked()),
this, SLOT(closeWindow()) );
hb->addWidget( button[BtnClose] );
}
@ -748,18 +737,10 @@ void KDEDefaultClient::addClientButtons( const QString& s, bool isLeft )
// Spacer item (only for non-tool windows)
case '_':
if ( !isTool() )
hb->addSpacing(2);
} // switch( ...
// this should be in the for() statment some how....
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
i--;
else
i++;
} // for( ...
} // if (s.length()....
if ( !isTool() )
hb->addSpacing(2);
}
}
}
@ -813,7 +794,7 @@ void KDEDefaultClient::resizeEvent( QResizeEvent* e)
if ( dx )
{
update( width() - dx + 1, 0, dx, height() );
update( QRect( QPoint(4,4), titlebar->geometry().bottomLeft() -
update( QRect( QPoint(4,4), titlebar->geometry().bottomLeft() -
QPoint(1,0) ) );
update( QRect( titlebar->geometry().topRight(), QPoint(width() - 4,
titlebar->geometry().bottom()) ) );
@ -833,12 +814,14 @@ void KDEDefaultClient::captionChange( const QString& )
void KDEDefaultClient::paintEvent( QPaintEvent* )
{
if (!KDEDefault_initialized)
return;
if (!KDEDefault_initialized)
return;
QColorGroup g;
int offset;
KPixmap* upperGradient = isActive() ? aUpperGradient : iUpperGradient;
QColorGroup g;
int offset;
KPixmap* upperGradient = isActive() ? aUpperGradient : iUpperGradient;
QPainter p(this);
// Obtain widget bounds.
@ -850,19 +833,19 @@ void KDEDefaultClient::paintEvent( QPaintEvent* )
int w = r.width();
int h = r.height();
// Determine where to place the extended left titlebar
int leftFrameStart = (h > 42) ? y+titleHeight+26: y+titleHeight;
// Determine where to place the extended left titlebar
int leftFrameStart = (h > 42) ? y+titleHeight+26: y+titleHeight;
// Determine where to make the titlebar color transition
// Determine where to make the titlebar color transition
r = titlebar->geometry();
int rightOffset = r.x()+r.width()+1;
int rightOffset = r.x()+r.width()+1;
// Create a disposable pixmap buffer for the titlebar
// very early before drawing begins so there is no lag
// during painting pixels.
// very early before drawing begins so there is no lag
// during painting pixels.
titleBuffer->resize( rightOffset-3, titleHeight+1 );
// Draw an outer black frame
// Draw an outer black frame
p.setPen(Qt::black);
p.drawRect(x,y,w,h);
@ -925,14 +908,14 @@ void KDEDefaultClient::paintEvent( QPaintEvent* )
p.drawRect( x+3, y+titleHeight+3, w-6, h-titleHeight-offset-6 );
// Draw the title bar.
r = titlebar->geometry();
r = titlebar->geometry();
// Obtain titlebar blend colours
QColor c1 = options->color(Options::TitleBar, isActive() );
QColor c2 = options->color(Options::Frame, isActive() );
// Fill with frame color behind RHS buttons
p.fillRect( rightOffset, y+2, x2-rightOffset-1, titleHeight+1, c2);
// Fill with frame color behind RHS buttons
p.fillRect( rightOffset, y+2, x2-rightOffset-1, titleHeight+1, c2);
QPainter p2( titleBuffer, this );
@ -957,20 +940,24 @@ void KDEDefaultClient::paintEvent( QPaintEvent* )
QFontMetrics fm(fnt);
int captionWidth = fm.width(caption());
if (caption().isRightToLeft())
p2.drawTiledPixmap( r.x(), 0, r.width()-captionWidth-4, titleHeight+1, *titlePix );
p2.drawTiledPixmap( r.x(), 0, r.width()-captionWidth-4,
titleHeight+1, *titlePix );
else
p2.drawTiledPixmap( r.x()+captionWidth+3, 0, r.width()-captionWidth-4, titleHeight+1, *titlePix );
p2.drawTiledPixmap( r.x()+captionWidth+3, 0, r.width()-captionWidth-4,
titleHeight+1, *titlePix );
}
p2.setPen( options->color(Options::Font, isActive()) );
p2.drawText(r.x(), 1, r.width(), r.height(),
caption().isRightToLeft()?AlignRight:AlignLeft|AlignVCenter, caption() );
p2.drawText(r.x(), 1, r.width()-1, r.height(),
(caption().isRightToLeft() ? AlignRight : AlignLeft) | AlignVCenter,
caption() );
bitBlt( this, 2, 2, titleBuffer );
bitBlt( this, 2, 2, titleBuffer );
p2.end();
// Ensure a shaded window has no unpainted areas
p.setPen(c2);
// Ensure a shaded window has no unpainted areas
p.setPen(c2);
p.drawLine(x+4, y+titleHeight+4, x2-4, y+titleHeight+4);
}
@ -1087,10 +1074,10 @@ Client::MousePosition KDEDefaultClient::mousePosition( const QPoint& p ) const
// Make sure the menu button follows double click conventions set in kcontrol
void KDEDefaultClient::menuButtonPressed()
{
QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-1,
button[BtnMenu]->rect().bottomLeft().y()+2 );
QPoint pos = button[BtnMenu]->mapToGlobal( menupoint );
workspace()->showWindowMenu( pos.x(), pos.y(), this );
QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-1,
button[BtnMenu]->rect().bottomLeft().y()+2 );
workspace()->showWindowMenu( button[BtnMenu]->mapToGlobal( menupoint ), this );
button[BtnMenu]->setDown(false);
}

View File

@ -22,7 +22,7 @@
class QSpacerItem;
class QHBoxLayout;
class QBoxLayout;
namespace KWinInternal {
@ -109,7 +109,7 @@ class KDEDefaultClient : public KWinInternal::Client
int lastButtonWidth;
int titleHeight;
bool largeButtons;
QHBoxLayout* hb;
QBoxLayout* hb;
QSpacerItem* titlebar;
};

View File

@ -70,7 +70,7 @@ QPixmap* frameL [] = {NULL, NULL};
QPixmap* frameR [] = {NULL, NULL};
QPixmap* frameBL[] = {NULL, NULL};
QPixmap* frameB [] = {NULL, NULL};
QPixmap* frameBR[] = {NULL, NULL};
QPixmap* frameBR[] = {NULL, NULL};
// Button pixmaps
QPixmap* closePix[] = {NULL, NULL};
@ -177,7 +177,7 @@ ThemeHandler::ThemeHandler(): QObject( NULL )
ThemeHandler::~ThemeHandler()
{
if (initialized)
if (initialized)
freePixmaps();
delete colorInActiveTitleTextShadow;
@ -241,7 +241,7 @@ void ThemeHandler::readConfig()
*titleButtonsRight = options->titleButtonsRight();
// Convert KDE to icewm style buttons
convertButtons( *titleButtonsLeft );
convertButtons( *titleButtonsLeft );
convertButtons( *titleButtonsRight );
}
@ -368,7 +368,7 @@ void ThemeHandler::initTheme()
// Bottom
setPixmap( frameBL, "frame", "BL.xpm" );
setPixmap( frameB, "frame", "B.xpm", true );
setPixmap( frameBR, "frame", "BR.xpm" );
setPixmap( frameBR, "frame", "BR.xpm" );
// Make sure border sizes are at least reasonable...
if (borderSizeX < 0)
@ -553,7 +553,7 @@ void ThemeHandler::setPixmap( QPixmap* p[], QString s1, QString s2,
if ( p[Active] )
qWarning("kwin-icewm: setPixmap - should be null (1)\n");
if ( p[InActive] )
qWarning("kwin-icewm: setPixmap - should be null (2)\n");
qWarning("kwin-icewm: setPixmap - should be null (2)\n");
p[Active] = new QPixmap( locate("appdata", QString("icewm-themes/")
+ themeName + s1 + "A" + s2) );
@ -723,33 +723,30 @@ IceWMClient::IceWMClient( Workspace *ws, WId w, QWidget *parent, const char *nam
// Do something IceWM can't do :)
if (titleBarOnTop) {
grid->addWidget(windowWrapper(), 2, 1);
grid->addWidget(windowWrapper(), 2, 1);
// no shade flicker
grid->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
}
grid->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
}
else {
// no shade flicker
grid->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
grid->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
grid->addWidget(windowWrapper(), 1, 1);
}
}
grid->setRowStretch(1, 10);
grid->setRowStretch(2, 10);
grid->setColStretch(1, 10);
grid->setColStretch(1, 10);
grid->addRowSpacing(3, borderSizeY);
grid->addColSpacing(0, borderSizeX);
grid->addColSpacing(2, borderSizeX);
// Pack the titlebar with spacers and buttons
hb = new QHBoxLayout();
hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
hb->setResizeMode( QLayout::FreeResize );
titleSpacerJ = addPixmapSpacer( titleJ );
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()) )
addClientButtons( *titleButtonsRight );
else
addClientButtons( *titleButtonsLeft );
addClientButtons( *titleButtonsLeft );
titleSpacerL = addPixmapSpacer( titleL );
// Centre titlebar if required.
@ -758,22 +755,15 @@ IceWMClient::IceWMClient( Workspace *ws, WId w, QWidget *parent, const char *nam
titleSpacerS = addPixmapSpacer( titleS, spTitleBar, 1 );
titleSpacerP = addPixmapSpacer( titleP );
titlebar = new QSpacerItem( titleTextWidth(caption()), titleBarHeight,
titlebar = new QSpacerItem( titleTextWidth(caption()), titleBarHeight,
QSizePolicy::Preferred, QSizePolicy::Fixed );
hb->addItem(titlebar);
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()) ){
titleSpacerR = addPixmapSpacer( titleR );
titleSpacerB = addPixmapSpacer( titleB, QSizePolicy::Expanding, 1 );
titleSpacerM = addPixmapSpacer( titleM );
addClientButtons( *titleButtonsLeft );
}
else{
titleSpacerM = addPixmapSpacer( titleM );
titleSpacerB = addPixmapSpacer( titleB, QSizePolicy::Expanding, 1 );
titleSpacerR = addPixmapSpacer( titleR );
addClientButtons( *titleButtonsRight );
}
titleSpacerM = addPixmapSpacer( titleM );
titleSpacerB = addPixmapSpacer( titleB, QSizePolicy::Expanding, 1 );
titleSpacerR = addPixmapSpacer( titleR );
addClientButtons( *titleButtonsRight );
titleSpacerQ = addPixmapSpacer( titleQ );
@ -798,31 +788,25 @@ IceWMClient::~IceWMClient()
// in the button string 's'
void IceWMClient::addClientButtons( const QString& s )
{
/* QString ss = s;
if (QApplication::reverseLayout())
ss = clientHandler->reverseString( s );*/
int str_len = s.length();
if (str_len > 0)
for(unsigned int i = 0; i < str_len; i++)
if (s.length() > 0)
for(unsigned int i = 0; i < s.length(); i++)
{
switch ( (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))?
s[str_len-i-1].latin1():s[i].latin1() )
switch ( s[i].latin1() )
{
case 's':
// Create the menu icons, and render with the current mini-icon
// Create the menu icons, and render with the current mini-icon
// if explicitly requested by the theme.
if ( validPixmaps(menuButtonPix) && !button[BtnSysMenu])
{
if (showMenuButtonIcon) {
renderMenuIcons();
button[BtnSysMenu] = new IceWMButton(this, "menu",
&menuButtonWithIconPix, false, i18n("Menu"));
button[BtnSysMenu] = new IceWMButton(this, "menu",
&menuButtonWithIconPix, false, i18n("Menu"));
}
else
button[BtnSysMenu] = new IceWMButton(this, "menu",
&menuButtonPix, false, i18n("Menu"));
button[BtnSysMenu] = new IceWMButton(this, "menu",
&menuButtonPix, false, i18n("Menu"));
connect( button[BtnSysMenu], SIGNAL(pressed()),
this, SLOT(menuButtonPressed()));
hb->addWidget( button[BtnSysMenu] );
@ -970,7 +954,7 @@ void IceWMClient::resizeEvent( QResizeEvent* e )
Client::resizeEvent( e );
calcHiddenButtons();
if (isVisibleToTLW())
if (isVisibleToTLW())
{
update(rect());
int dx = 0;
@ -1370,14 +1354,12 @@ Client::MousePosition IceWMClient::mousePosition( const QPoint& p ) const
// Make sure the menu button follows double click conventions set in kcontrol
void IceWMClient::menuButtonPressed()
{
// Animate the menu button when pressed
if (button[BtnSysMenu])
button[BtnSysMenu]->animateClick();
QPoint menuPoint ( button[BtnSysMenu]->rect().bottomLeft() );
// Move to right if menu on rhs, otherwise on left
// and make this depend on windowWrapper(), not button.
QPoint pos = button[BtnSysMenu]->mapToGlobal( menuPoint );
workspace()->showWindowMenu( pos.x(), pos.y(), this );
QPoint menuPoint ( button[BtnSysMenu]->rect().bottomLeft() );
// Move to right if menu on rhs, otherwise on left
// and make this depend on windowWrapper(), not button.
workspace()->showWindowMenu( button[BtnSysMenu]->mapToGlobal(menuPoint), this );
button[BtnSysMenu]->setDown(false);
}

View File

@ -49,7 +49,7 @@
#include "../../kwinbutton.h"
class QLabel;
class QSpacerItem;
class QHBoxLayout;
class QBoxLayout;
class QGridLayout;
namespace KWinInternal {
@ -164,7 +164,7 @@ class IceWMClient : public KWinInternal::Client
QSpacerItem* titleSpacerB;
QSpacerItem* titleSpacerR;
QSpacerItem* titleSpacerQ;
QHBoxLayout* hb;
QBoxLayout* hb;
QGridLayout* grid;
};

View File

@ -257,47 +257,31 @@ StdClient::StdClient( Workspace *ws, WId w, QWidget *parent, const char *name )
button[4] = new ThreeButtonButton( this, 0, i18n("Maximize") );
button[5] = new KWinToolButton( this, 0, i18n("Close") );
QHBoxLayout* hb = new QHBoxLayout;
QBoxLayout* hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
g->addLayout( hb, 0, 1 );
hb->addWidget( button[0] );
hb->addWidget( button[1] );
// hb->addWidget( button[2] );
int fh = fontMetrics().lineSpacing();
titlebar = new QSpacerItem(10, fh, QSizePolicy::Expanding,
QSizePolicy::Minimum );
hb->addItem( titlebar );
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows())){
hb->addWidget( button[5] );
hb->addWidget( button[4] );
hb->addWidget( button[3] );
if ( providesContextHelp() ) {
button[6] = new KWinToolButton( this, 0, i18n("Help") );
hb->addWidget( button[6] ); // help button
hb->addItem( new QSpacerItem( 5, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
button[6]->setIconSet( isActive() ? *question_mark_pix : *dis_question_mark_pix);
connect( button[6], SIGNAL( clicked() ), this, ( SLOT( contextHelp() ) ) );
}
button[6] = 0;
hb->addItem( titlebar );
// hb->addWidget( button[2] );
hb->addWidget( button[1] );
hb->addWidget( button[0] );
}
else{
hb->addWidget( button[0] );
hb->addWidget( button[1] );
// hb->addWidget( button[2] );
hb->addItem( titlebar );
button[6] = 0;
if ( providesContextHelp() ) {
button[6] = new KWinToolButton( this, 0, i18n("Help") );
hb->addWidget( button[6] ); // help button
hb->addItem( new QSpacerItem( 5, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
button[6]->setIconSet( isActive() ? *question_mark_pix : *dis_question_mark_pix);
connect( button[6], SIGNAL( clicked() ), this, ( SLOT( contextHelp() ) ) );
}
hb->addWidget( button[3] );
hb->addWidget( button[4] );
hb->addWidget( button[5] );
button[6] = 0;
if ( providesContextHelp() ) {
button[6] = new KWinToolButton( this, 0, i18n("Help") );
hb->addWidget( button[6] ); // help button
hb->addItem( new QSpacerItem( 5, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
button[6]->setIconSet( isActive() ? *question_mark_pix : *dis_question_mark_pix);
connect( button[6], SIGNAL( clicked() ), this, ( SLOT( contextHelp() ) ) );
}
hb->addWidget( button[3] );
hb->addWidget( button[4] );
hb->addWidget( button[5] );
for ( int i = 0; i < 7; i++) {
if ( !button[i] )
continue;
@ -325,8 +309,8 @@ StdClient::StdClient( Workspace *ws, WId w, QWidget *parent, const char *name )
button[5]->setIconSet(isActive() ? *close_pix : *dis_close_pix);
connect( button[5], SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) );
// if ( button[6] ) {
// }
if ( button[6] ) {
}
if ( isTransient() ) {
@ -461,12 +445,10 @@ void StdClient::iconChange()
*/
void StdClient::menuButtonPressed()
{
// Animate the click when the menu button is pressed
button[0]->animateClick();
QPoint menupoint ( button[0]->rect().bottomLeft().x()-1,
button[0]->rect().bottomLeft().y()+2 );
QPoint pos = button[0]->mapToGlobal( menupoint );
workspace()->showWindowMenu( pos.x(), pos.y(), this );
workspace()->showWindowMenu( button[0]->mapToGlobal( menupoint ), this );
button[0]->setDown(false);
}

View File

@ -128,7 +128,7 @@ namespace Keramik
KeramikHandler *clientHandler = NULL;
bool keramik_initialized = false;
} // namespace Keramik
} // namespace Keramik
@ -146,6 +146,8 @@ KeramikHandler::KeramikHandler()
settings_cache = NULL;
imageDict = new ImageDict;
// Create the button deco bitmaps
buttonDecos[ Menu ] = new QBitmap( 17, 17, menu_bits, true );
buttonDecos[ Sticky ] = new QBitmap( 17, 17, sticky_on_bits, true );
@ -164,7 +166,7 @@ KeramikHandler::KeramikHandler()
if ( QApplication::reverseLayout() ) {
for ( int i = 0; i < Help; i++ )
flip( reinterpret_cast<QPixmap**>(buttonDecos)[i] );
for ( int i = Help + 1; i < NumButtonDecos; i++ )
flip( reinterpret_cast<QPixmap**>(buttonDecos)[i] );
}
@ -186,6 +188,9 @@ KeramikHandler::~KeramikHandler()
if ( settings_cache )
delete settings_cache;
if ( imageDict )
delete imageDict;
}
@ -404,7 +409,7 @@ void KeramikHandler::readConfig()
if ( ! settings_cache ) {
settings_cache = new SettingsCache;
if ( options->customButtonPositions() ) {
settings_cache->buttonsLeft = options->titleButtonsLeft();
settings_cache->buttonsRight = options->titleButtonsRight();
@ -412,13 +417,12 @@ void KeramikHandler::readConfig()
settings_cache->buttonsLeft = QString( default_left );
settings_cache->buttonsRight = QString( default_right );
}
settings_cache->aTitleColor = options->color( Options::TitleBar, true );
settings_cache->aTitleBlend = options->color( Options::TitleBlend, true );
settings_cache->iTitleColor = options->color( Options::TitleBar, false );
settings_cache->iTitleBlend = options->color( Options::TitleBlend, false );
settings_cache->buttonColor = options->color( Options::ButtonBg, true );
settings_cache->reverseBIDIWindows = options->reverseBIDIWindows();
}
delete c;
@ -434,14 +438,14 @@ QPixmap *KeramikHandler::composite( QImage *over, QImage *under )
// Clear the destination image
Q_UINT32 *data = reinterpret_cast<Q_UINT32*>( dest.bits() );
for (int i = 0; i < width * height; i++)
*(data++) = 0;
*(data++) = 0;
// Copy the under image (bottom aligned) to the destination image
for (int y1 = height - under->height(), y2 = 0; y1 < height; y1++, y2++ )
{
register Q_UINT32 *dst = reinterpret_cast<Q_UINT32*>( dest.scanLine(y1) );
register Q_UINT32 *src = reinterpret_cast<Q_UINT32*>( under->scanLine(y2) );
for ( int x = 0; x < width; x++ )
*(dst++) = *(src++);
}
@ -457,33 +461,33 @@ QPixmap *KeramikHandler::composite( QImage *over, QImage *under )
if ( a == 0xff )
*dst = *src;
else if ( a != 0x00 )
*dst = qRgba( Q_UINT8( r1 + (((r2 - r1) * a) >> 8) ),
Q_UINT8( g1 + (((g2 - g1) * a) >> 8) ),
Q_UINT8( b1 + (((b2 - b1) * a) >> 8) ),
0xff );
else if ( qAlpha(*dst) == 0x00 )
*dst = 0;
src++; dst++;
}
// Compute a 1 bpp mask from the alpha channel
QImage alphaMask = dest.createAlphaMask();
dest.setAlphaBuffer( false );
// Create the final pixmap
QPixmap *pix = new QPixmap( dest );
// Set the computed mask for the pixmap
if ( ! alphaMask.isNull() ) {
QBitmap mask;
mask.convertFromImage( alphaMask );
pix->setMask( mask );
}
}
return pix;
}
@ -492,11 +496,11 @@ QPixmap *KeramikHandler::composite( QImage *over, QImage *under )
QImage *KeramikHandler::loadImage( const QString &name, const QColor &col )
{
if ( col.isValid() ) {
QImage *img = new QImage( qembed_findImage(name).copy() );
QImage *img = new QImage( qembed_findImage(name)->copy() );
KIconEffect::colorize( *img, col, 1.0 );
return img;
} else
return new QImage( qembed_findImage(name).copy() );
return new QImage( qembed_findImage(name)->copy() );
}
@ -513,9 +517,9 @@ QPixmap *KeramikHandler::loadPixmap( const QString &name, const QColor &col )
void KeramikHandler::reset()
{
QString buttonsLeft, buttonsRight;
keramik_initialized = false;
bool needHardReset = false;
bool pixmapsInvalid = false;
@ -531,7 +535,7 @@ void KeramikHandler::reset()
{
pixmapsInvalid = true;
}
// Check if button positions have changed
if ( options->customButtonPositions() ) {
buttonsLeft = options->titleButtonsLeft();
@ -540,16 +544,12 @@ void KeramikHandler::reset()
buttonsLeft = QString( default_left );
buttonsRight = QString( default_right );
}
if ( (settings_cache->buttonsLeft != buttonsLeft) ||
(settings_cache->buttonsRight != buttonsRight) ) {
needHardReset = true;
}
// bidi is always a mess..
if (settings_cache->reverseBIDIWindows != options->reverseBIDIWindows())
needHardReset = true;
// Update our config cache
settings_cache->aTitleColor = options->color( Options::TitleBar, true );
settings_cache->aTitleBlend = options->color( Options::TitleBlend, true );
@ -558,8 +558,8 @@ void KeramikHandler::reset()
settings_cache->buttonColor = options->color( Options::ButtonBg, true );
settings_cache->buttonsLeft = buttonsLeft;
settings_cache->buttonsRight = buttonsRight;
settings_cache->reverseBIDIWindows = options->reverseBIDIWindows();
// Do we need to recreate the pixmaps?
if ( pixmapsInvalid ) {
destroyPixmaps();
@ -721,31 +721,26 @@ KeramikClient::KeramikClient( Workspace *ws, WId w, QWidget *parent, const char
button[i] = NULL;
QVBoxLayout *mainLayout = new QVBoxLayout( this );
QHBoxLayout *titleLayout = new QHBoxLayout();
QBoxLayout *titleLayout = new QBoxLayout( 0, QBoxLayout::LeftToRight, 0, 0, 0 );
QHBoxLayout *windowLayout = new QHBoxLayout();
largeTitlebar = ( !maximizedVertical() && clientHandler->largeCaptionBubbles() );
largeCaption = ( isActive() && largeTitlebar );
int topSpacing = ( largeTitlebar ? 4 : 1 );
topSpacer = new QSpacerItem( 10, topSpacing,
QSizePolicy::Expanding, QSizePolicy::Minimum );
mainLayout->addItem( topSpacer );
mainLayout->addLayout( titleLayout ); // Titlebar
mainLayout->addLayout( windowLayout, 1 ); // Left border + window + right border
mainLayout->addSpacing( 8 ); // Bottom grab bar + shadow
titleLayout->setSpacing( buttonSpacing );
titleLayout->addSpacing( buttonMargin ); // Left button margin
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
addButtons( titleLayout, options->customButtonPositions() ?
options->titleButtonsRight() : QString(default_left) );
else
addButtons( titleLayout, options->customButtonPositions() ?
addButtons( titleLayout, options->customButtonPositions() ?
options->titleButtonsLeft() : QString(default_left) );
titlebar = new QSpacerItem( 10, clientHandler->titleBarHeight(largeTitlebar)
@ -753,14 +748,8 @@ KeramikClient::KeramikClient( Workspace *ws, WId w, QWidget *parent, const char
titleLayout->addItem( titlebar );
titleLayout->addSpacing( buttonSpacing );
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
addButtons( titleLayout, options->customButtonPositions() ?
options->titleButtonsLeft() : QString(default_right) );
else
addButtons( titleLayout, options->customButtonPositions() ?
addButtons( titleLayout, options->customButtonPositions() ?
options->titleButtonsRight() : QString(default_right) );
titleLayout->addSpacing( buttonMargin - 1 ); // Right button margin
windowLayout->addSpacing( 3 ); // Left border
@ -819,20 +808,17 @@ void KeramikClient::reset()
// (i.e. not minimized and on the current desktop)
if ( isVisible() ) {
repaint( false );
for ( int i = 0; i < NumButtons; i++ )
if ( button[i] ) button[i]->repaint( false );
}
}
void KeramikClient::addButtons( QHBoxLayout *layout, const QString &s )
void KeramikClient::addButtons( QBoxLayout *layout, const QString &s )
{
uint i = 0;
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
i = s.length() - 1;
for( ; ( i < s.length()) ;) { // i>=0
for ( uint i=0; i < s.length(); i++ )
{
switch ( s[i].latin1() )
{
// Menu button
@ -852,7 +838,7 @@ void KeramikClient::addButtons( QHBoxLayout *layout, const QString &s )
layout->addWidget( button[StickyButton] );
}
break;
// Help button
case 'H' :
if ( !button[HelpButton] && providesContextHelp() ) {
@ -879,7 +865,7 @@ void KeramikClient::addButtons( QHBoxLayout *layout, const QString &s )
layout->addWidget( button[MaxButton] );
}
break;
// Close button
case 'X' :
if ( !button[CloseButton] ) {
@ -888,18 +874,12 @@ void KeramikClient::addButtons( QHBoxLayout *layout, const QString &s )
layout->addWidget( button[CloseButton] );
}
break;
// Additional spacing
case '_' :
layout->addSpacing( buttonSpacing );
break;
}
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
i--;
else
i++;
}
}
@ -1212,26 +1192,10 @@ void KeramikClient::stickyChange( bool on )
void KeramikClient::menuButtonPressed()
{
static KeramikClient *tc = 0;
if (tc == this)
{
workspace()->clientPopup( this )->hide();
tc = 0;
}
else
{
QPoint menuPoint ( button[MenuButton]->rect().bottomLeft().x() - 6,
button[MenuButton]->rect().bottomLeft().y() + 3 );
workspace()->clientPopup( this )->popup( button[MenuButton]->mapToGlobal( menuPoint ) );
// Post a fake mouse button release event to the menu button
// to ensure that it's redrawn in its unpressed state
QApplication::postEvent( button[MenuButton], new QMouseEvent( QEvent::MouseButtonRelease,
QPoint(0,0), Qt::LeftButton, Qt::LeftButton ) );
tc = this;
}
QPoint menuPoint ( button[MenuButton]->rect().bottomLeft().x() - 6,
button[MenuButton]->rect().bottomLeft().y() + 3 );
workspace()->showWindowMenu( button[MenuButton]->mapToGlobal( menuPoint ), this );
button[MenuButton]->setDown(false);
}

View File

@ -30,17 +30,18 @@
#include "../../client.h"
#include "../../kwinbutton.h"
static QDict< QImage > imageDict;
#include "tiles.h"
class QSpacerItem;
using namespace KWinInternal;
namespace Keramik {
typedef QDict<QImage> ImageDict;
static ImageDict* imageDict = 0;
#include "tiles.h"
enum TilePixmap { TitleLeft=0, TitleCenter, TitleRight,
CaptionSmallLeft, CaptionSmallCenter, CaptionSmallRight,
CaptionLargeLeft, CaptionLargeCenter, CaptionLargeRight,
@ -62,7 +63,6 @@ namespace Keramik {
QColor buttonColor;
QString buttonsLeft;
QString buttonsRight;
bool reverseBIDIWindows;
};
class KeramikHandler : public QObject {
@ -152,7 +152,7 @@ namespace Keramik {
~KeramikClient();
private:
void addButtons( QHBoxLayout*, const QString & );
void addButtons( QBoxLayout*, const QString & );
void updateMask();
void updateCaptionBuffer();
void captionChange( const QString& );

View File

@ -616,12 +616,12 @@ static struct EmbedImage {
{ 0, 0, 0, 0, 0, 0, 0, 0 }
};
static const QImage& qembed_findImage( const QString& name )
const QImage* qembed_findImage( const QString& name )
{
QImage* img = imageDict.find(name);
if ( !img ) {
for (int i=0; embed_image_vec[i].data; i++) {
QImage* img = imageDict->find(name);
if ( !img )
{
for (int i=0; embed_image_vec[i].data; i++)
if ( 0==strcmp(embed_image_vec[i].name, name) ) {
img = new QImage((uchar*)embed_image_vec[i].data,
embed_image_vec[i].width,
@ -635,13 +635,8 @@ static const QImage& qembed_findImage( const QString& name )
img->setAlphaBuffer(TRUE);
break;
}
}
if ( !img ) {
static QImage dummy;
return dummy;
}
}
return *img;
return img;
}
#endif

View File

@ -273,7 +273,7 @@ NextClient::NextClient( Workspace *ws, WId w, QWidget *parent,
connect(options, SIGNAL(resetClients()), this, SLOT(slotReset()));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QHBoxLayout *titleLayout = new QHBoxLayout();
QBoxLayout *titleLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
QHBoxLayout *windowLayout = new QHBoxLayout();
mainLayout->addLayout(titleLayout);
@ -298,7 +298,7 @@ NextClient::NextClient( Workspace *ws, WId w, QWidget *parent,
button is selected in the current button scheme, or (2) null
otherwise.
*/
void NextClient::initializeButtonsAndTitlebar(QHBoxLayout* titleLayout)
void NextClient::initializeButtonsAndTitlebar(QBoxLayout* titleLayout)
{
// Null the buttons to begin with (they are not guaranteed to be null).
for (int i=0; i<MAX_NUM_BUTTONS; i++) {
@ -336,16 +336,10 @@ void NextClient::initializeButtonsAndTitlebar(QHBoxLayout* titleLayout)
/** Adds the buttons for one side of the title bar, based on the spec
* string; see the KWinInternal::Options class, methods
* titleButtonsLeft and titleBUttonsRight. */
void NextClient::addButtons(QHBoxLayout* titleLayout, const QString& spec)
void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec)
{
int str_len = spec.length();
if (str_len <= 0)
return;
for (unsigned int i=0; i<spec.length(); i++) {
//switch (spec[i].latin1()) {
switch( (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))?
spec[str_len-i-1].latin1():spec[i].latin1()){
switch (spec[i].latin1()) {
case 'A':
if (isMaximizable()) {
button[MAXIMIZE_IDX] =
@ -376,7 +370,7 @@ void NextClient::addButtons(QHBoxLayout* titleLayout, const QString& spec)
this, SLOT(iconify()) );
}
break;
case 'M':
button[MENU_IDX] =
new NextButton(this, "menu", NULL, 10, 10, i18n("Menu"));
@ -417,16 +411,14 @@ void NextClient::addButtons(QHBoxLayout* titleLayout, const QString& spec)
}
}
// Make sure the menu button follows double click conventions set in kcontrol
// (Note: this was almost straight copy and paste from KDEDefaultClient.)
void NextClient::menuButtonPressed()
{
// Probably don't need this null check, but we might as well.
if (button[MENU_IDX]) {
QPoint menupoint ( button[MENU_IDX]->rect().bottomLeft().x()-1,
button[MENU_IDX]->rect().bottomLeft().y()+2 );
QPoint pos = button[MENU_IDX]->mapToGlobal( menupoint );
workspace()->showWindowMenu( pos.x(), pos.y(), this );
workspace()->showWindowMenu(button[MENU_IDX]->mapToGlobal(menupoint), this);
button[MENU_IDX]->setDown(false);
}
}

View File

@ -58,8 +58,8 @@ protected slots:
void maximizeButtonClicked();
private:
void initializeButtonsAndTitlebar(QHBoxLayout* titleLayout);
void addButtons(QHBoxLayout* titleLayout, const QString& buttons);
void initializeButtonsAndTitlebar(QBoxLayout* titleLayout);
void addButtons(QBoxLayout* titleLayout, const QString& buttons);
QSpacerItem* titlebar;

View File

@ -263,7 +263,7 @@ KWMThemeClient::KWMThemeClient( Workspace *ws, WId w, QWidget *parent,
layout->setRowStretch(2, 10);
layout->setColStretch(1, 10);
QHBoxLayout* hb = new QHBoxLayout;
QBoxLayout* hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
layout->addLayout( hb, 1, 1 );
KConfig *config = KGlobal::config();

View File

@ -219,8 +219,8 @@ static void delete_pixmaps()
}
LaptopClientButton::LaptopClientButton(int w, int h, Client *parent,
const char *name, const unsigned char *bitmap,
LaptopClientButton::LaptopClientButton(int w, int h, Client *parent,
const char *name, const unsigned char *bitmap,
const QString& tip)
: KWinButton(parent, name, tip)
{
@ -230,7 +230,7 @@ LaptopClientButton::LaptopClientButton(int w, int h, Client *parent,
resize(defaultSize);
if(bitmap)
setBitmap(bitmap);
setBackgroundMode(QWidget::NoBackground);
//setBackgroundMode(QWidget::NoBackground);
}
QSize LaptopClientButton::sizeHint() const
@ -322,7 +322,7 @@ LaptopClient::LaptopClient( Workspace *ws, WId w, QWidget *parent,
if ( isTool() )
th -= 2;
button[BtnClose] = new LaptopClientButton(27, th, this, "close",
button[BtnClose] = new LaptopClientButton(27, th, this, "close",
close_bits, i18n("Close"));
button[BtnSticky] = new LaptopClientButton(17, th, this, "sticky",
NULL, i18n("Sticky"));
@ -347,37 +347,21 @@ LaptopClient::LaptopClient( Workspace *ws, WId w, QWidget *parent,
connect( button[BtnIconify], SIGNAL( clicked() ), this, ( SLOT( iconify() ) ) );
connect( button[BtnMax], SIGNAL( clicked() ), this, ( SLOT( slotMaximize() ) ) );
hb = new QHBoxLayout();
hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
hb->setResizeMode(QLayout::FreeResize);
g->addLayout( hb, 1, 1 );
titlebar = new QSpacerItem(10, th, QSizePolicy::Expanding, QSizePolicy::Minimum);
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows())){
hb->addWidget( button[BtnMax]);
hb->addWidget( button[BtnIconify]);
hb->addWidget( button[BtnSticky]);
if(help){
hb->addWidget( button[BtnHelp]);
}
hb->addSpacing(1);
hb->addItem(titlebar);
hb->addSpacing(1);
hb->addWidget( button[BtnClose]);
hb->addWidget( button[BtnClose]);
hb->addSpacing(1);
titlebar = new QSpacerItem(10, th, QSizePolicy::Expanding,
QSizePolicy::Minimum);
hb->addItem(titlebar);
hb->addSpacing(1);
if(help){
hb->addWidget( button[BtnHelp]);
}
else{
hb->addWidget( button[BtnClose]);
hb->addSpacing(1);
hb->addItem(titlebar);
hb->addSpacing(1);
if(help){
hb->addWidget( button[BtnHelp]);
}
hb->addWidget( button[BtnSticky]);
hb->addWidget( button[BtnIconify]);
hb->addWidget( button[BtnMax]);
}
hb->addWidget( button[BtnSticky]);
hb->addWidget( button[BtnIconify]);
hb->addWidget( button[BtnMax]);
if ( isTransient() || isTool() )
button[BtnSticky]->hide();

View File

@ -7,7 +7,7 @@
#include "../../kwinbutton.h"
class QLabel;
class QSpacerItem;
class QHBoxLayout;
class QBoxLayout;
namespace KWinInternal {
@ -74,7 +74,7 @@ private:
int lastButtonWidth;
QSpacerItem* titlebar;
bool hiddenItems;
QHBoxLayout* hb;
QBoxLayout* hb;
KPixmap activeBuffer;
bool bufferDirty;
int lastBufferWidth;

View File

@ -294,6 +294,8 @@ ModernSys::ModernSys( Workspace *ws, WId w, QWidget *parent,
const char *name )
: Client( ws, w, parent, name, WResizeNoErase )
{
bool reverse = QApplication::reverseLayout();
connect(options, SIGNAL(resetClients()), this, SLOT(slotReset()));
bool help = providesContextHelp();
@ -302,12 +304,12 @@ ModernSys::ModernSys( Workspace *ws, WId w, QWidget *parent,
g->setRowStretch(1, 10);
g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
g->addColSpacing(0, 2);
g->addColSpacing(2, 2 + handle_width);
g->addColSpacing(0, 2 + (reverse ? handle_width : 0));
g->addColSpacing(2, 2 + (reverse ? 0 : handle_width));
g->addRowSpacing(2, 2 + handle_width);
QHBoxLayout* hb = new QHBoxLayout(0);
QBoxLayout* hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
hb->setResizeMode(QLayout::FreeResize);
titlebar = new QSpacerItem(10, 16, QSizePolicy::Expanding,
QSizePolicy::Minimum);
@ -325,12 +327,7 @@ ModernSys::ModernSys( Workspace *ws, WId w, QWidget *parent,
connect( button[BtnHelp], SIGNAL(clicked()), this, SLOT( contextHelp() ) );
for (int i = 0; i < (int)button_pattern->length();) {
QChar c;
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
c = (*button_pattern)[button_pattern->length()-i++];
else
c = (*button_pattern)[i++];
QChar c = (*button_pattern)[i++];
if (c == '_')
c = '3';

View File

@ -443,22 +443,16 @@ QuartzClient::QuartzClient( Workspace *ws, WId w, QWidget *parent,
g->addColSpacing(2, 4);
// Pack the titlebar HBox with items
hb = new QHBoxLayout();
hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
hb->setResizeMode( QLayout::FreeResize );
g->addLayout ( hb, 1, 1 );
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
addClientButtons( options->titleButtonsRight() );
else
addClientButtons( options->titleButtonsLeft() );
titlebar = new QSpacerItem( 10, titleHeight, QSizePolicy::Expanding, QSizePolicy::Minimum );
hb->addItem(titlebar);
hb->addSpacing(2);
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
addClientButtons( options->titleButtonsLeft(), false );
else
addClientButtons( options->titleButtonsRight(), false );
hb->addSpacing(2);
@ -467,20 +461,18 @@ QuartzClient::QuartzClient( Workspace *ws, WId w, QWidget *parent,
void QuartzClient::addClientButtons( const QString& s, bool isLeft )
{
int str_len = s.length();
if (str_len > 0)
if (s.length() > 0)
for(unsigned int i = 0; i < s.length(); i++)
{
switch( QApplication::reverseLayout() && (!options->reverseBIDIWindows())?
s[str_len-i-1].latin1():s[i].latin1())
switch( s[i].latin1() )
{
// Menu button
case 'M':
if (!button[BtnMenu])
{
button[BtnMenu] = new QuartzButton(this, "menu",
button[BtnMenu] = new QuartzButton(this, "menu",
largeButtons, isLeft, false, NULL, i18n("Menu"));
connect( button[BtnMenu], SIGNAL(pressed()),
connect( button[BtnMenu], SIGNAL(pressed()),
this, SLOT(menuButtonPressed()) );
hb->addWidget( button[BtnMenu] );
}
@ -519,7 +511,7 @@ void QuartzClient::addClientButtons( const QString& s, bool isLeft )
{
button[BtnIconify] = new QuartzButton(this, "iconify",
largeButtons, isLeft, true, iconify_bits, i18n("Minimize"));
connect( button[BtnIconify], SIGNAL( clicked()),
connect( button[BtnIconify], SIGNAL( clicked()),
this, SLOT(iconify()) );
hb->addWidget( button[BtnIconify] );
}
@ -543,7 +535,7 @@ void QuartzClient::addClientButtons( const QString& s, bool isLeft )
{
button[BtnClose] = new QuartzButton(this, "close",
largeButtons, isLeft, true, close_bits, i18n("Close"));
connect( button[BtnClose], SIGNAL( clicked()),
connect( button[BtnClose], SIGNAL( clicked()),
this, SLOT(closeWindow()) );
hb->addWidget( button[BtnClose] );
}
@ -645,7 +637,7 @@ void QuartzClient::paintEvent( QPaintEvent* )
g = options->colorGroup(Options::TitleBar, isActive());
else
g = options->colorGroup(Options::Frame, isActive());
// Draw outer highlights and lowlights
p.setPen( g.light().light(120) );
p.drawLine( x, y, x2-1, y );
@ -667,7 +659,7 @@ void QuartzClient::paintEvent( QPaintEvent* )
p.drawRect( x+3, y + titleHeight + 3, w-6, h-titleHeight-6 );
// Drawing this extra line removes non-drawn areas when shaded
p.drawLine( x+4, y2-4, x2-4, y2-4);
p.drawLine( x+4, y2-4, x2-4, y2-4);
// Highlight top corner
p.setPen( g.light().light(160) );
@ -684,16 +676,14 @@ void QuartzClient::paintEvent( QPaintEvent* )
QColor c1 = options->color(Options::TitleBar, isActive() ).light(130);
QColor c2 = options->color(Options::TitleBlend, isActive() );
// Create a disposable pixmap buffer for the titlebar
// Create a disposable pixmap buffer for the titlebar
KPixmap* titleBuffer = new KPixmap;
titleBuffer->resize( w-6, titleHeight );
titleBuffer->resize( w-6, titleHeight );
QPainter p2( titleBuffer, this );
int rightoffset = r.x()+r.width()-25-4; // subtract titleBlocks pixmap width and some
/*if (QApplication::reverseLayout() && (!options->reverseBIDIWindows()))
rightoffset = 0;
*/
int rightoffset = r.x()+r.width()-25-4; // subtract titleBlocks pixmap width and some
p2.fillRect( 0, 0, w, r.height(), c1 );
p2.fillRect( rightoffset, 0, w-rightoffset-6, r.height(), c2 );
@ -707,8 +697,8 @@ void QuartzClient::paintEvent( QPaintEvent* )
// for toolwindows than the default.
QFont fnt = options->font(true);
if ( !largeButtons )
{
fnt.setPointSize( fnt.pointSize() - 3 ); // Shrink font by 3pt
{
fnt.setPointSize( fnt.pointSize() - 3 ); // Shrink font by 3pt
fnt.setWeight( QFont::Normal ); // and disable bold
}
p2.setFont( fnt );
@ -802,8 +792,8 @@ void QuartzClient::menuButtonPressed()
{
QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-1,
button[BtnMenu]->rect().bottomLeft().y()+2 );
QPoint pos = button[BtnMenu]->mapToGlobal( menupoint );
workspace()->showWindowMenu( pos.x(), pos.y(), this );
workspace()->showWindowMenu( button[BtnMenu]->mapToGlobal( menupoint ), this );
button[BtnMenu]->setDown(false);
}

View File

@ -24,7 +24,7 @@
#include "../../kwinbutton.h"
class QSpacerItem;
class QHBoxLayout;
class QBoxLayout;
namespace KWinInternal {
@ -107,7 +107,7 @@ class QuartzClient : public KWinInternal::Client
int lastButtonWidth;
int titleHeight;
bool largeButtons;
QHBoxLayout* hb;
QBoxLayout* hb;
QSpacerItem* titlebar;
};

View File

@ -412,59 +412,31 @@ GalliumClient::GalliumClient( Workspace *ws, WId w, QWidget *parent,
connect( button[BtnMax], SIGNAL( clicked() ), this, SLOT( slotMaximize() ));
connect( options, SIGNAL(resetClients()), this, SLOT( slotReset() ));
// Pack the titleBar hbox with items
hb = new QHBoxLayout();
// Pack the titleBar hbox with items
hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
hb->setResizeMode(QLayout::FreeResize);
g->addLayout( hb, 1, 1 );
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows())){
hb->addWidget( button[BtnClose] );
hb->addSpacing(2);
hb->addWidget( button[BtnMax] );
hb->addWidget( button[BtnIconify] );
hb->addSpacing(2);
hb->addSpacing(2);
hb->addWidget( button[BtnMenu] );
titlebar = new QSpacerItem(10, titleHeight, QSizePolicy::Expanding, QSizePolicy::Minimum);
hb->addItem(titlebar);
hb->addSpacing(2);
if( providesContextHelp() )
{
button[BtnHelp] = new GalliumButton(this, "help", question_bits, false, smallButtons,
i18n("Help"));
connect( button[BtnHelp], SIGNAL( clicked() ), this, SLOT( contextHelp() ));
hb->addWidget( button[BtnHelp] );
}
else
button[BtnHelp] = NULL;
titlebar = new QSpacerItem(10, titleHeight, QSizePolicy::Expanding, QSizePolicy::Minimum);
hb->addItem(titlebar);
hb->addSpacing(2);
hb->addWidget( button[BtnMenu] );
hb->addSpacing(2);
if( providesContextHelp() )
{
button[BtnHelp] = new GalliumButton(this, "help", question_bits, false, smallButtons,
i18n("Help"));
connect( button[BtnHelp], SIGNAL( clicked() ), this, SLOT( contextHelp() ));
hb->addWidget( button[BtnHelp] );
}
else{
hb->addSpacing(2);
hb->addWidget( button[BtnMenu] );
titlebar = new QSpacerItem(10, titleHeight, QSizePolicy::Expanding, QSizePolicy::Minimum);
hb->addItem(titlebar);
hb->addSpacing(2);
else
button[BtnHelp] = NULL;
if( providesContextHelp() )
{
button[BtnHelp] = new GalliumButton(this, "help", question_bits, false, smallButtons,
i18n("Help"));
hb->addSpacing(2);
connect( button[BtnHelp], SIGNAL( clicked() ), this, SLOT( contextHelp() ));
hb->addWidget( button[BtnHelp] );
}
else
button[BtnHelp] = NULL;
hb->addWidget( button[BtnIconify] );
hb->addWidget( button[BtnMax] );
hb->addSpacing(2);
hb->addWidget( button[BtnClose] );
hb->addSpacing(2);
}
hb->addWidget( button[BtnIconify] );
hb->addWidget( button[BtnMax] );
hb->addSpacing(2);
hb->addWidget( button[BtnClose] );
hb->addSpacing(2);
// Hide buttons which are not required
// We can un-hide them if required later
@ -782,11 +754,10 @@ void GalliumClient::calcHiddenButtons()
void GalliumClient::menuButtonPressed()
{
// KS - move the menu left by 3 pixels, and down 2 pixels.
QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-3,
button[BtnMenu]->rect().bottomLeft().y()+2 );
QPoint pos = button[BtnMenu]->mapToGlobal( menupoint );
workspace()->showWindowMenu( pos.x(), pos.y(), this );
workspace()->showWindowMenu( button[BtnMenu]->mapToGlobal( menupoint ), this );
button[BtnMenu]->setDown(false);
}
extern "C"

View File

@ -24,7 +24,7 @@
#include "../../kwinbutton.h"
class QLabel;
class QSpacerItem;
class QHBoxLayout;
class QBoxLayout;
namespace KWinInternal {
@ -90,7 +90,7 @@ class GalliumClient : public KWinInternal::Client
int titleHeight;
QSpacerItem* titlebar;
bool hiddenItems;
QHBoxLayout* hb;
QBoxLayout* hb;
bool smallButtons;
};

View File

@ -596,16 +596,12 @@ Manager::createTitle()
QPtrList<Button> *buttonList = &leftButtonList_;
unsigned int str_len = buttons.length();
for (unsigned int i = 0; i < str_len; ++i)
for (unsigned int i = 0; i < buttons.length(); ++i)
{
Button * tb = 0;
switch ((QApplication::reverseLayout() && (!options->reverseBIDIWindows()))?
buttons[str_len-i-1].latin1():
buttons[i].latin1()
)
//switch (buttons[i].latin1())
switch (buttons[i].latin1())
{
case 'S': // Sticky
tb = createButton(Button::Sticky, this);
@ -636,15 +632,9 @@ Manager::createTitle()
buttonList->append(tb);
}
for (QPtrListIterator<Button>
// it(QApplication::reverseLayout()?rightButtonList_:leftButtonList_);
it(leftButtonList_);
it.current(); ++it)
for (QPtrListIterator<Button> it(leftButtonList_); it.current(); ++it)
{
// it.current()->setAlignment(Button::Left);
it.current()->setAlignment(
QApplication::reverseLayout() && (!options->reverseBIDIWindows())?
Button::Right:Button::Left);
it.current()->setAlignment(Button::Left);
titleLayout_->addWidget(it.current());
}
@ -659,14 +649,9 @@ Manager::createTitle()
titleLayout_->addItem(titleSpacer_);
for (QPtrListIterator<Button>
// it(QApplication::reverseLayout()?leftButtonList_:rightButtonList_);
it(rightButtonList_);
it.current(); ++it)
for (QPtrListIterator<Button> it(rightButtonList_); it.current(); ++it)
{
it.current()->setAlignment(
QApplication::reverseLayout() && (!options->reverseBIDIWindows())?
Button::Left:Button::Right);
it.current()->setAlignment(Button::Right);
titleLayout_->addWidget(it.current());
}
}
@ -741,12 +726,12 @@ Manager::resetLayout()
topLayout_ = new QVBoxLayout(this, 0, 0);
topLayout_->setResizeMode(QLayout::FreeResize);
titleLayout_ = new QHBoxLayout(topLayout_);
titleLayout_ = new QBoxLayout(topLayout_, QBoxLayout::LeftToRight, 0, 0);
titleLayout_->setResizeMode(QLayout::FreeResize);
createTitle();
QHBoxLayout * midLayout = new QHBoxLayout(topLayout_);
QBoxLayout * midLayout = new QBoxLayout(topLayout_, QBoxLayout::LeftToRight, 0, 0);
midLayout->setResizeMode(QLayout::FreeResize);
midLayout->addSpacing(1);
midLayout->addWidget(windowWrapper());

View File

@ -29,7 +29,7 @@
class QSpacerItem;
class QVBoxLayout;
class QHBoxLayout;
class QBoxLayout;
namespace RiscOS
{
@ -101,7 +101,7 @@ class Manager : public KWinInternal::Client
private:
QVBoxLayout * topLayout_;
QHBoxLayout * titleLayout_;
QBoxLayout * titleLayout_;
QSpacerItem * titleSpacer_;
QPixmap titleBuf_;

View File

@ -332,46 +332,38 @@ SystemClient::SystemClient( Workspace *ws, WId w, QWidget *parent,
connect( button[2], SIGNAL( clicked() ), this, ( SLOT( iconify() ) ) );
connect( button[3], SIGNAL( clicked(int) ), this, ( SLOT( maxButtonClicked(int) ) ) );
QHBoxLayout* hb = new QHBoxLayout(0);
QBoxLayout* hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
hb->setResizeMode(QLayout::FreeResize);
g->addLayout( hb, 0, 1 );
titlebar = new QSpacerItem(10, 14, QSizePolicy::Expanding, QSizePolicy::Minimum);
if (QApplication::reverseLayout() && (!options->reverseBIDIWindows())){
if (isMaximizable()) { hb->addWidget(button[3]); hb->addSpacing(3); }
else button[3]->hide();
if (isMinimizable()) { hb->addWidget(button[2]); hb->addSpacing(1); }
else button[2]->hide();
hb->addSpacing(1);
hb->addWidget( button[1]);
if(help){ hb->addWidget( button[4]); hb->addSpacing(1); }
hb->addSpacing(3);
hb->addItem(titlebar);
hb->addSpacing(3);
hb->addWidget( button[0]);
hb->addSpacing(3);
hb->addSpacing(3);
hb->addWidget( button[0]);
titlebar = new QSpacerItem(10, 14, QSizePolicy::Expanding,
QSizePolicy::Minimum);
hb->addSpacing(3);
hb->addItem(titlebar);
hb->addSpacing(3);
if(help){
hb->addWidget( button[4]);
hb->addSpacing(1);
}
else{
hb->addSpacing(3);
hb->addWidget( button[0]);
hb->addSpacing(3);
hb->addItem(titlebar);
hb->addSpacing(3);
if(help){ hb->addWidget( button[4]); hb->addSpacing(1); }
hb->addWidget( button[1]);
hb->addSpacing(1);
hb->addWidget( button[1]);
hb->addSpacing(1);
if (isMinimizable()) { hb->addWidget(button[2]); hb->addSpacing(1); }
else button[2]->hide();
if (isMinimizable()) {
hb->addWidget(button[2]);
hb->addSpacing(1);
} else
button[2]->hide();
if (isMaximizable()) { hb->addWidget(button[3]); hb->addSpacing(3); }
else button[3]->hide();
}
if (isMaximizable()) {
hb->addWidget(button[3]);
hb->addSpacing(3);
} else
button[3]->hide();
setBackgroundMode(NoBackground);
recalcTitleBuffer();
}
void SystemClient::resizeEvent( QResizeEvent* )

View File

@ -455,16 +455,10 @@ Web::_resetLayout()
mainLayout_ = new QVBoxLayout(this, 0, 0);
titleSpacer_ =
new QSpacerItem
(
0,
titleHeight,
QSizePolicy::Expanding,
QSizePolicy::Fixed
);
titleSpacer_ = new QSpacerItem ( 0, titleHeight, QSizePolicy::Expanding,
QSizePolicy::Fixed);
QHBoxLayout * topLayout = new QHBoxLayout(mainLayout_, 0, 0);
QBoxLayout * topLayout = new QBoxLayout(mainLayout_, QBoxLayout::LeftToRight, 0, 0);
_createButtons();

View File

@ -82,13 +82,6 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co
i18n( "Enabling this checkbox will show window button tooltips. "
"If this checkbox is off, no window button tooltips will be shown."));
cbReverseBIDIWindows = new QCheckBox(
i18n( "&Reverse the window title in BIDI desktops"), checkGroup );
QWhatsThis::add( cbReverseBIDIWindows,
i18n("In BIDI enabled desktops, when you choose this option "
"it will reverse the window client according to the language. "
"If you prefer it to be shown the same as "
"in non-BIDI desktops, leave it off."));
// 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!" ) );
@ -124,7 +117,7 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co
tabWidget->insertTab( page1, i18n("&General") );
tabWidget->insertTab( buttonPage, i18n("&Buttons") );
tabWidget->insertTab( pluginPage, i18n("&Configure [") +
tabWidget->insertTab( pluginPage, i18n("&Configure [") +
decorationListBox->currentText() + i18n("]") );
tabWidget->setTabEnabled( buttonPage, cbUseCustomButtonPositions->isChecked() );
@ -136,13 +129,12 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co
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&)),
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()) );
connect( cbReverseBIDIWindows, SIGNAL(clicked()), SLOT(slotSelectionChanged()) );
// Allow kwin dcop signal to update our selection list
connectDCOPSignal("kwin", 0, "dcopResetAllClients()", "dcopUpdateClientList()", false);
@ -331,7 +323,6 @@ void KWinDecorationModule::readConfig( KConfig* conf )
tabWidget->setTabEnabled( buttonPage, cbUseCustomButtonPositions->isChecked() );
cbShowToolTips->setChecked( conf->readBoolEntry("ShowToolTips", true ));
// cbUseMiniWindows->setChecked( conf->readBoolEntry("MiniWindowBorders", false));
cbReverseBIDIWindows->setChecked( conf->readBoolEntry("ReverseBIDIWindows", true) );
// Find the corresponding decoration name to that of
// the current plugin library name
@ -381,7 +372,6 @@ void KWinDecorationModule::writeConfig( KConfig* conf )
conf->writeEntry("PluginLib", libName);
conf->writeEntry("CustomButtonPositions", cbUseCustomButtonPositions->isChecked());
conf->writeEntry("ShowToolTips", cbShowToolTips->isChecked());
conf->writeEntry("ReverseBIDIWindows",cbReverseBIDIWindows->isChecked());
// conf->writeEntry("MiniWindowBorders", cbUseMiniWindows->isChecked());
// Button settings

View File

@ -86,7 +86,6 @@ class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface
QCheckBox* cbUseCustomButtonPositions;
// QCheckBox* cbUseMiniWindows;
QCheckBox* cbShowToolTips;
QCheckBox* cbReverseBIDIWindows;
// Page 2
ButtonDropSite* dropSite;

View File

@ -31,7 +31,6 @@ public:
bool animate_tooltips;
int electric_borders;
int electric_border_delay;
bool reverse_BIDI_windows;
};
};
@ -262,7 +261,6 @@ void Options::reload()
// button tooltips
d->show_tooltips = config->readBoolEntry("ShowToolTips", true);
d->reverse_BIDI_windows =config->readBoolEntry("ReverseBIDIWindows", true );
// Read button tooltip animation effect from kdeglobals
// Since we want to allow users to enable window decoration tooltips
@ -362,10 +360,5 @@ int Options::electricBorderDelay()
return d->electric_border_delay;
}
bool Options::reverseBIDIWindows()
{
return d->reverse_BIDI_windows;
}
#include "options.moc"

View File

@ -319,15 +319,6 @@ public:
* @returns the activation delay for electric borders in milliseconds.
*/
int electricBorderDelay();
/**
* @returns wheather clients should be reversed in BIDI enabled desktops
* In BIDI enabled desktops, when you choose this option kwin clients should
* display them selves reversed.
* Since QT does that already when QApplication::reversedLayout(), the clients should
* reverse the widgets only when (QApplication::reversedLayout() && !reverseBIDIWindows())
*/
bool reverseBIDIWindows();
void reload();

View File

@ -3037,7 +3037,7 @@ void Workspace::showWindowMenu( int x, int y, Client* cl )
activateClient( cl );
d->popup_client = cl; // don't close the popup when the client becomes active
}
QPopupMenu* p = clientPopup();
// Client* c = active_client;
p->exec( QPoint( x, y ));

View File

@ -210,6 +210,7 @@ public:
* and makes it active if it's not already.
*/
void showWindowMenu( int x, int y, Client* cl );
void showWindowMenu( QPoint pos, Client* cl );
void iconifyOrDeiconifyTransientsOf( Client* );
void setStickyTransientsOf( Client*, bool sticky );
@ -473,6 +474,12 @@ inline const ClientList& Workspace::stackingOrder() const
return stacking_order;
}
inline void Workspace::showWindowMenu(QPoint pos, Client* cl)
{
showWindowMenu(pos.x(), pos.y(), cl);
}
};
#endif