deprecated--
svn path=/trunk/KDE/kdebase/workspace/; revision=529106
This commit is contained in:
parent
86bd58b189
commit
848bc14335
31 changed files with 628 additions and 484 deletions
20
bridge.cpp
20
bridge.cpp
|
@ -161,30 +161,28 @@ QRegion Bridge::unobscuredRegion( const QRegion& r ) const
|
|||
{
|
||||
QRegion reg( r );
|
||||
const ClientList stacking_order = c->workspace()->stackingOrder();
|
||||
ClientList::ConstIterator it = stacking_order.find( c );
|
||||
++it;
|
||||
for(;
|
||||
it != stacking_order.end();
|
||||
++it )
|
||||
int pos = stacking_order.indexOf( c );
|
||||
++pos;
|
||||
for(; pos < stacking_order.count(); ++pos )
|
||||
{
|
||||
if( !(*it)->isShown( true ))
|
||||
if( !stacking_order[pos]->isShown( true ))
|
||||
continue; // these don't obscure the window
|
||||
if( c->isOnAllDesktops())
|
||||
{
|
||||
if( !(*it)->isOnCurrentDesktop())
|
||||
if( !stacking_order[ pos ]->isOnCurrentDesktop())
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !(*it)->isOnDesktop( c->desktop()))
|
||||
if( !stacking_order[ pos ]->isOnDesktop( c->desktop()))
|
||||
continue;
|
||||
}
|
||||
/* the clients all have their mask-regions in local coords
|
||||
so we have to translate them to a shared coord system
|
||||
we choose ours */
|
||||
int dx = (*it)->x() - c->x();
|
||||
int dy = (*it)->y() - c->y();
|
||||
QRegion creg = (*it)->mask();
|
||||
int dx = stacking_order[ pos ]->x() - c->x();
|
||||
int dy = stacking_order[ pos ]->y() - c->y();
|
||||
QRegion creg = stacking_order[ pos ]->mask();
|
||||
creg.translate(dx, dy);
|
||||
reg -= creg;
|
||||
if (reg.isEmpty())
|
||||
|
|
|
@ -477,7 +477,7 @@ void Client::updateShape()
|
|||
void Client::setMask( const QRegion& reg, int mode )
|
||||
{
|
||||
_mask = reg;
|
||||
if( reg.isNull())
|
||||
if( reg.isEmpty())
|
||||
XShapeCombineMask( QX11Info::display(), frameId(), ShapeBounding, 0, 0,
|
||||
None, ShapeSet );
|
||||
else if( mode == X::Unsorted )
|
||||
|
@ -1065,7 +1065,8 @@ void Client::pingWindow()
|
|||
return; // pinging already
|
||||
ping_timer = new QTimer( this );
|
||||
connect( ping_timer, SIGNAL( timeout()), SLOT( pingTimeout()));
|
||||
ping_timer->start( options->killPingTimeout, true );
|
||||
ping_timer->setSingleShot( true );
|
||||
ping_timer->start( options->killPingTimeout );
|
||||
ping_timestamp = QX11Info::appTime();
|
||||
workspace()->sendPingToWindow( window(), ping_timestamp );
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#ifndef CLIENTS/B2/B2CLIENT.CPP
|
||||
#define CLIENTS/B2/B2CLIENT.CPP
|
||||
/*
|
||||
* B-II KWin Client
|
||||
*
|
||||
|
@ -14,7 +16,6 @@
|
|||
#include <qapplication.h>
|
||||
#include <qlayout.h>
|
||||
#include <qdrawutil.h>
|
||||
//Added by qt3to4:
|
||||
#include <QPixmap>
|
||||
#include <QPaintEvent>
|
||||
#include <QPolygon>
|
||||
|
@ -22,6 +23,7 @@
|
|||
#include <QEvent>
|
||||
#include <QBoxLayout>
|
||||
#include <QShowEvent>
|
||||
#include <QStyle>
|
||||
#include <QResizeEvent>
|
||||
#include <QMouseEvent>
|
||||
#include <kpixmapeffect.h>
|
||||
|
@ -194,39 +196,44 @@ static void create_pixmaps()
|
|||
if (bsize < 16) bsize = 16;
|
||||
|
||||
for (i = 0; i < NUM_PIXMAPS; i++) {
|
||||
pixmap[i] = new KPixmap;
|
||||
switch (i / NumStates) {
|
||||
case P_MAX: // will be initialized by copying P_CLOSE
|
||||
case P_RESIZE:
|
||||
break;
|
||||
case P_ICONIFY:
|
||||
pixmap[i]->resize(10, 10); break;
|
||||
case P_SHADE:
|
||||
case P_CLOSE:
|
||||
pixmap[i]->resize(bsize, bsize); break;
|
||||
default:
|
||||
pixmap[i]->resize(16, 16); break;
|
||||
}
|
||||
|
||||
switch (i / NumStates) {
|
||||
case P_MAX: // will be initialized by copying P_CLOSE
|
||||
case P_RESIZE:
|
||||
pixmap[i] = new KPixmap;
|
||||
break;
|
||||
case P_ICONIFY:
|
||||
pixmap[i] = new KPixmap(10, 10);
|
||||
break;
|
||||
case P_SHADE:
|
||||
case P_CLOSE:
|
||||
pixmap[i] = new KPixmap(bsize, bsize);
|
||||
break;
|
||||
default:
|
||||
pixmap[i] = new KPixmap(16, 16);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// there seems to be no way to load X bitmaps from data properly, so
|
||||
// we need to create new ones for each mask :P
|
||||
QBitmap pinupMask(16, 16, pinup_mask_bits, true);
|
||||
QBitmap pinupMask = QBitmap::fromData(QSize( 16, 16 ), pinup_mask_bits);
|
||||
PIXMAP_A(P_PINUP)->setMask(pinupMask);
|
||||
PIXMAP_I(P_PINUP)->setMask(pinupMask);
|
||||
QBitmap pindownMask(16, 16, pindown_mask_bits, true);
|
||||
QBitmap pindownMask = QBitmap::fromData(QSize( 16, 16 ), pindown_mask_bits);
|
||||
PIXMAP_AD(P_PINUP)->setMask(pindownMask);
|
||||
PIXMAP_ID(P_PINUP)->setMask(pindownMask);
|
||||
|
||||
QBitmap menuMask(16, 16, menu_mask_bits, true);
|
||||
QBitmap menuMask = QBitmap::fromData(QSize( 16, 16 ), menu_mask_bits);
|
||||
for (i = 0; i < NumStates; i++)
|
||||
pixmap[P_MENU * NumStates + i]->setMask(menuMask);
|
||||
|
||||
QBitmap helpMask(16, 16, help_mask_bits, true);
|
||||
QBitmap helpMask = QBitmap::fromData(QSize( 16, 16 ), help_mask_bits);
|
||||
for (i = 0; i < NumStates; i++)
|
||||
pixmap[P_HELP * NumStates + i]->setMask(helpMask);
|
||||
|
||||
QBitmap normalizeMask(16, 16, true);
|
||||
QBitmap normalizeMask(16, 16);
|
||||
normalizeMask.clear();
|
||||
// draw normalize icon mask
|
||||
QPainter mask;
|
||||
mask.begin(&normalizeMask);
|
||||
|
@ -240,7 +247,8 @@ static void create_pixmaps()
|
|||
for (i = 0; i < NumStates; i++)
|
||||
pixmap[P_NORMALIZE * NumStates + i]->setMask(normalizeMask);
|
||||
|
||||
QBitmap shadeMask(bsize, bsize, true);
|
||||
QBitmap shadeMask(bsize, bsize);
|
||||
shadeMask.clear();
|
||||
mask.begin(&shadeMask);
|
||||
mask.fillRect(0, 0, bsize, 6, one);
|
||||
mask.end();
|
||||
|
@ -369,13 +377,13 @@ void B2Client::init()
|
|||
createMainWidget(Qt::WResizeNoErase | Qt::WRepaintNoErase);
|
||||
widget()->installEventFilter(this);
|
||||
|
||||
widget()->setBackgroundMode(Qt::NoBackground);
|
||||
widget()->setAttribute(Qt::WA_NoSystemBackground);
|
||||
|
||||
// Set button pointers to NULL so we know what has been created
|
||||
for (int i = 0; i < BtnCount; i++)
|
||||
button[i] = NULL;
|
||||
|
||||
g = new QGridLayout(widget(), 3, 3);
|
||||
g = new QGridLayout(widget());
|
||||
// Left and right border width
|
||||
|
||||
leftSpacer = new QSpacerItem(thickness, 16,
|
||||
|
@ -407,15 +415,15 @@ void B2Client::init()
|
|||
}
|
||||
|
||||
// titlebar
|
||||
g->setRowSpacing(0, buttonSize + 4);
|
||||
g->addItem( new QSpacerItem( 0, buttonSize + 4 ), 0, 0 );
|
||||
|
||||
titlebar = new B2Titlebar(this);
|
||||
titlebar->setMinimumWidth(buttonSize + 4);
|
||||
titlebar->setFixedHeight(buttonSize + 4);
|
||||
|
||||
QBoxLayout *titleLayout = new QBoxLayout(titlebar,
|
||||
QBoxLayout::LeftToRight, 0, 1, 0);
|
||||
titleLayout->addSpacing(3);
|
||||
QBoxLayout *titleLayout = new QBoxLayout(QBoxLayout::LeftToRight, titlebar );
|
||||
titleLayout->setMargin(1);
|
||||
titleLayout->setSpacing(3);
|
||||
|
||||
if (options()->customButtonPositions()) {
|
||||
addButtons(options()->titleButtonsLeft(), tips, titlebar, titleLayout);
|
||||
|
@ -429,8 +437,7 @@ void B2Client::init()
|
|||
|
||||
titleLayout->addSpacing(3);
|
||||
|
||||
QColor c = options()->palette(KDecoration::ColorTitleBar, isActive()).active().
|
||||
color(QColorGroup::Button);
|
||||
QColor c = options()->palette(KDecoration::ColorTitleBar, isActive()).color( QPalette::Active, QPalette::Button );
|
||||
|
||||
for (int i = 0; i < BtnCount; i++) {
|
||||
if (button[i])
|
||||
|
@ -450,7 +457,7 @@ void B2Client::addButtons(const QString& s, const QString tips[],
|
|||
return;
|
||||
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
switch (s[i].latin1()) {
|
||||
switch (s[i].toLatin1()) {
|
||||
case 'M': // Menu button
|
||||
if (!button[BtnMenu]) {
|
||||
button[BtnMenu] = new B2Button(this, tb, tips[BtnMenu],
|
||||
|
@ -548,7 +555,7 @@ bool B2Client::mustDrawHandle() const
|
|||
void B2Client::iconChange()
|
||||
{
|
||||
if (button[BtnMenu])
|
||||
button[BtnMenu]->repaint(false);
|
||||
button[BtnMenu]->repaint();
|
||||
}
|
||||
|
||||
// Gallium: New button show/hide magic for customizable
|
||||
|
@ -606,7 +613,7 @@ void B2Client::captionChange()
|
|||
titleMoveAbs(bar_x_ofs);
|
||||
doShape();
|
||||
titlebar->recalcBuffer();
|
||||
titlebar->repaint(false);
|
||||
titlebar->repaint();
|
||||
}
|
||||
|
||||
void B2Client::paintEvent(QPaintEvent* e)
|
||||
|
@ -625,7 +632,7 @@ void B2Client::paintEvent(QPaintEvent* e)
|
|||
int bb = mustDrawHandle() ? 4 : 0;
|
||||
int bDepth = thickness + bb;
|
||||
|
||||
QColorGroup fillColor = options()->palette(frameColorGroup, isActive()).active();
|
||||
QPalette fillColor = options()->palette(frameColorGroup, isActive());
|
||||
QBrush fillBrush(options()->color(frameColorGroup, isActive()));
|
||||
|
||||
// outer frame rect
|
||||
|
@ -642,7 +649,7 @@ void B2Client::paintEvent(QPaintEvent* e)
|
|||
qDrawShadePanel(&p, 1, t.bottom() - thickness + 2,
|
||||
width() - 2, fHeight - 2 - bb + thickness, fillColor, false);
|
||||
if (thickness == 4) {
|
||||
p.setPen(fillColor.background());
|
||||
p.setPen(fillColor.color( QPalette::Background ) );
|
||||
p.drawRect(thickness - 2, t.bottom() - 1,
|
||||
width() - 2 * (thickness - 2), fHeight + 4 - bDepth);
|
||||
} else if (thickness > 4) {
|
||||
|
@ -678,12 +685,12 @@ void B2Client::paintEvent(QPaintEvent* e)
|
|||
p.fillRect(hx + 1, height() - thickness - 3,
|
||||
hw - 2, thickness + 2, fillBrush);
|
||||
|
||||
p.setPen(fillColor.dark());
|
||||
p.setPen(fillColor.color( QPalette::Dark ));
|
||||
p.drawLine(width() - 2, height() - thickness - 4,
|
||||
width() - 2, height() - 2);
|
||||
p.drawLine(hx + 1, height() - 2, width() - 2, height() - 2);
|
||||
|
||||
p.setPen(fillColor.light());
|
||||
p.setPen(fillColor.color( QPalette::Light ));
|
||||
p.drawLine(hx + 1, height() - thickness - 2,
|
||||
hx + 1, height() - 3);
|
||||
p.drawLine(hx + 1, height() - thickness - 3,
|
||||
|
@ -805,8 +812,8 @@ void B2Client::titleMoveAbs(int new_ofs)
|
|||
bar_x_ofs = new_ofs;
|
||||
positionButtons();
|
||||
doShape();
|
||||
widget()->repaint(0, 0, width(), buttonSize + 4, false);
|
||||
titlebar->repaint(false);
|
||||
widget()->repaint(0, 0, width(), buttonSize + 4);
|
||||
titlebar->repaint();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -839,21 +846,21 @@ void B2Client::maximizeChange()
|
|||
|
||||
g->activate();
|
||||
doShape();
|
||||
widget()->repaint(false);
|
||||
widget()->repaint();
|
||||
}
|
||||
|
||||
void B2Client::activeChange()
|
||||
{
|
||||
widget()->repaint(false);
|
||||
titlebar->repaint(false);
|
||||
widget()->repaint();
|
||||
titlebar->repaint();
|
||||
|
||||
QColor c = options()->palette(
|
||||
KDecoration::ColorTitleBar, isActive()).active().color(QColorGroup::Button);
|
||||
KDecoration::ColorTitleBar, isActive()).color(QPalette::Active, QPalette::Button);
|
||||
|
||||
for (int i = 0; i < BtnCount; i++)
|
||||
if (button[i]) {
|
||||
button[i]->setBg(c);
|
||||
button[i]->repaint(false);
|
||||
button[i]->repaint();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -947,26 +954,25 @@ void B2Client::unobscureTitlebar()
|
|||
static void redraw_pixmaps()
|
||||
{
|
||||
int i;
|
||||
QColorGroup aGrp = options()->palette(KDecoration::ColorButtonBg, true).active();
|
||||
QColorGroup iGrp = options()->palette(KDecoration::ColorButtonBg, false).active();
|
||||
QPalette aGrp = options()->palette(KDecoration::ColorButtonBg, true);
|
||||
QPalette iGrp = options()->palette(KDecoration::ColorButtonBg, false);
|
||||
|
||||
// close
|
||||
drawB2Rect(PIXMAP_A(P_CLOSE), aGrp.button(), false);
|
||||
drawB2Rect(PIXMAP_AH(P_CLOSE), aGrp.button(), true);
|
||||
drawB2Rect(PIXMAP_AD(P_CLOSE), aGrp.button(), true);
|
||||
drawB2Rect(PIXMAP_A(P_CLOSE), aGrp.color( QPalette::Button ), false);
|
||||
drawB2Rect(PIXMAP_AH(P_CLOSE), aGrp.color( QPalette::Button ), true);
|
||||
drawB2Rect(PIXMAP_AD(P_CLOSE), aGrp.color( QPalette::Button ), true);
|
||||
|
||||
drawB2Rect(PIXMAP_I(P_CLOSE), iGrp.button(), false);
|
||||
drawB2Rect(PIXMAP_IH(P_CLOSE), iGrp.button(), true);
|
||||
drawB2Rect(PIXMAP_ID(P_CLOSE), iGrp.button(), true);
|
||||
drawB2Rect(PIXMAP_I(P_CLOSE), iGrp.color( QPalette::Button ), false);
|
||||
drawB2Rect(PIXMAP_IH(P_CLOSE), iGrp.color( QPalette::Button ), true);
|
||||
drawB2Rect(PIXMAP_ID(P_CLOSE), iGrp.color( QPalette::Button ), true);
|
||||
|
||||
// shade
|
||||
KPixmap thinBox;
|
||||
thinBox.resize(buttonSize - 2, 6);
|
||||
KPixmap thinBox(buttonSize - 2, 6);
|
||||
for (i = 0; i < NumStates; i++) {
|
||||
bool is_act = (i < 2);
|
||||
bool is_down = ((i & 1) == 1);
|
||||
KPixmap *pix = pixmap[P_SHADE * NumStates + i];
|
||||
QColor color = is_act ? aGrp.button() : iGrp.button();
|
||||
QColor color = is_act ? aGrp.color( QPalette::Button ) : iGrp.color( QPalette::Button );
|
||||
drawB2Rect(&thinBox, color, is_down);
|
||||
pix->fill(Qt::black);
|
||||
bitBlt(pix, 0, 0, &thinBox,
|
||||
|
@ -989,8 +995,8 @@ static void redraw_pixmaps()
|
|||
bool is_act = (i < 3);
|
||||
bool is_down = (i == Down || i == IDown);
|
||||
KPixmap *pix = pixmap[P_NORMALIZE * NumStates + i];
|
||||
drawB2Rect(&smallBox, is_act ? aGrp.button() : iGrp.button(), is_down);
|
||||
drawB2Rect(&largeBox, is_act ? aGrp.button() : iGrp.button(), is_down);
|
||||
drawB2Rect(&smallBox, is_act ? aGrp.color( QPalette::Button ) : iGrp.color( QPalette::Button ), is_down);
|
||||
drawB2Rect(&largeBox, is_act ? aGrp.color( QPalette::Button ) : iGrp.color( QPalette::Button ), is_down);
|
||||
pix->fill(options()->color(KDecoration::ColorTitleBar, is_act));
|
||||
bitBlt(pix, pix->width() - 12, pix->width() - 12, &largeBox,
|
||||
0, 0, 12, 12);
|
||||
|
@ -1006,7 +1012,7 @@ static void redraw_pixmaps()
|
|||
bool is_down = (i == Down || i == IDown);
|
||||
*pixmap[P_RESIZE * NumStates + i] = *pixmap[P_CLOSE * NumStates + i];
|
||||
pixmap[P_RESIZE * NumStates + i]->detach();
|
||||
drawB2Rect(&smallBox, is_act ? aGrp.button() : iGrp.button(), is_down);
|
||||
drawB2Rect(&smallBox, is_act ? aGrp.color( QPalette::Button ) : iGrp.color( QPalette::Button ), is_down);
|
||||
bitBlt(pixmap[P_RESIZE * NumStates + i],
|
||||
0, 0, &smallBox, 0, 0, 10, 10);
|
||||
}
|
||||
|
@ -1198,7 +1204,7 @@ B2Button::B2Button(B2Client *_client, QWidget *parent,
|
|||
const QString& tip, const int realizeBtns)
|
||||
: Q3Button(parent, 0), hover(false)
|
||||
{
|
||||
setBackgroundMode(Qt::NoBackground);
|
||||
setAttribute(Qt::WA_NoSystemBackground);
|
||||
setCursor(Qt::ArrowCursor);
|
||||
realizeButtons = realizeBtns;
|
||||
client = _client;
|
||||
|
@ -1227,7 +1233,7 @@ void B2Button::drawButton(QPainter *p)
|
|||
p->fillRect(rect(), bg);
|
||||
}
|
||||
if (useMiniIcon) {
|
||||
QPixmap miniIcon = client->icon().pixmap(QIcon::Small,
|
||||
QPixmap miniIcon = client->icon().pixmap(style()->pixelMetric( QStyle::PM_SmallIconSize ),
|
||||
client->isActive() ? QIcon::Normal : QIcon::Disabled);
|
||||
p->drawPixmap((width() - miniIcon.width()) / 2,
|
||||
(height() - miniIcon.height()) / 2, miniIcon);
|
||||
|
@ -1259,7 +1265,7 @@ void B2Button::setPixmaps(int button_id)
|
|||
for (int i = 0; i < NumStates; i++) {
|
||||
icon[i] = B2::pixmap[button_id + i];
|
||||
}
|
||||
repaint(false);
|
||||
repaint();
|
||||
}
|
||||
|
||||
void B2Button::mousePressEvent(QMouseEvent * e)
|
||||
|
@ -1267,7 +1273,8 @@ void B2Button::mousePressEvent(QMouseEvent * e)
|
|||
last_button = e->button();
|
||||
QMouseEvent me(e->type(), e->pos(), e->globalPos(),
|
||||
(e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton,
|
||||
e->state());
|
||||
(e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton,
|
||||
e->modifiers());
|
||||
Q3Button::mousePressEvent(&me);
|
||||
}
|
||||
|
||||
|
@ -1276,32 +1283,33 @@ void B2Button::mouseReleaseEvent(QMouseEvent * e)
|
|||
last_button = e->button();
|
||||
QMouseEvent me(e->type(), e->pos(), e->globalPos(),
|
||||
(e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton,
|
||||
e->state());
|
||||
(e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton,
|
||||
e->modifiers());
|
||||
Q3Button::mouseReleaseEvent(&me);
|
||||
}
|
||||
|
||||
void B2Button::enterEvent(QEvent *e)
|
||||
{
|
||||
hover = true;
|
||||
repaint(false);
|
||||
repaint();
|
||||
Q3Button::enterEvent(e);
|
||||
}
|
||||
|
||||
void B2Button::leaveEvent(QEvent *e)
|
||||
{
|
||||
hover = false;
|
||||
repaint(false);
|
||||
repaint();
|
||||
Q3Button::leaveEvent(e);
|
||||
}
|
||||
|
||||
// =====================================
|
||||
|
||||
B2Titlebar::B2Titlebar(B2Client *parent)
|
||||
: QWidget(parent->widget(), 0, Qt::WStyle_Customize | Qt::WNoAutoErase),
|
||||
: QWidget(parent->widget(), Qt::WStyle_Customize | Qt::WNoAutoErase),
|
||||
client(parent),
|
||||
set_x11mask(false), isfullyobscured(false), shift_move(false)
|
||||
{
|
||||
setBackgroundMode(Qt::NoBackground);
|
||||
setAttribute(Qt::WA_NoSystemBackground);
|
||||
captionSpacer = new QSpacerItem(buttonSize, buttonSize + 4,
|
||||
QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
}
|
||||
|
@ -1348,10 +1356,9 @@ void B2Titlebar::drawTitlebar(QPainter &p, bool state)
|
|||
p.drawLine(t.right(), 0, t.right(), t.bottom());
|
||||
|
||||
// titlebar fill
|
||||
const QColorGroup cg =
|
||||
options()->palette(KDecoration::ColorTitleBar, state).active();
|
||||
const QPalette cg = options()->palette(KDecoration::ColorTitleBar, state);
|
||||
QBrush brush(cg.background());
|
||||
if (gradient) brush.setPixmap(*gradient);
|
||||
if (gradient) brush.setTexture(*gradient);
|
||||
qDrawShadeRect(&p, 1, 1, t.right() - 1, t.height() - 1,
|
||||
cg, false, 1, 0, &brush);
|
||||
|
||||
|
@ -1374,7 +1381,7 @@ void B2Titlebar::recalcBuffer()
|
|||
void B2Titlebar::resizeEvent(QResizeEvent *)
|
||||
{
|
||||
recalcBuffer();
|
||||
repaint(false);
|
||||
repaint();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1398,7 +1405,7 @@ void B2Titlebar::mouseDoubleClickEvent(QMouseEvent *e)
|
|||
|
||||
void B2Titlebar::mousePressEvent(QMouseEvent * e)
|
||||
{
|
||||
shift_move = e->state() & Qt::ShiftModifier;
|
||||
shift_move = e->modifiers() & Qt::ShiftModifier;
|
||||
if (shift_move) {
|
||||
moveOffset = e->globalPos();
|
||||
} else {
|
||||
|
@ -1432,3 +1439,4 @@ void B2Titlebar::mouseMoveEvent(QMouseEvent * e)
|
|||
|
||||
// vim: sw=4
|
||||
|
||||
#endif // CLIENTS/B2/B2CLIENT.CPP
|
||||
|
|
|
@ -61,10 +61,10 @@ B2Config::B2Config( KConfig* conf, QWidget* parent )
|
|||
QLabel *menuDblClickLabel = new QLabel(actionsGB);
|
||||
menuDblClickLabel->setText(i18n("Double click on menu button:"));
|
||||
menuDblClickOp = new QComboBox(actionsGB);
|
||||
menuDblClickOp->insertItem(i18n("Do Nothing"));
|
||||
menuDblClickOp->insertItem(i18n("Minimize Window"));
|
||||
menuDblClickOp->insertItem(i18n("Shade Window"));
|
||||
menuDblClickOp->insertItem(i18n("Close Window"));
|
||||
menuDblClickOp->addItem(i18n("Do Nothing"));
|
||||
menuDblClickOp->addItem(i18n("Minimize Window"));
|
||||
menuDblClickOp->addItem(i18n("Shade Window"));
|
||||
menuDblClickOp->addItem(i18n("Close Window"));
|
||||
|
||||
menuDblClickOp->setWhatsThis(
|
||||
i18n("An action can be associated to a double click "
|
||||
|
|
|
@ -38,13 +38,13 @@ KDEDefaultConfig::KDEDefaultConfig( KConfig* conf, QWidget* parent )
|
|||
gb->setSpacing( KDialog::spacingHint() );
|
||||
|
||||
cbShowStipple = new QCheckBox( i18n("Draw titlebar &stipple effect"), gb );
|
||||
QWhatsThis::add( cbShowStipple,
|
||||
cbShowStipple->setWhatsThis(
|
||||
i18n("When selected, active titlebars are drawn "
|
||||
"with a stipple (dotted) effect; otherwise, they are "
|
||||
"drawn without the stipple."));
|
||||
|
||||
cbShowGrabBar = new QCheckBox( i18n("Draw g&rab bar below windows"), gb );
|
||||
QWhatsThis::add( cbShowGrabBar,
|
||||
cbShowGrabBar->setWhatsThis(
|
||||
i18n("When selected, decorations are drawn with a \"grab bar\" "
|
||||
"below windows; otherwise, no grab bar is drawn."));
|
||||
|
||||
|
@ -52,7 +52,7 @@ KDEDefaultConfig::KDEDefaultConfig( KConfig* conf, QWidget* parent )
|
|||
if (highcolor)
|
||||
{
|
||||
cbUseGradients = new QCheckBox( i18n("Draw &gradients"), gb );
|
||||
QWhatsThis::add( cbUseGradients,
|
||||
cbUseGradients->setWhatsThis(
|
||||
i18n("When selected, decorations are drawn with gradients "
|
||||
"for high-color displays; otherwise, no gradients are drawn.") );
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <qlabel.h>
|
||||
#include <kdebug.h>
|
||||
#include <QPolygon>
|
||||
#include <QStyle>
|
||||
|
||||
namespace Default
|
||||
{
|
||||
|
@ -325,18 +326,18 @@ void KDEDefaultHandler::createPixmaps()
|
|||
}
|
||||
|
||||
// Set the sticky pin pixmaps;
|
||||
QColorGroup g;
|
||||
QPalette g;
|
||||
QPainter p;
|
||||
|
||||
// Active pins
|
||||
g = options()->palette( ColorButtonBg, true ).active();
|
||||
g = options()->palette( ColorButtonBg, true );
|
||||
pinUpPix = new KPixmap();
|
||||
pinUpPix->resize(16, 16);
|
||||
p.begin( pinUpPix );
|
||||
kColorBitmaps( &p, g, 0, 0, 16, 16, true, pinup_white_bits,
|
||||
pinup_gray_bits, NULL, NULL, pinup_dgray_bits, NULL );
|
||||
p.end();
|
||||
pinUpPix->setMask( QBitmap(16, 16, pinup_mask_bits, true) );
|
||||
pinUpPix->setMask( QBitmap::fromData(QSize( 16, 16 ), pinup_mask_bits) );
|
||||
|
||||
pinDownPix = new KPixmap();
|
||||
pinDownPix->resize(16, 16);
|
||||
|
@ -344,17 +345,17 @@ void KDEDefaultHandler::createPixmaps()
|
|||
kColorBitmaps( &p, g, 0, 0, 16, 16, true, pindown_white_bits,
|
||||
pindown_gray_bits, NULL, NULL, pindown_dgray_bits, NULL );
|
||||
p.end();
|
||||
pinDownPix->setMask( QBitmap(16, 16, pindown_mask_bits, true) );
|
||||
pinDownPix->setMask( QBitmap::fromData(QSize( 16, 16 ), pindown_mask_bits) );
|
||||
|
||||
// Inactive pins
|
||||
g = options()->palette( ColorButtonBg, false ).active();
|
||||
g = options()->palette( ColorButtonBg, false );
|
||||
ipinUpPix = new KPixmap();
|
||||
ipinUpPix->resize(16, 16);
|
||||
p.begin( ipinUpPix );
|
||||
kColorBitmaps( &p, g, 0, 0, 16, 16, true, pinup_white_bits,
|
||||
pinup_gray_bits, NULL, NULL, pinup_dgray_bits, NULL );
|
||||
p.end();
|
||||
ipinUpPix->setMask( QBitmap(16, 16, pinup_mask_bits, true) );
|
||||
ipinUpPix->setMask( QBitmap::fromData(QSize( 16, 16 ), pinup_mask_bits) );
|
||||
|
||||
ipinDownPix = new KPixmap();
|
||||
ipinDownPix->resize(16, 16);
|
||||
|
@ -362,7 +363,7 @@ void KDEDefaultHandler::createPixmaps()
|
|||
kColorBitmaps( &p, g, 0, 0, 16, 16, true, pindown_white_bits,
|
||||
pindown_gray_bits, NULL, NULL, pindown_dgray_bits, NULL );
|
||||
p.end();
|
||||
ipinDownPix->setMask( QBitmap(16, 16, pindown_mask_bits, true) );
|
||||
ipinDownPix->setMask( QBitmap::fromData(QSize( 16, 16 ), pindown_mask_bits) );
|
||||
|
||||
// Create a title buffer for flicker-free painting
|
||||
titleBuffer = new KPixmap();
|
||||
|
@ -405,25 +406,25 @@ void KDEDefaultHandler::createPixmaps()
|
|||
irightBtnDownPix[false]->resize(toolTitleHeight, toolTitleHeight);
|
||||
|
||||
// Draw the button state pixmaps
|
||||
g = options()->palette( ColorTitleBar, true ).active();
|
||||
g = options()->palette( ColorTitleBar, true );
|
||||
drawButtonBackground( leftBtnUpPix[true], g, false );
|
||||
drawButtonBackground( leftBtnDownPix[true], g, true );
|
||||
drawButtonBackground( leftBtnUpPix[false], g, false );
|
||||
drawButtonBackground( leftBtnDownPix[false], g, true );
|
||||
|
||||
g = options()->palette( ColorButtonBg, true ).active();
|
||||
g = options()->palette( ColorButtonBg, true );
|
||||
drawButtonBackground( rightBtnUpPix[true], g, false );
|
||||
drawButtonBackground( rightBtnDownPix[true], g, true );
|
||||
drawButtonBackground( rightBtnUpPix[false], g, false );
|
||||
drawButtonBackground( rightBtnDownPix[false], g, true );
|
||||
|
||||
g = options()->palette( ColorTitleBar, false ).active();
|
||||
g = options()->palette( ColorTitleBar, false );
|
||||
drawButtonBackground( ileftBtnUpPix[true], g, false );
|
||||
drawButtonBackground( ileftBtnDownPix[true], g, true );
|
||||
drawButtonBackground( ileftBtnUpPix[false], g, false );
|
||||
drawButtonBackground( ileftBtnDownPix[false], g, true );
|
||||
|
||||
g = options()->palette( ColorButtonBg, false ).active();
|
||||
g = options()->palette( ColorButtonBg, false );
|
||||
drawButtonBackground( irightBtnUpPix[true], g, false );
|
||||
drawButtonBackground( irightBtnDownPix[true], g, true );
|
||||
drawButtonBackground( irightBtnUpPix[false], g, false );
|
||||
|
@ -493,7 +494,7 @@ void KDEDefaultHandler::freePixmaps()
|
|||
|
||||
|
||||
void KDEDefaultHandler::drawButtonBackground(KPixmap *pix,
|
||||
const QColorGroup &g, bool sunken)
|
||||
const QPalette &g, bool sunken)
|
||||
{
|
||||
QPainter p;
|
||||
int w = pix->width();
|
||||
|
@ -502,7 +503,7 @@ void KDEDefaultHandler::drawButtonBackground(KPixmap *pix,
|
|||
int y2 = h-1;
|
||||
|
||||
bool highcolor = useGradients && (QPixmap::defaultDepth() > 8);
|
||||
QColor c = g.background();
|
||||
QColor c = g.color( QPalette::Background );
|
||||
|
||||
// Fill the background with a gradient if possible
|
||||
if (highcolor)
|
||||
|
@ -513,18 +514,18 @@ void KDEDefaultHandler::drawButtonBackground(KPixmap *pix,
|
|||
|
||||
p.begin(pix);
|
||||
// outer frame
|
||||
p.setPen(g.mid());
|
||||
p.setPen(g.color( QPalette::Mid ));
|
||||
p.drawLine(0, 0, x2, 0);
|
||||
p.drawLine(0, 0, 0, y2);
|
||||
p.setPen(g.light());
|
||||
p.setPen(g.color( QPalette::Light ));
|
||||
p.drawLine(x2, 0, x2, y2);
|
||||
p.drawLine(0, x2, y2, x2);
|
||||
p.setPen(g.dark());
|
||||
p.setPen(g.color( QPalette::Dark ));
|
||||
p.drawRect(1, 1, w-2, h-2);
|
||||
p.setPen(sunken ? g.mid() : g.light());
|
||||
p.setPen(sunken ? g.color( QPalette::Mid ) : g.color( QPalette::Light ));
|
||||
p.drawLine(2, 2, x2-2, 2);
|
||||
p.drawLine(2, 2, 2, y2-2);
|
||||
p.setPen(sunken ? g.light() : g.mid());
|
||||
p.setPen(sunken ? g.color( QPalette::Light ) : g.color( QPalette::Mid ));
|
||||
p.drawLine(x2-2, 2, x2-2, y2-2);
|
||||
p.drawLine(2, x2-2, y2-2, x2-2);
|
||||
}
|
||||
|
@ -561,6 +562,7 @@ bool KDEDefaultHandler::supports( Ability ability )
|
|||
KDEDefaultButton::KDEDefaultButton(ButtonType type, KDEDefaultClient *parent, const char *name)
|
||||
: KCommonDecorationButton(type, parent)
|
||||
{
|
||||
setObjectName( name );
|
||||
setAttribute( Qt::WA_NoBackground );
|
||||
|
||||
isMouseOver = false;
|
||||
|
@ -620,7 +622,7 @@ void KDEDefaultButton::setBitmap(const unsigned char *bitmap)
|
|||
deco = 0;
|
||||
|
||||
if (bitmap) {
|
||||
deco = new QBitmap(10, 10, bitmap, true);
|
||||
deco = new QBitmap( QBitmap::fromData(QSize( 10, 10 ), bitmap) );
|
||||
deco->setMask( *deco );
|
||||
}
|
||||
}
|
||||
|
@ -704,7 +706,7 @@ void KDEDefaultButton::drawButton(QPainter *p)
|
|||
else
|
||||
btnpix = isChecked() ? *ipinDownPix : *ipinUpPix;
|
||||
} else
|
||||
btnpix = decoration()->icon().pixmap( QIcon::Small, QIcon::Normal );
|
||||
btnpix = decoration()->icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ), QIcon::Normal );
|
||||
|
||||
// Intensify the image if required
|
||||
if (isMouseOver) {
|
||||
|
@ -714,7 +716,7 @@ void KDEDefaultButton::drawButton(QPainter *p)
|
|||
// Smooth scale the pixmap for small titlebars
|
||||
// This is slow, but we assume this isn't done too often
|
||||
if ( width() < 16 ) {
|
||||
btnpix.convertFromImage(btnpix.convertToImage().smoothScale(12, 12));
|
||||
btnpix = QPixmap::fromImage(btnpix.toImage().scaled(12, 12));
|
||||
p->drawPixmap( 0, 0, btnpix );
|
||||
}
|
||||
else
|
||||
|
@ -726,7 +728,7 @@ void KDEDefaultButton::drawButton(QPainter *p)
|
|||
void KDEDefaultButton::enterEvent(QEvent *e)
|
||||
{
|
||||
isMouseOver=true;
|
||||
repaint(false);
|
||||
repaint();
|
||||
KCommonDecorationButton::enterEvent(e);
|
||||
}
|
||||
|
||||
|
@ -734,7 +736,7 @@ void KDEDefaultButton::enterEvent(QEvent *e)
|
|||
void KDEDefaultButton::leaveEvent(QEvent *e)
|
||||
{
|
||||
isMouseOver=false;
|
||||
repaint(false);
|
||||
repaint();
|
||||
KCommonDecorationButton::leaveEvent(e);
|
||||
}
|
||||
|
||||
|
@ -882,7 +884,7 @@ void KDEDefaultClient::paintEvent( QPaintEvent* )
|
|||
if (!KDEDefault_initialized)
|
||||
return;
|
||||
|
||||
QColorGroup g;
|
||||
QPalette g;
|
||||
int offset;
|
||||
|
||||
KPixmap* upperGradient = isActive() ? aUpperGradient : iUpperGradient;
|
||||
|
@ -915,13 +917,13 @@ void KDEDefaultClient::paintEvent( QPaintEvent* )
|
|||
p.drawRect(x,y,w,h);
|
||||
|
||||
// Draw part of the frame that is the titlebar color
|
||||
g = options()->palette(ColorTitleBar, isActive()).active();
|
||||
p.setPen(g.light());
|
||||
g = options()->palette(ColorTitleBar, isActive());
|
||||
p.setPen(g.color( QPalette::Light ));
|
||||
p.drawLine(x+1, y+1, rightOffset-1, y+1);
|
||||
p.drawLine(x+1, y+1, x+1, leftFrameStart+borderWidth-4);
|
||||
|
||||
// Draw titlebar colour separator line
|
||||
p.setPen(g.dark());
|
||||
p.setPen(g.color( QPalette::Dark ));
|
||||
p.drawLine(rightOffset-1, y+1, rightOffset-1, titleHeight+2);
|
||||
|
||||
p.fillRect(x+2, y+titleHeight+3,
|
||||
|
@ -931,15 +933,15 @@ void KDEDefaultClient::paintEvent( QPaintEvent* )
|
|||
// Finish drawing the titlebar extension
|
||||
p.setPen(Qt::black);
|
||||
p.drawLine(x+1, leftFrameStart+borderWidth-4, x+borderWidth-2, leftFrameStart-1);
|
||||
p.setPen(g.mid());
|
||||
p.setPen(g.color( QPalette::Mid ));
|
||||
p.drawLine(x+borderWidth-2, y+titleHeight+3, x+borderWidth-2, leftFrameStart-2);
|
||||
|
||||
// Fill out the border edges
|
||||
g = options()->palette(ColorFrame, isActive()).active();
|
||||
p.setPen(g.light());
|
||||
g = options()->palette(ColorFrame, isActive());
|
||||
p.setPen(g.color( QPalette::Light ));
|
||||
p.drawLine(rightOffset, y+1, x2-1, y+1);
|
||||
p.drawLine(x+1, leftFrameStart+borderWidth-3, x+1, y2-1);
|
||||
p.setPen(g.dark());
|
||||
p.setPen(g.color( QPalette::Dark ));
|
||||
p.drawLine(x2-1, y+1, x2-1, y2-1);
|
||||
p.drawLine(x+1, y2-1, x2-1, y2-1);
|
||||
|
||||
|
@ -962,18 +964,18 @@ void KDEDefaultClient::paintEvent( QPaintEvent* )
|
|||
if(w > 50)
|
||||
{
|
||||
qDrawShadePanel(&p, x+1, y2-grabBorderWidth+2, 2*borderWidth+12, grabBorderWidth-2,
|
||||
g, false, 1, &g.brush(QColorGroup::Mid));
|
||||
g, false, 1, &g.brush(QPalette::Mid));
|
||||
qDrawShadePanel(&p, x+2*borderWidth+13, y2-grabBorderWidth+2, w-4*borderWidth-26, grabBorderWidth-2,
|
||||
g, false, 1, isActive() ?
|
||||
&g.brush(QColorGroup::Background) :
|
||||
&g.brush(QColorGroup::Mid));
|
||||
&g.brush(QPalette::Background) :
|
||||
&g.brush(QPalette::Mid));
|
||||
qDrawShadePanel(&p, x2-2*borderWidth-12, y2-grabBorderWidth+2, 2*borderWidth+12, grabBorderWidth-2,
|
||||
g, false, 1, &g.brush(QColorGroup::Mid));
|
||||
g, false, 1, &g.brush(QPalette::Mid));
|
||||
} else
|
||||
qDrawShadePanel(&p, x+1, y2-grabBorderWidth+2, w-2, grabBorderWidth-2,
|
||||
g, false, 1, isActive() ?
|
||||
&g.brush(QColorGroup::Background) :
|
||||
&g.brush(QColorGroup::Mid));
|
||||
&g.brush(QPalette::Background) :
|
||||
&g.brush(QPalette::Mid));
|
||||
offset = grabBorderWidth;
|
||||
} else
|
||||
{
|
||||
|
@ -983,7 +985,7 @@ void KDEDefaultClient::paintEvent( QPaintEvent* )
|
|||
}
|
||||
|
||||
// Draw a frame around the wrapped widget.
|
||||
p.setPen( g.dark() );
|
||||
p.setPen( g.color( QPalette::Dark ) );
|
||||
p.drawRect( x+borderWidth-1, y+titleHeight+3, w-2*borderWidth+2, h-titleHeight-offset-2 );
|
||||
|
||||
// Draw the title bar.
|
||||
|
|
|
@ -42,7 +42,7 @@ class KDEDefaultHandler: public KDecorationFactory
|
|||
void createPixmaps();
|
||||
void freePixmaps();
|
||||
void drawButtonBackground(KPixmap *pix,
|
||||
const QColorGroup &g, bool sunken);
|
||||
const QPalette &g, bool sunken);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <qlabel.h>
|
||||
#include <QEvent>
|
||||
#include <QApplication>
|
||||
#include <QStyle>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
|
@ -174,20 +175,20 @@ KeramikHandler::KeramikHandler()
|
|||
settings_cache = NULL;
|
||||
|
||||
// Create the button deco bitmaps
|
||||
buttonDecos[ Menu ] = new QBitmap( 17, 17, menu_bits, true );
|
||||
buttonDecos[ OnAllDesktops ] = new QBitmap( 17, 17, on_all_desktops_bits, true );
|
||||
buttonDecos[ NotOnAllDesktops ] = new QBitmap( 17, 17, not_on_all_desktops_bits, true );
|
||||
buttonDecos[ Help ] = new QBitmap( 17, 17, help_bits, true );
|
||||
buttonDecos[ Minimize ] = new QBitmap( 17, 17, minimize_bits, true );
|
||||
buttonDecos[ Maximize ] = new QBitmap( 17, 17, maximize_bits, true );
|
||||
buttonDecos[ Restore ] = new QBitmap( 17, 17, restore_bits, true );
|
||||
buttonDecos[ Close ] = new QBitmap( 17, 17, close_bits, true );
|
||||
buttonDecos[ AboveOn ] = new QBitmap( 17, 17, above_on_bits, true );
|
||||
buttonDecos[ AboveOff ] = new QBitmap( 17, 17, above_off_bits, true );
|
||||
buttonDecos[ BelowOn ] = new QBitmap( 17, 17, below_on_bits, true );
|
||||
buttonDecos[ BelowOff ] = new QBitmap( 17, 17, below_off_bits, true );
|
||||
buttonDecos[ ShadeOn ] = new QBitmap( 17, 17, shade_on_bits, true );
|
||||
buttonDecos[ ShadeOff ] = new QBitmap( 17, 17, shade_off_bits, true );
|
||||
buttonDecos[ Menu ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), menu_bits ) );
|
||||
buttonDecos[ OnAllDesktops ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), on_all_desktops_bits ) );
|
||||
buttonDecos[ NotOnAllDesktops ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), not_on_all_desktops_bits ) );
|
||||
buttonDecos[ Help ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), help_bits ) );
|
||||
buttonDecos[ Minimize ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), minimize_bits ) );
|
||||
buttonDecos[ Maximize ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), maximize_bits ) );
|
||||
buttonDecos[ Restore ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), restore_bits ) );
|
||||
buttonDecos[ Close ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), close_bits ) );
|
||||
buttonDecos[ AboveOn ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), above_on_bits ) );
|
||||
buttonDecos[ AboveOff ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), above_off_bits ) );
|
||||
buttonDecos[ BelowOn ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), below_on_bits ) );
|
||||
buttonDecos[ BelowOff ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), below_off_bits ) );
|
||||
buttonDecos[ ShadeOn ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), shade_on_bits ) );
|
||||
buttonDecos[ ShadeOff ] = new QBitmap( QBitmap::fromData( QSize( 17, 17 ), shade_off_bits ) );
|
||||
|
||||
// Selfmask the bitmaps
|
||||
for ( int i = 0; i < NumButtonDecos; i++ )
|
||||
|
@ -306,7 +307,7 @@ void KeramikHandler::createPixmaps()
|
|||
delete captionCenter;
|
||||
|
||||
// Create the titlebar center tile
|
||||
activeTiles[ TitleCenter ] = new QPixmap( *titleCenter );
|
||||
activeTiles[ TitleCenter ] = new QPixmap( QPixmap::fromImage( *titleCenter ) );
|
||||
|
||||
delete titleCenter;
|
||||
|
||||
|
@ -347,7 +348,7 @@ void KeramikHandler::createPixmaps()
|
|||
delete captionRight;
|
||||
delete captionCenter;
|
||||
|
||||
inactiveTiles[ TitleCenter ] = new QPixmap( *titleCenter );
|
||||
inactiveTiles[ TitleCenter ] = new QPixmap( QPixmap::fromImage( *titleCenter ) );
|
||||
|
||||
delete titleCenter;
|
||||
|
||||
|
@ -576,7 +577,7 @@ void KeramikHandler::readConfig()
|
|||
|
||||
QPixmap *KeramikHandler::composite( QImage *over, QImage *under )
|
||||
{
|
||||
QImage dest( over->width(), over->height(), 32 );
|
||||
QImage dest( over->width(), over->height(), QImage::Format_RGB32 );
|
||||
int width = over->width(), height = over->height();
|
||||
|
||||
// Clear the destination image
|
||||
|
@ -619,7 +620,7 @@ QPixmap *KeramikHandler::composite( QImage *over, QImage *under )
|
|||
}
|
||||
|
||||
// Create the final pixmap and return it
|
||||
return new QPixmap( dest );
|
||||
return new QPixmap( QPixmap::fromImage( dest ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -637,7 +638,7 @@ QImage *KeramikHandler::loadImage( const QString &name, const QColor &col )
|
|||
QPixmap *KeramikHandler::loadPixmap( const QString &name, const QColor &col )
|
||||
{
|
||||
QImage *img = loadImage( name, col );
|
||||
QPixmap *pix = new QPixmap( *img );
|
||||
QPixmap *pix = new QPixmap( QPixmap::fromImage( *img ) );
|
||||
delete img;
|
||||
|
||||
return pix;
|
||||
|
@ -758,7 +759,7 @@ KeramikButton::KeramikButton( KeramikClient* c, const char *name, Button btn, co
|
|||
realizeButtons = realizeBtns;
|
||||
|
||||
this->setToolTip( tip ); // FRAME
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
setAttribute( Qt::WA_NoSystemBackground );
|
||||
setCursor( Qt::ArrowCursor );
|
||||
int size = clientHandler->roundButton()->height();
|
||||
setFixedSize( size, size );
|
||||
|
@ -778,7 +779,7 @@ void KeramikButton::enterEvent( QEvent *e )
|
|||
Q3Button::enterEvent( e );
|
||||
|
||||
hover = true;
|
||||
repaint( false );
|
||||
repaint();
|
||||
}
|
||||
|
||||
|
||||
|
@ -787,14 +788,17 @@ void KeramikButton::leaveEvent( QEvent *e )
|
|||
Q3Button::leaveEvent( e );
|
||||
|
||||
hover = false;
|
||||
repaint( false );
|
||||
repaint();
|
||||
}
|
||||
|
||||
|
||||
void KeramikButton::mousePressEvent( QMouseEvent *e )
|
||||
{
|
||||
lastbutton = e->button();
|
||||
QMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?Qt::LeftButton : Qt::NoButton, e->state() );
|
||||
QMouseEvent me( e->type(), e->pos(), e->globalPos(),
|
||||
(e->button()&realizeButtons)?Qt::LeftButton : Qt::NoButton,
|
||||
(e->button()&realizeButtons)?Qt::LeftButton : Qt::NoButton,
|
||||
e->modifiers() );
|
||||
Q3Button::mousePressEvent( &me );
|
||||
}
|
||||
|
||||
|
@ -802,7 +806,10 @@ void KeramikButton::mousePressEvent( QMouseEvent *e )
|
|||
void KeramikButton::mouseReleaseEvent( QMouseEvent *e )
|
||||
{
|
||||
lastbutton = e->button();
|
||||
QMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?Qt::LeftButton : Qt::NoButton, e->state() );
|
||||
QMouseEvent me( e->type(), e->pos(), e->globalPos(),
|
||||
(e->button()&realizeButtons)?Qt::LeftButton : Qt::NoButton,
|
||||
(e->button()&realizeButtons)?Qt::LeftButton : Qt::NoButton,
|
||||
e->modifiers() );
|
||||
Q3Button::mouseReleaseEvent( &me );
|
||||
}
|
||||
|
||||
|
@ -909,7 +916,7 @@ void KeramikClient::init()
|
|||
widget()->installEventFilter( this );
|
||||
|
||||
// Minimize flicker
|
||||
widget()->setBackgroundMode( Qt::NoBackground );
|
||||
widget()->setAttribute( Qt::WA_NoSystemBackground );
|
||||
|
||||
for ( int i=0; i < NumButtons; i++ )
|
||||
button[i] = NULL;
|
||||
|
@ -921,7 +928,9 @@ void KeramikClient::createLayout()
|
|||
{
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout( widget() );
|
||||
QBoxLayout *titleLayout = new QBoxLayout( 0, QBoxLayout::LeftToRight, 0, 0, 0 );
|
||||
QBoxLayout *titleLayout = new QBoxLayout( QBoxLayout::LeftToRight );
|
||||
titleLayout->setMargin( 0 );
|
||||
titleLayout->setSpacing( 0 );
|
||||
QHBoxLayout *windowLayout = new QHBoxLayout();
|
||||
|
||||
largeTitlebar = ( !maximizedVertical() && clientHandler->largeCaptionBubbles() );
|
||||
|
@ -1012,10 +1021,10 @@ void KeramikClient::reset( unsigned long )
|
|||
// Only repaint the window if it's visible
|
||||
// (i.e. not minimized and on the current desktop)
|
||||
if ( widget()->isVisible() ) {
|
||||
widget()->repaint( false );
|
||||
widget()->repaint();
|
||||
|
||||
for ( int i = 0; i < NumButtons; i++ )
|
||||
if ( button[i] ) button[i]->repaint( false );
|
||||
if ( button[i] ) button[i]->repaint();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1024,7 +1033,7 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s )
|
|||
{
|
||||
for ( int i=0; i < s.length(); i++ )
|
||||
{
|
||||
switch ( s[i].latin1() )
|
||||
switch ( s[i].toLatin1() )
|
||||
{
|
||||
// Menu button
|
||||
case 'M' :
|
||||
|
@ -1237,15 +1246,16 @@ void KeramikClient::updateCaptionBuffer()
|
|||
|
||||
if ( clientHandler->showAppIcons() )
|
||||
{
|
||||
QStyle *style = button[ 0 ]->style();
|
||||
if ( active ) {
|
||||
if ( ! activeIcon )
|
||||
activeIcon = new QPixmap( this->icon().pixmap( QIcon::Small, QIcon::Normal )); // FRAME
|
||||
activeIcon = new QPixmap( this->icon().pixmap( style->pixelMetric( QStyle::PM_SmallIconSize ), QIcon::Normal )); // FRAME
|
||||
icon = activeIcon;
|
||||
} else {
|
||||
if ( ! inactiveIcon ) {
|
||||
QImage img = this->icon().pixmap( QIcon::Small, QIcon::Normal ).convertToImage();
|
||||
QImage img = this->icon().pixmap( style->pixelMetric( QStyle::PM_SmallIconSize ), QIcon::Normal ).toImage();
|
||||
KIconEffect::semiTransparent( img );
|
||||
inactiveIcon = new QPixmap( img );
|
||||
inactiveIcon = new QPixmap( QPixmap::fromImage( img ) );
|
||||
}
|
||||
icon = inactiveIcon;
|
||||
}
|
||||
|
@ -1341,7 +1351,7 @@ void KeramikClient::captionChange()
|
|||
|
||||
captionBufferDirty = true;
|
||||
|
||||
widget()->repaint( r | captionRect, false );
|
||||
widget()->repaint( r | captionRect );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1357,7 +1367,7 @@ void KeramikClient::iconChange()
|
|||
activeIcon = inactiveIcon = NULL;
|
||||
|
||||
captionBufferDirty = true;
|
||||
widget()->repaint( captionRect, false );
|
||||
widget()->repaint( captionRect );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1376,10 +1386,10 @@ void KeramikClient::activeChange()
|
|||
|
||||
captionBufferDirty = true;
|
||||
|
||||
widget()->repaint( false );
|
||||
widget()->repaint();
|
||||
|
||||
for ( int i=0; i < NumButtons; i++ )
|
||||
if ( button[i] ) button[i]->repaint( false );
|
||||
if ( button[i] ) button[i]->repaint();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1396,7 +1406,7 @@ void KeramikClient::maximizeChange()
|
|||
captionBufferDirty = maskDirty = true;
|
||||
|
||||
widget()->layout()->activate();
|
||||
widget()->repaint( false );
|
||||
widget()->repaint();
|
||||
} else if (( maximizeMode() & MaximizeVertical ) == 0 && !largeTitlebar ) {
|
||||
// We've been restored - enlarge the titlebar by 3 pixels
|
||||
topSpacer->changeSize( 10, 4, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||
|
@ -1406,7 +1416,7 @@ void KeramikClient::maximizeChange()
|
|||
captionBufferDirty = maskDirty = true;
|
||||
|
||||
widget()->layout()->activate();
|
||||
widget()->repaint( false );
|
||||
widget()->repaint();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1421,7 +1431,7 @@ void KeramikClient::desktopChange()
|
|||
{
|
||||
if ( button[ OnAllDesktopsButton ] )
|
||||
{
|
||||
button[ OnAllDesktopsButton ]->repaint( true );
|
||||
button[ OnAllDesktopsButton ]->repaint();
|
||||
button[ OnAllDesktopsButton ]->setToolTip( isOnAllDesktops() ? i18n("Not on all desktops") : i18n("On all desktops") );
|
||||
}
|
||||
}
|
||||
|
@ -1431,7 +1441,7 @@ void KeramikClient::shadeChange()
|
|||
{
|
||||
if ( button[ ShadeButton ] )
|
||||
{
|
||||
button[ ShadeButton ]->repaint( true );
|
||||
button[ ShadeButton ]->repaint();
|
||||
button[ ShadeButton ]->setToolTip( isSetShade() ? i18n("Unshade") : i18n("Shade") );
|
||||
}
|
||||
}
|
||||
|
@ -1440,14 +1450,14 @@ void KeramikClient::shadeChange()
|
|||
void KeramikClient::keepAboveChange( bool )
|
||||
{
|
||||
if ( button[ AboveButton ] )
|
||||
button[ AboveButton ]->repaint( true );
|
||||
button[ AboveButton ]->repaint();
|
||||
}
|
||||
|
||||
|
||||
void KeramikClient::keepBelowChange( bool )
|
||||
{
|
||||
if ( button[ BelowButton ] )
|
||||
button[ BelowButton ]->repaint( true );
|
||||
button[ BelowButton ]->repaint();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1475,21 +1485,21 @@ void KeramikClient::slotMaximize()
|
|||
void KeramikClient::slotAbove()
|
||||
{
|
||||
setKeepAbove( !keepAbove());
|
||||
button[ AboveButton ]->repaint( true );
|
||||
button[ AboveButton ]->repaint();
|
||||
}
|
||||
|
||||
|
||||
void KeramikClient::slotBelow()
|
||||
{
|
||||
setKeepBelow( !keepBelow());
|
||||
button[ BelowButton ]->repaint( true );
|
||||
button[ BelowButton ]->repaint();
|
||||
}
|
||||
|
||||
|
||||
void KeramikClient::slotShade()
|
||||
{
|
||||
setShade( !isSetShade());
|
||||
button[ ShadeButton ]->repaint( true );
|
||||
button[ ShadeButton ]->repaint();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ void PlastikConfig::load(KConfig*)
|
|||
|
||||
|
||||
QString value = m_config->readEntry("TitleAlignment", "AlignLeft");
|
||||
QRadioButton *button = (QRadioButton*)m_dialog->titleAlign->child(value.latin1());
|
||||
QRadioButton *button = m_dialog->titleAlign->findChild<QRadioButton*>(value.toLatin1());
|
||||
if (button) button->setChecked(true);
|
||||
bool animateButtons = m_config->readEntry("AnimateButtons", QVariant(true)).toBool();
|
||||
m_dialog->animateButtons->setChecked(animateButtons);
|
||||
|
@ -90,7 +90,7 @@ void PlastikConfig::save(KConfig*)
|
|||
m_config->setGroup("General");
|
||||
|
||||
QRadioButton *button = (QRadioButton*)m_dialog->titleAlign->selected();
|
||||
if (button) m_config->writeEntry("TitleAlignment", QString(button->name()));
|
||||
if (button) m_config->writeEntry("TitleAlignment", QString(button->objectName()));
|
||||
m_config->writeEntry("AnimateButtons", m_dialog->animateButtons->isChecked() );
|
||||
m_config->writeEntry("CloseOnMenuDoubleClick", m_dialog->menuClose->isChecked() );
|
||||
m_config->writeEntry("TitleShadow", m_dialog->titleShadow->isChecked() );
|
||||
|
@ -100,8 +100,7 @@ void PlastikConfig::save(KConfig*)
|
|||
|
||||
void PlastikConfig::defaults()
|
||||
{
|
||||
QRadioButton *button =
|
||||
(QRadioButton*)m_dialog->titleAlign->child("AlignLeft");
|
||||
QRadioButton *button = m_dialog->titleAlign->findChild<QRadioButton*>("AlignLeft");
|
||||
if (button) button->setChecked(true);
|
||||
m_dialog->animateButtons->setChecked(true);
|
||||
m_dialog->menuClose->setChecked(false);
|
||||
|
|
|
@ -69,8 +69,7 @@ QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int
|
|||
}
|
||||
|
||||
QImage recolorImage(QImage *img, QColor color) {
|
||||
QImage destImg(img->width(),img->height(),32);
|
||||
destImg.setAlphaBuffer(true);
|
||||
QImage destImg(img->width(),img->height(), QImage::Format_ARGB32);
|
||||
for (int x = 0; x < img->width(); x++) {
|
||||
for (int y = 0; y < img->height(); y++) {
|
||||
if(img->pixel(x,y) == qRgb(0,0,255) ) {
|
||||
|
|
|
@ -242,8 +242,7 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow
|
|||
const int gradientHeight = 2 + titleBarTileHeight-1;
|
||||
QPixmap gradient(1, gradientHeight);
|
||||
QPainter painter(&gradient);
|
||||
KPixmap tempPixmap;
|
||||
tempPixmap.resize(1, 4);
|
||||
KPixmap tempPixmap( 1, 4 );
|
||||
KPixmapEffect::gradient(tempPixmap,
|
||||
getColor(TitleGradient1, active),
|
||||
getColor(TitleGradient2, active),
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
// #include <kwin/options.h>
|
||||
|
||||
#include <QAbstractButton>
|
||||
#include <QStyle>
|
||||
#include <qbitmap.h>
|
||||
#include <qpainter.h>
|
||||
#include <qpixmap.h>
|
||||
|
@ -47,7 +48,7 @@ PlastikButton::PlastikButton(ButtonType type, PlastikClient *parent)
|
|||
m_iconType(NumButtonIcons),
|
||||
hover(false)
|
||||
{
|
||||
setBackgroundMode(Qt::NoBackground);
|
||||
setAttribute(Qt::WA_NoSystemBackground);
|
||||
|
||||
// no need to reset here as the button will be resetted on first resize.
|
||||
|
||||
|
@ -142,7 +143,7 @@ void PlastikButton::animate()
|
|||
}
|
||||
}
|
||||
|
||||
repaint(false);
|
||||
repaint();
|
||||
}
|
||||
|
||||
void PlastikButton::enterEvent(QEvent *e)
|
||||
|
@ -204,8 +205,7 @@ void PlastikButton::drawButton(QPainter *painter)
|
|||
sourfaceBottom = alphaBlendColors(sourfaceBottom, Qt::black, 200);
|
||||
}
|
||||
|
||||
QPixmap buffer;
|
||||
buffer.resize(width(), height());
|
||||
QPixmap buffer(width(), height());
|
||||
QPainter bP(&buffer);
|
||||
|
||||
// fake the titlebar background
|
||||
|
@ -259,9 +259,9 @@ void PlastikButton::drawButton(QPainter *painter)
|
|||
|
||||
if (type() == MenuButton)
|
||||
{
|
||||
QPixmap menuIcon(m_client->icon().pixmap( QIcon::Small, QIcon::Normal));
|
||||
QPixmap menuIcon(m_client->icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ) ));
|
||||
if (width() < menuIcon.width() || height() < menuIcon.height() ) {
|
||||
menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height()));
|
||||
menuIcon = QPixmap::fromImage( menuIcon.toImage().scaled(width(), height()));
|
||||
}
|
||||
bP.drawPixmap((width()-menuIcon.width())/2, (height()-menuIcon.height())/2, menuIcon);
|
||||
}
|
||||
|
|
28
events.cpp
28
events.cpp
|
@ -1053,22 +1053,22 @@ int qtToX11Button( Qt::ButtonState button )
|
|||
return AnyButton;
|
||||
}
|
||||
|
||||
int qtToX11State( Qt::ButtonState state )
|
||||
int qtToX11State( Qt::ButtonState buttons, Qt::KeyboardModifiers modifiers )
|
||||
{
|
||||
int ret = 0;
|
||||
if( state & Qt::LeftButton )
|
||||
if( buttons & Qt::LeftButton )
|
||||
ret |= Button1Mask;
|
||||
if( state & Qt::MidButton )
|
||||
if( buttons & Qt::MidButton )
|
||||
ret |= Button2Mask;
|
||||
if( state & Qt::RightButton )
|
||||
if( buttons & Qt::RightButton )
|
||||
ret |= Button3Mask;
|
||||
if( state & Qt::ShiftModifier )
|
||||
if( modifiers & Qt::ShiftModifier )
|
||||
ret |= ShiftMask;
|
||||
if( state & Qt::ControlModifier )
|
||||
if( modifiers & Qt::ControlModifier )
|
||||
ret |= ControlMask;
|
||||
if( state & Qt::AltModifier )
|
||||
if( modifiers & Qt::AltModifier )
|
||||
ret |= KKeyServer::modXAlt();
|
||||
if( state & Qt::MetaModifier )
|
||||
if( modifiers & Qt::MetaModifier )
|
||||
ret |= KKeyServer::modXMeta();
|
||||
return ret;
|
||||
}
|
||||
|
@ -1083,27 +1083,27 @@ bool Client::eventFilter( QObject* o, QEvent* e )
|
|||
if( e->type() == QEvent::MouseButtonPress )
|
||||
{
|
||||
QMouseEvent* ev = static_cast< QMouseEvent* >( e );
|
||||
return buttonPressEvent( decorationId(), qtToX11Button( ev->button()), qtToX11State( ev->state()),
|
||||
return buttonPressEvent( decorationId(), qtToX11Button( ev->button()), qtToX11State( ev->buttons(), ev->modifiers() ),
|
||||
ev->x(), ev->y(), ev->globalX(), ev->globalY() );
|
||||
}
|
||||
if( e->type() == QEvent::MouseButtonRelease )
|
||||
{
|
||||
QMouseEvent* ev = static_cast< QMouseEvent* >( e );
|
||||
return buttonReleaseEvent( decorationId(), qtToX11Button( ev->button()), qtToX11State( ev->state()),
|
||||
return buttonReleaseEvent( decorationId(), qtToX11Button( ev->button()), qtToX11State( ev->buttons(), ev->modifiers() ),
|
||||
ev->x(), ev->y(), ev->globalX(), ev->globalY() );
|
||||
}
|
||||
if( e->type() == QEvent::MouseMove ) // FRAME i fake z enter/leave?
|
||||
{
|
||||
QMouseEvent* ev = static_cast< QMouseEvent* >( e );
|
||||
return motionNotifyEvent( decorationId(), qtToX11State( ev->state()),
|
||||
return motionNotifyEvent( decorationId(), qtToX11State( ev->buttons(), ev->modifiers() ),
|
||||
ev->x(), ev->y(), ev->globalX(), ev->globalY() );
|
||||
}
|
||||
if( e->type() == QEvent::Wheel )
|
||||
{
|
||||
QWheelEvent* ev = static_cast< QWheelEvent* >( e );
|
||||
bool r = buttonPressEvent( decorationId(), ev->delta() > 0 ? Button4 : Button5, qtToX11State( ev->state()),
|
||||
bool r = buttonPressEvent( decorationId(), ev->delta() > 0 ? Button4 : Button5, qtToX11State( ev->buttons(), ev->modifiers() ),
|
||||
ev->x(), ev->y(), ev->globalX(), ev->globalY() );
|
||||
r = r || buttonReleaseEvent( decorationId(), ev->delta() > 0 ? Button4 : Button5, qtToX11State( ev->state()),
|
||||
r = r || buttonReleaseEvent( decorationId(), ev->delta() > 0 ? Button4 : Button5, qtToX11State( ev->buttons(), ev->modifiers() ),
|
||||
ev->x(), ev->y(), ev->globalX(), ev->globalY() );
|
||||
return r;
|
||||
}
|
||||
|
@ -1279,7 +1279,7 @@ void Client::processMousePressEvent( QMouseEvent* e )
|
|||
default:
|
||||
return;
|
||||
}
|
||||
processDecorationButtonPress( button, e->state(), e->x(), e->y(), e->globalX(), e->globalY());
|
||||
processDecorationButtonPress( button, e->buttons(), e->x(), e->y(), e->globalX(), e->globalY());
|
||||
}
|
||||
|
||||
// return value matters only when filtering events before decoration gets them
|
||||
|
|
|
@ -15,8 +15,9 @@ namespace KWinInternal
|
|||
{
|
||||
|
||||
GeometryTip::GeometryTip( const XSizeHints* xSizeHints, bool save_under ):
|
||||
QLabel(NULL, "kwingeometry" )
|
||||
QLabel( 0 )
|
||||
{
|
||||
setObjectName( "kwingeometry" );
|
||||
setMargin(1);
|
||||
setIndent(0);
|
||||
setLineWidth(1);
|
||||
|
|
|
@ -78,7 +78,7 @@ bool ButtonDrag::canDecode( QDropEvent* e )
|
|||
|
||||
bool ButtonDrag::decode( QDropEvent* e, Button& btn )
|
||||
{
|
||||
QByteArray data = e->data( BUTTONDRAGMIMETYPE );
|
||||
QByteArray data = e->mimeData()->data( BUTTONDRAGMIMETYPE );
|
||||
if ( data.size() )
|
||||
{
|
||||
e->accept();
|
||||
|
@ -157,7 +157,7 @@ QSize ButtonSource::sizeHint() const
|
|||
if ( cachedSizeHint().isValid() )
|
||||
return cachedSizeHint();
|
||||
|
||||
constPolish();
|
||||
ensurePolished();
|
||||
|
||||
QSize s( header()->sizeHint() );
|
||||
|
||||
|
@ -228,7 +228,7 @@ Q3DragObject *ButtonSource::dragObject()
|
|||
|
||||
if (i) {
|
||||
ButtonDrag *bd = new ButtonDrag(i->button(), viewport(), "button_drag");
|
||||
bd->setPixmap(bitmapPixmap(i->button().icon, colorGroup().foreground() ));
|
||||
bd->setPixmap(bitmapPixmap(i->button().icon, palette().color( QPalette::Foreground )));
|
||||
return bd;
|
||||
}
|
||||
|
||||
|
@ -429,7 +429,7 @@ void ButtonDropSite::dropEvent( QDropEvent* e )
|
|||
if (oldPos == buttonPosition)
|
||||
return; // button didn't change its position during the drag...
|
||||
|
||||
oldList->remove(oldPos);
|
||||
oldList->erase(oldPos);
|
||||
buttonItem = m_selected;
|
||||
} else {
|
||||
return; // m_selected not found, return...
|
||||
|
@ -498,7 +498,7 @@ void ButtonDropSite::mousePressEvent( QMouseEvent* e )
|
|||
m_selected = buttonAt(e->pos() );
|
||||
if (m_selected) {
|
||||
ButtonDrag *bd = new ButtonDrag(m_selected->button(), this);
|
||||
bd->setPixmap(bitmapPixmap(m_selected->button().icon, colorGroup().foreground() ) );
|
||||
bd->setPixmap(bitmapPixmap(m_selected->button().icon, palette().color( QPalette::Foreground ) ) );
|
||||
bd->dragMove();
|
||||
}
|
||||
}
|
||||
|
@ -682,10 +682,14 @@ Button ButtonSourceItem::button() const
|
|||
|
||||
|
||||
ButtonPositionWidget::ButtonPositionWidget(QWidget *parent, const char* name)
|
||||
: QWidget(parent,name),
|
||||
: QWidget(parent),
|
||||
m_factory(0)
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
|
||||
setObjectName( name );
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(KDialog::spacingHint());
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
|
||||
|
||||
QLabel* label = new QLabel( this );
|
||||
|
@ -787,47 +791,47 @@ Button ButtonPositionWidget::getButton(QChar type, bool& success) {
|
|||
success = true;
|
||||
|
||||
if (type == 'R') {
|
||||
QBitmap bmp(resize_width, resize_height, resize_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( resize_width, resize_height ), resize_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("Resize"), bmp, 'R', false, m_supportedButtons.contains('R') );
|
||||
} else if (type == 'L') {
|
||||
QBitmap bmp(shade_width, shade_height, shade_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( shade_width, shade_height ), shade_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("Shade"), bmp, 'L', false, m_supportedButtons.contains('L') );
|
||||
} else if (type == 'B') {
|
||||
QBitmap bmp(keepbelowothers_width, keepbelowothers_height, keepbelowothers_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( keepbelowothers_width, keepbelowothers_height ), keepbelowothers_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("Keep Below Others"), bmp, 'B', false, m_supportedButtons.contains('B') );
|
||||
} else if (type == 'F') {
|
||||
QBitmap bmp(keepaboveothers_width, keepaboveothers_height, keepaboveothers_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( keepaboveothers_width, keepaboveothers_height ), keepaboveothers_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("Keep Above Others"), bmp, 'F', false, m_supportedButtons.contains('F') );
|
||||
} else if (type == 'X') {
|
||||
QBitmap bmp(close_width, close_height, close_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( close_width, close_height ), close_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("Close"), bmp, 'X', false, m_supportedButtons.contains('X') );
|
||||
} else if (type == 'A') {
|
||||
QBitmap bmp(maximize_width, maximize_height, maximize_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( maximize_width, maximize_height ), maximize_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("Maximize"), bmp, 'A', false, m_supportedButtons.contains('A') );
|
||||
} else if (type == 'I') {
|
||||
QBitmap bmp(minimize_width, minimize_height, minimize_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( minimize_width, minimize_height ), minimize_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("Minimize"), bmp, 'I', false, m_supportedButtons.contains('I') );
|
||||
} else if (type == 'H') {
|
||||
QBitmap bmp(help_width, help_height, help_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( help_width, help_height ), help_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("Help"), bmp, 'H', false, m_supportedButtons.contains('H') );
|
||||
} else if (type == 'S') {
|
||||
QBitmap bmp(onalldesktops_width, onalldesktops_height, onalldesktops_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( onalldesktops_width, onalldesktops_height ), onalldesktops_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("On All Desktops"), bmp, 'S', false, m_supportedButtons.contains('S') );
|
||||
} else if (type == 'M') {
|
||||
QBitmap bmp(menu_width, menu_height, menu_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( menu_width, menu_height ), menu_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("Menu"), bmp, 'M', false, m_supportedButtons.contains('M') );
|
||||
} else if (type == '_') {
|
||||
QBitmap bmp(spacer_width, spacer_height, spacer_bits, true);
|
||||
QBitmap bmp = QBitmap::fromData(QSize( spacer_width, spacer_height ), spacer_bits);
|
||||
bmp.setMask(bmp);
|
||||
return Button(i18n("--- spacer ---"), bmp, '_', true, m_supportedButtons.contains('_') );
|
||||
} else {
|
||||
|
|
|
@ -73,10 +73,14 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co
|
|||
kwinConfig("kwinrc"),
|
||||
pluginObject(0)
|
||||
{
|
||||
setObjectName( name );
|
||||
|
||||
kwinConfig.setGroup("Style");
|
||||
plugins = new KDecorationPreviewPlugins( &kwinConfig );
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(this, 0, KDialog::spacingHint());
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(KDialog::spacingHint());
|
||||
|
||||
// Save this for later...
|
||||
// cbUseMiniWindows = new QCheckBox( i18n( "Render mini &titlebars for all windows"), checkGroup );
|
||||
|
@ -88,7 +92,9 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co
|
|||
// Page 1 (General Options)
|
||||
QWidget *pluginPage = new QWidget( tabWidget );
|
||||
|
||||
QVBoxLayout* pluginLayout = new QVBoxLayout(pluginPage, KDialog::marginHint(), KDialog::spacingHint());
|
||||
QVBoxLayout* pluginLayout = new QVBoxLayout(pluginPage);
|
||||
pluginLayout->setMargin(KDialog::marginHint());
|
||||
pluginLayout->setSpacing(KDialog::spacingHint());
|
||||
|
||||
// decoration chooser
|
||||
decorationList = new KComboBox( pluginPage );
|
||||
|
@ -113,17 +119,20 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co
|
|||
cBorder->setWhatsThis( i18n( "Use this combobox to change the border size of the decoration." ));
|
||||
lBorder->hide();
|
||||
cBorder->hide();
|
||||
QHBoxLayout *borderSizeLayout = new QHBoxLayout(pluginSettingsGrp->layout() );
|
||||
QHBoxLayout *borderSizeLayout = new QHBoxLayout();
|
||||
pluginSettingsGrp->layout()->addItem( borderSizeLayout );
|
||||
borderSizeLayout->addWidget(lBorder);
|
||||
borderSizeLayout->addWidget(cBorder);
|
||||
borderSizeLayout->addStretch();
|
||||
|
||||
pluginConfigWidget = new KVBox(pluginSettingsGrp);
|
||||
pluginSettingsGrp->layout()->add( pluginConfigWidget );
|
||||
pluginSettingsGrp->layout()->addWidget( pluginConfigWidget );
|
||||
|
||||
// Page 2 (Button Selector)
|
||||
QWidget* buttonPage = new QWidget( tabWidget );
|
||||
QVBoxLayout* buttonLayout = new QVBoxLayout(buttonPage, KDialog::marginHint(), KDialog::spacingHint());
|
||||
QVBoxLayout* buttonLayout = new QVBoxLayout(buttonPage);
|
||||
buttonLayout->setMargin(KDialog::marginHint());
|
||||
buttonLayout->setSpacing(KDialog::spacingHint());
|
||||
|
||||
cbShowToolTips = new QCheckBox(
|
||||
i18n("&Show window button tooltips"), buttonPage );
|
||||
|
@ -143,13 +152,16 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co
|
|||
// Add nifty dnd button modification widgets
|
||||
buttonPositionWidget = new ButtonPositionWidget(buttonPage, "button_position_widget");
|
||||
buttonPositionWidget->setDecorationFactory(plugins->factory() );
|
||||
QHBoxLayout* buttonControlLayout = new QHBoxLayout(buttonLayout);
|
||||
QHBoxLayout* buttonControlLayout = new QHBoxLayout();
|
||||
buttonLayout->addLayout( buttonControlLayout );
|
||||
buttonControlLayout->addSpacing(20);
|
||||
buttonControlLayout->addWidget(buttonPositionWidget);
|
||||
// buttonLayout->addStretch();
|
||||
|
||||
// preview
|
||||
QVBoxLayout* previewLayout = new QVBoxLayout(layout, KDialog::spacingHint() );
|
||||
QVBoxLayout* previewLayout = new QVBoxLayout();
|
||||
previewLayout->setSpacing( KDialog::spacingHint() );
|
||||
layout->addLayout( previewLayout );
|
||||
previewLayout->setMargin( KDialog::marginHint() );
|
||||
|
||||
preview = new KDecorationPreview( this );
|
||||
|
@ -165,8 +177,8 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const char* name, co
|
|||
readConfig( &kwinConfig );
|
||||
resetPlugin( &kwinConfig );
|
||||
|
||||
tabWidget->insertTab( pluginPage, i18n("&Window Decoration") );
|
||||
tabWidget->insertTab( buttonPage, i18n("&Buttons") );
|
||||
tabWidget->addTab( pluginPage, i18n("&Window Decoration") );
|
||||
tabWidget->addTab( buttonPage, i18n("&Buttons") );
|
||||
|
||||
connect( buttonPositionWidget, SIGNAL(changed()), this, SLOT(slotButtonsChanged()) ); // update preview etc.
|
||||
connect( buttonPositionWidget, SIGNAL(changed()), this, SLOT(slotSelectionChanged()) ); // emit changed()...
|
||||
|
@ -245,7 +257,7 @@ void KWinDecorationModule::createDecorationList()
|
|||
decorationNames.append((*it).name);
|
||||
}
|
||||
decorationNames.sort();
|
||||
decorationList->insertStringList(decorationNames);
|
||||
decorationList->addItems(decorationNames);
|
||||
}
|
||||
|
||||
|
||||
|
@ -573,7 +585,7 @@ void KWinDecorationModule::checkSupportedBorderSizes()
|
|||
cBorder->clear();
|
||||
for (QList<BorderSize>::const_iterator it = sizes.begin(); it != sizes.end(); ++it) {
|
||||
BorderSize size = *it;
|
||||
cBorder->insertItem(i18n(border_names[size]), borderSizeToIndex(size,sizes) );
|
||||
cBorder->addItem(i18n(border_names[size]), borderSizeToIndex(size,sizes) );
|
||||
}
|
||||
int pos = borderSizeToIndex( border_size, sizes );
|
||||
lBorder->show();
|
||||
|
|
|
@ -41,8 +41,10 @@
|
|||
// FRAME the preview doesn't update to reflect the changes done in the kcm
|
||||
|
||||
KDecorationPreview::KDecorationPreview( QWidget* parent, const char* name )
|
||||
: QWidget( parent, name )
|
||||
: QWidget( parent )
|
||||
{
|
||||
setObjectName( name );
|
||||
|
||||
options = new KDecorationPreviewOptions;
|
||||
|
||||
bridge[Active] = new KDecorationPreviewBridge( this, true );
|
||||
|
|
|
@ -117,8 +117,8 @@ void createMaxButtonPixmaps()
|
|||
for (int t = 0; t < 3; ++t)
|
||||
{
|
||||
maxButtonXpms[t][0] = "15 13 2 1";
|
||||
maxButtonXpms[t][1] = baseColor.ascii();
|
||||
maxButtonXpms[t][2] = textColor.ascii();
|
||||
maxButtonXpms[t][1] = baseColor.toAscii();
|
||||
maxButtonXpms[t][2] = textColor.toAscii();
|
||||
maxButtonPixmaps[t] = QPixmap(maxButtonXpms[t]);
|
||||
maxButtonPixmaps[t].setMask(maxButtonPixmaps[t].createHeuristicMask());
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ void KTitleBarActionsConfig::paletteChanged()
|
|||
createMaxButtonPixmaps();
|
||||
for (int b = 0; b < 3; ++b)
|
||||
for (int t = 0; t < 3; ++t)
|
||||
coMax[b]->changeItem(maxButtonPixmaps[t], t);
|
||||
coMax[b]->setItemIcon(t, maxButtonPixmaps[t]);
|
||||
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,9 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
|
|||
: KCModule(inst, parent), config(_config), standAlone(_standAlone)
|
||||
{
|
||||
QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3;
|
||||
QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(KDialog::spacingHint());
|
||||
Q3Grid *grid;
|
||||
Q3GroupBox *box;
|
||||
QLabel *label;
|
||||
|
@ -150,7 +152,8 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
|
|||
|
||||
/** Titlebar doubleclick ************/
|
||||
|
||||
QHBoxLayout *hlayout = new QHBoxLayout(layout);
|
||||
QHBoxLayout *hlayout = new QHBoxLayout();
|
||||
layout->addLayout( hlayout );
|
||||
|
||||
label = new QLabel(i18n("&Titlebar double-click:"), this);
|
||||
hlayout->addWidget(label);
|
||||
|
@ -158,14 +161,14 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
|
|||
" 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("Minimize"));
|
||||
combo->insertItem(i18n("Shade"));
|
||||
combo->insertItem(i18n("Lower"));
|
||||
combo->insertItem(i18n("On All Desktops"));
|
||||
combo->insertItem(i18n("Nothing"));
|
||||
combo->addItem(i18n("Maximize"));
|
||||
combo->addItem(i18n("Maximize (vertical only)"));
|
||||
combo->addItem(i18n("Maximize (horizontal only)"));
|
||||
combo->addItem(i18n("Minimize"));
|
||||
combo->addItem(i18n("Shade"));
|
||||
combo->addItem(i18n("Lower"));
|
||||
combo->addItem(i18n("On All Desktops"));
|
||||
combo->addItem(i18n("Nothing"));
|
||||
combo->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
hlayout->addWidget(combo);
|
||||
|
@ -175,7 +178,8 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
|
|||
label->setBuddy(combo);
|
||||
|
||||
/** Mouse Wheel Events **************/
|
||||
QHBoxLayout *hlayoutW = new QHBoxLayout(layout);
|
||||
QHBoxLayout *hlayoutW = new QHBoxLayout();
|
||||
layout->addLayout( hlayoutW );
|
||||
strMouseWheel = i18n("Titlebar wheel event:");
|
||||
label = new QLabel(strMouseWheel, this);
|
||||
hlayoutW->addWidget(label);
|
||||
|
@ -184,13 +188,13 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
|
|||
|
||||
// Titlebar and frame mouse Wheel
|
||||
QComboBox* comboW = new QComboBox(this);
|
||||
comboW->insertItem(i18n("Raise/Lower"));
|
||||
comboW->insertItem(i18n("Shade/Unshade"));
|
||||
comboW->insertItem(i18n("Maximize/Restore"));
|
||||
comboW->insertItem(i18n("Keep Above/Below"));
|
||||
comboW->insertItem(i18n("Move to Previous/Next Desktop"));
|
||||
comboW->insertItem(i18n("Change Opacity"));
|
||||
comboW->insertItem(i18n("Nothing"));
|
||||
comboW->addItem(i18n("Raise/Lower"));
|
||||
comboW->addItem(i18n("Shade/Unshade"));
|
||||
comboW->addItem(i18n("Maximize/Restore"));
|
||||
comboW->addItem(i18n("Keep Above/Below"));
|
||||
comboW->addItem(i18n("Move to Previous/Next Desktop"));
|
||||
comboW->addItem(i18n("Change Opacity"));
|
||||
comboW->addItem(i18n("Nothing"));
|
||||
comboW->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
|
||||
connect(comboW, SIGNAL(activated(int)), SLOT(changed()));
|
||||
hlayoutW->addWidget(comboW);
|
||||
|
@ -244,11 +248,11 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
|
|||
|
||||
// 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 & Lower"));
|
||||
combo->insertItem(i18n("Nothing"));
|
||||
combo->addItem(i18n("Raise"));
|
||||
combo->addItem(i18n("Lower"));
|
||||
combo->addItem(i18n("Operations Menu"));
|
||||
combo->addItem(i18n("Toggle Raise & Lower"));
|
||||
combo->addItem(i18n("Nothing"));
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coTiAct1 = combo;
|
||||
|
||||
|
@ -273,14 +277,14 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
|
|||
<< i18n("Shade");
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coTiAct2 = combo;
|
||||
combo->setWhatsThis( 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);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coTiAct3 = combo;
|
||||
combo->setWhatsThis( txtButton3 );
|
||||
|
@ -310,19 +314,19 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
|
|||
<< i18n("Nothing");
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coTiInAct1 = combo;
|
||||
combo->setWhatsThis( txtButton1);
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coTiInAct2 = combo;
|
||||
combo->setWhatsThis( 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);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coTiInAct3 = combo;
|
||||
combo->setWhatsThis( txtButton3);
|
||||
|
@ -362,7 +366,7 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
|
|||
label ->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ));
|
||||
|
||||
coMax[b] = new ToolTipComboBox(box, tbl_Max);
|
||||
for (int t = 0; t < 3; ++t) coMax[b]->insertItem(maxButtonPixmaps[t]);
|
||||
for (int t = 0; t < 3; ++t) coMax[b]->addItem(maxButtonPixmaps[t], QString());
|
||||
connect(coMax[b], SIGNAL(activated(int)), SLOT(changed()));
|
||||
connect(coMax[b], SIGNAL(activated(int)), coMax[b], SLOT(changed()));
|
||||
coMax[b]->setWhatsThis( txtButton[b] );
|
||||
|
@ -533,18 +537,18 @@ const char* KTitleBarActionsConfig::functionMax( int i )
|
|||
void KTitleBarActionsConfig::load()
|
||||
{
|
||||
config->setGroup("Windows");
|
||||
setComboText(coTiDbl, config->readEntry("TitlebarDoubleClickCommand","Shade").ascii());
|
||||
setComboText(coTiDbl, config->readEntry("TitlebarDoubleClickCommand","Shade").toAscii());
|
||||
for (int t = 0; t < 3; ++t)
|
||||
setComboText(coMax[t],config->readEntry(cnf_Max[t], tbl_Max[t]).ascii());
|
||||
setComboText(coMax[t],config->readEntry(cnf_Max[t], tbl_Max[t]).toAscii());
|
||||
|
||||
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(coTiAct4,config->readEntry("CommandTitlebarWheel","Nothing").ascii());
|
||||
setComboText(coTiInAct1,config->readEntry("CommandInactiveTitlebar1","Activate and raise").ascii());
|
||||
setComboText(coTiInAct2,config->readEntry("CommandInactiveTitlebar2","Activate and lower").ascii());
|
||||
setComboText(coTiInAct3,config->readEntry("CommandInactiveTitlebar3","Operations menu").ascii());
|
||||
setComboText(coTiAct1,config->readEntry("CommandActiveTitlebar1","Raise").toAscii());
|
||||
setComboText(coTiAct2,config->readEntry("CommandActiveTitlebar2","Lower").toAscii());
|
||||
setComboText(coTiAct3,config->readEntry("CommandActiveTitlebar3","Operations menu").toAscii());
|
||||
setComboText(coTiAct4,config->readEntry("CommandTitlebarWheel","Nothing").toAscii());
|
||||
setComboText(coTiInAct1,config->readEntry("CommandInactiveTitlebar1","Activate and raise").toAscii());
|
||||
setComboText(coTiInAct2,config->readEntry("CommandInactiveTitlebar2","Activate and lower").toAscii());
|
||||
setComboText(coTiInAct3,config->readEntry("CommandInactiveTitlebar3","Operations menu").toAscii());
|
||||
}
|
||||
|
||||
void KTitleBarActionsConfig::save()
|
||||
|
@ -591,7 +595,9 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config,
|
|||
: KCModule(inst, parent), config(_config), standAlone(_standAlone)
|
||||
{
|
||||
QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3, strAllW;
|
||||
QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(KDialog::spacingHint());
|
||||
Q3Grid *grid;
|
||||
Q3GroupBox *box;
|
||||
QLabel *label;
|
||||
|
@ -652,19 +658,19 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config,
|
|||
<< i18n("Activate & Raise");
|
||||
|
||||
QComboBox* combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coWin1 = combo;
|
||||
combo->setWhatsThis( strWin1 );
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coWin2 = combo;
|
||||
combo->setWhatsThis( strWin2 );
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coWin3 = combo;
|
||||
combo->setWhatsThis( strWin3 );
|
||||
|
@ -721,8 +727,8 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config,
|
|||
|
||||
// Combo's
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertItem(i18n("Meta"));
|
||||
combo->insertItem(i18n("Alt"));
|
||||
combo->addItem(i18n("Meta"));
|
||||
combo->addItem(i18n("Alt"));
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coAllKey = combo;
|
||||
combo->setWhatsThis( strAllKey );
|
||||
|
@ -738,31 +744,31 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config,
|
|||
<< i18n("Nothing");
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coAll1 = combo;
|
||||
combo->setWhatsThis( strAll1 );
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coAll2 = combo;
|
||||
combo->setWhatsThis( strAll2 );
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertStringList(items);
|
||||
combo->addItems(items);
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coAll3 = combo;
|
||||
combo->setWhatsThis( strAll3 );
|
||||
|
||||
combo = new QComboBox(grid);
|
||||
combo->insertItem(i18n("Raise/Lower"));
|
||||
combo->insertItem(i18n("Shade/Unshade"));
|
||||
combo->insertItem(i18n("Maximize/Restore"));
|
||||
combo->insertItem(i18n("Keep Above/Below"));
|
||||
combo->insertItem(i18n("Move to Previous/Next Desktop"));
|
||||
combo->insertItem(i18n("Change Opacity"));
|
||||
combo->insertItem(i18n("Nothing"));
|
||||
combo->addItem(i18n("Raise/Lower"));
|
||||
combo->addItem(i18n("Shade/Unshade"));
|
||||
combo->addItem(i18n("Maximize/Restore"));
|
||||
combo->addItem(i18n("Keep Above/Below"));
|
||||
combo->addItem(i18n("Move to Previous/Next Desktop"));
|
||||
combo->addItem(i18n("Change Opacity"));
|
||||
combo->addItem(i18n("Nothing"));
|
||||
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
|
||||
coAllW = combo;
|
||||
combo->setWhatsThis( strAllW );
|
||||
|
@ -815,14 +821,14 @@ const char* KWindowActionsConfig::functionAllW(int i)
|
|||
void KWindowActionsConfig::load()
|
||||
{
|
||||
config->setGroup( "MouseBindings");
|
||||
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());
|
||||
setComboText(coAllW,config->readEntry("CommandAllWheel","Nothing").ascii());
|
||||
setComboText(coWin1,config->readEntry("CommandWindow1","Activate, raise and pass click").toAscii());
|
||||
setComboText(coWin2,config->readEntry("CommandWindow2","Activate and pass click").toAscii());
|
||||
setComboText(coWin3,config->readEntry("CommandWindow3","Activate and pass click").toAscii());
|
||||
setComboText(coAllKey,config->readEntry("CommandAllKey","Alt").toAscii());
|
||||
setComboText(coAll1,config->readEntry("CommandAll1","Move").toAscii());
|
||||
setComboText(coAll2,config->readEntry("CommandAll2","Toggle raise and lower").toAscii());
|
||||
setComboText(coAll3,config->readEntry("CommandAll3","Resize").toAscii());
|
||||
setComboText(coAllW,config->readEntry("CommandAllWheel","Nothing").toAscii());
|
||||
}
|
||||
|
||||
void KWindowActionsConfig::save()
|
||||
|
|
|
@ -108,7 +108,9 @@ KFocusConfig::KFocusConfig (bool _standAlone, KConfig *_config, KInstance *inst,
|
|||
: KCModule(inst, parent), config(_config), standAlone(_standAlone)
|
||||
{
|
||||
QString wtstr;
|
||||
QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint());
|
||||
QBoxLayout *lay = new QVBoxLayout(this);
|
||||
lay->setMargin(0);
|
||||
lay->setSpacing(KDialog::spacingHint());
|
||||
|
||||
//iTLabel = new QLabel(i18n(" Allowed overlap:\n"
|
||||
// "(% of desktop space)"),
|
||||
|
@ -127,17 +129,20 @@ KFocusConfig::KFocusConfig (bool _standAlone, KConfig *_config, KInstance *inst,
|
|||
fcsBox = new Q3ButtonGroup(i18n("Focus"),this);
|
||||
fcsBox->setColumnLayout( 0, Qt::Horizontal );
|
||||
|
||||
QBoxLayout *fLay = new QVBoxLayout(fcsBox->layout(),
|
||||
KDialog::spacingHint());
|
||||
QBoxLayout *fLay = new QVBoxLayout();
|
||||
fLay->setSpacing(KDialog::spacingHint());
|
||||
fcsBox->layout()->addItem( fLay );
|
||||
|
||||
QBoxLayout *cLay = new QHBoxLayout(fLay);
|
||||
QBoxLayout *cLay = new QHBoxLayout();
|
||||
fLay->addLayout( cLay );
|
||||
QLabel *fLabel = new QLabel(i18n("&Policy:"), fcsBox);
|
||||
cLay->addWidget(fLabel, 0);
|
||||
focusCombo = new QComboBox(false, fcsBox);
|
||||
focusCombo->insertItem(i18n("Click to Focus"), CLICK_TO_FOCUS);
|
||||
focusCombo->insertItem(i18n("Focus Follows Mouse"), FOCUS_FOLLOWS_MOUSE);
|
||||
focusCombo->insertItem(i18n("Focus Under Mouse"), FOCUS_UNDER_MOUSE);
|
||||
focusCombo->insertItem(i18n("Focus Strictly Under Mouse"), FOCUS_STRICTLY_UNDER_MOUSE);
|
||||
focusCombo = new QComboBox(fcsBox);
|
||||
focusCombo->setEditable( false );
|
||||
focusCombo->addItem(i18n("Click to Focus"), CLICK_TO_FOCUS);
|
||||
focusCombo->addItem(i18n("Focus Follows Mouse"), FOCUS_FOLLOWS_MOUSE);
|
||||
focusCombo->addItem(i18n("Focus Under Mouse"), FOCUS_UNDER_MOUSE);
|
||||
focusCombo->addItem(i18n("Focus Strictly Under Mouse"), FOCUS_STRICTLY_UNDER_MOUSE);
|
||||
cLay->addWidget(focusCombo,1 ,Qt::AlignLeft);
|
||||
fLabel->setBuddy(focusCombo);
|
||||
|
||||
|
@ -218,7 +223,9 @@ KFocusConfig::KFocusConfig (bool _standAlone, KConfig *_config, KInstance *inst,
|
|||
|
||||
kbdBox = new Q3ButtonGroup(i18n("Navigation"), this);
|
||||
kbdBox->setColumnLayout( 0, Qt::Horizontal );
|
||||
QVBoxLayout *kLay = new QVBoxLayout(kbdBox->layout(), KDialog::spacingHint());
|
||||
QVBoxLayout *kLay = new QVBoxLayout();
|
||||
kLay->setSpacing(KDialog::spacingHint());
|
||||
kbdBox->layout()->addItem( kLay );
|
||||
|
||||
altTabPopup = new QCheckBox( i18n("Show window list while switching windows"), kbdBox );
|
||||
kLay->addWidget( altTabPopup );
|
||||
|
@ -522,7 +529,9 @@ KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, KInstance
|
|||
: KCModule(inst, parent), config(_config), standAlone(_standAlone)
|
||||
{
|
||||
QString wtstr;
|
||||
QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint());
|
||||
QBoxLayout *lay = new QVBoxLayout (this);
|
||||
lay->setMargin(0);
|
||||
lay->setSpacing(KDialog::spacingHint());
|
||||
|
||||
//iTLabel = new QLabel(i18n(" Allowed overlap:\n"
|
||||
// "(% of desktop space)"),
|
||||
|
@ -593,14 +602,16 @@ KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, KInstance
|
|||
|
||||
lay->addWidget(electricBox);
|
||||
|
||||
QHBoxLayout* focusStealingLayout = new QHBoxLayout( lay,KDialog::spacingHint());
|
||||
QHBoxLayout* focusStealingLayout = new QHBoxLayout();
|
||||
focusStealingLayout->setSpacing(KDialog::spacingHint());
|
||||
lay->addLayout( focusStealingLayout );
|
||||
QLabel* focusStealingLabel = new QLabel( i18n( "Focus stealing prevention level:" ), this );
|
||||
focusStealing = new QComboBox( this );
|
||||
focusStealing->insertItem( i18nc( "Focus Stealing Prevention Level", "None" ));
|
||||
focusStealing->insertItem( i18nc( "Focus Stealing Prevention Level", "Low" ));
|
||||
focusStealing->insertItem( i18nc( "Focus Stealing Prevention Level", "Normal" ));
|
||||
focusStealing->insertItem( i18nc( "Focus Stealing Prevention Level", "High" ));
|
||||
focusStealing->insertItem( i18nc( "Focus Stealing Prevention Level", "Extreme" ));
|
||||
focusStealing->addItem( i18nc( "Focus Stealing Prevention Level", "None" ));
|
||||
focusStealing->addItem( i18nc( "Focus Stealing Prevention Level", "Low" ));
|
||||
focusStealing->addItem( i18nc( "Focus Stealing Prevention Level", "Normal" ));
|
||||
focusStealing->addItem( i18nc( "Focus Stealing Prevention Level", "High" ));
|
||||
focusStealing->addItem( i18nc( "Focus Stealing Prevention Level", "Extreme" ));
|
||||
focusStealingLabel->setBuddy( focusStealing );
|
||||
focusStealingLayout->addWidget( focusStealingLabel );
|
||||
focusStealingLayout->addWidget( focusStealing, Qt::AlignLeft );
|
||||
|
@ -780,12 +791,16 @@ KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, KInstance *ins
|
|||
: KCModule(inst, parent), config(_config), standAlone(_standAlone)
|
||||
{
|
||||
QString wtstr;
|
||||
QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint());
|
||||
QBoxLayout *lay = new QVBoxLayout (this);
|
||||
lay->setMargin(0);
|
||||
lay->setSpacing(KDialog::spacingHint());
|
||||
|
||||
windowsBox = new Q3ButtonGroup(i18n("Windows"), this);
|
||||
windowsBox->setColumnLayout( 0, Qt::Horizontal );
|
||||
|
||||
QBoxLayout *wLay = new QVBoxLayout (windowsBox->layout(), KDialog::spacingHint());
|
||||
QBoxLayout *wLay = new QVBoxLayout ();
|
||||
wLay->setSpacing(KDialog::spacingHint());
|
||||
windowsBox->layout()->addItem( wLay );
|
||||
|
||||
QBoxLayout *bLay = new QVBoxLayout;
|
||||
wLay->addLayout(bLay);
|
||||
|
@ -809,10 +824,10 @@ KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, KInstance *ins
|
|||
" to the top-left corner of the screen is displayed together with"
|
||||
" its size."));
|
||||
|
||||
QGridLayout *rLay = new QGridLayout(2,3);
|
||||
QGridLayout *rLay = new QGridLayout();
|
||||
bLay->addLayout(rLay);
|
||||
rLay->setColStretch(0,0);
|
||||
rLay->setColStretch(1,1);
|
||||
rLay->setColumnStretch(0,0);
|
||||
rLay->setColumnStretch(1,1);
|
||||
|
||||
minimizeAnimOn = new QCheckBox(i18n("Animate minimi&ze and restore"),
|
||||
windowsBox);
|
||||
|
@ -820,10 +835,14 @@ KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, KInstance *ins
|
|||
" windows are minimized or restored." ) );
|
||||
rLay->addWidget(minimizeAnimOn,0,0);
|
||||
|
||||
minimizeAnimSlider = new QSlider(0,10,10,0,Qt::Horizontal, windowsBox);
|
||||
minimizeAnimSlider->setSteps(1, 1);
|
||||
minimizeAnimSlider->setTickmarks(QSlider::TicksBelow);
|
||||
rLay->addMultiCellWidget(minimizeAnimSlider,0,0,1,2);
|
||||
minimizeAnimSlider = new QSlider(windowsBox);
|
||||
minimizeAnimSlider->setRange( 0, 10 );
|
||||
minimizeAnimSlider->setSingleStep( 1 );
|
||||
minimizeAnimSlider->setPageStep( 1 );
|
||||
minimizeAnimSlider->setValue( 0 );
|
||||
minimizeAnimSlider->setOrientation( Qt::Horizontal );
|
||||
minimizeAnimSlider->setTickPosition(QSlider::TicksBelow);
|
||||
rLay->addWidget(minimizeAnimSlider,0,0,1,2);
|
||||
|
||||
connect(minimizeAnimOn, SIGNAL(toggled(bool)), this, SLOT(setMinimizeAnim(bool)));
|
||||
connect(minimizeAnimSlider, SIGNAL(valueChanged(int)), this, SLOT(setMinimizeAnimSpeed(int)));
|
||||
|
@ -848,20 +867,22 @@ KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, KInstance *ins
|
|||
" and allows you to move or resize them,"
|
||||
" just like for normal windows"));
|
||||
|
||||
QBoxLayout *vLay = new QHBoxLayout(bLay);
|
||||
QBoxLayout *vLay = new QHBoxLayout();
|
||||
bLay->addLayout( vLay );
|
||||
|
||||
QLabel *plcLabel = new QLabel(i18n("&Placement:"),windowsBox);
|
||||
|
||||
placementCombo = new QComboBox(false, windowsBox);
|
||||
placementCombo->insertItem(i18n("Smart"), SMART_PLACEMENT);
|
||||
placementCombo->insertItem(i18n("Maximizing"), MAXIMIZING_PLACEMENT);
|
||||
placementCombo->insertItem(i18n("Cascade"), CASCADE_PLACEMENT);
|
||||
placementCombo->insertItem(i18n("Random"), RANDOM_PLACEMENT);
|
||||
placementCombo->insertItem(i18n("Centered"), CENTERED_PLACEMENT);
|
||||
placementCombo->insertItem(i18n("Zero-Cornered"), ZEROCORNERED_PLACEMENT);
|
||||
placementCombo = new QComboBox(windowsBox);
|
||||
placementCombo->setEditable( false );
|
||||
placementCombo->addItem(i18n("Smart"), SMART_PLACEMENT);
|
||||
placementCombo->addItem(i18n("Maximizing"), MAXIMIZING_PLACEMENT);
|
||||
placementCombo->addItem(i18n("Cascade"), CASCADE_PLACEMENT);
|
||||
placementCombo->addItem(i18n("Random"), RANDOM_PLACEMENT);
|
||||
placementCombo->addItem(i18n("Centered"), CENTERED_PLACEMENT);
|
||||
placementCombo->addItem(i18n("Zero-Cornered"), ZEROCORNERED_PLACEMENT);
|
||||
// CT: disabling is needed as long as functionality misses in kwin
|
||||
//placementCombo->insertItem(i18n("Interactive"), INTERACTIVE_PLACEMENT);
|
||||
//placementCombo->insertItem(i18n("Manual"), MANUAL_PLACEMENT);
|
||||
//placementCombo->addItem(i18n("Interactive"), INTERACTIVE_PLACEMENT);
|
||||
//placementCombo->addItem(i18n("Manual"), MANUAL_PLACEMENT);
|
||||
placementCombo->setCurrentIndex(SMART_PLACEMENT);
|
||||
|
||||
// FIXME, when more policies have been added to KWin
|
||||
|
@ -1243,7 +1264,9 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
|
|||
{
|
||||
QTabWidget *tabW = new QTabWidget(this);
|
||||
QWidget *tGroup = new QWidget(tabW);
|
||||
QVBoxLayout *vLay = new QVBoxLayout (tGroup,KDialog::marginHint(), KDialog::spacingHint());
|
||||
QVBoxLayout *vLay = new QVBoxLayout (tGroup);
|
||||
vLay->setMargin(KDialog::marginHint());
|
||||
vLay->setSpacing(KDialog::spacingHint());
|
||||
vLay->addSpacing(11); // to get the proper gb top offset
|
||||
|
||||
onlyDecoTranslucent = new QCheckBox(i18n("Apply translucency only to decoration"),tGroup);
|
||||
|
@ -1251,8 +1274,10 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
|
|||
|
||||
vLay->addSpacing(11);
|
||||
|
||||
QGridLayout *gLay = new QGridLayout(vLay,4,2,KDialog::spacingHint());
|
||||
gLay->setColStretch(1,1);
|
||||
QGridLayout *gLay = new QGridLayout();
|
||||
gLay->setSpacing(KDialog::spacingHint());
|
||||
gLay->setColumnStretch(1,1);
|
||||
vLay->addLayout( gLay );
|
||||
|
||||
activeWindowTransparency = new QCheckBox(i18n("Active windows:"),tGroup);
|
||||
gLay->addWidget(activeWindowTransparency,0,0);
|
||||
|
@ -1295,15 +1320,18 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
|
|||
|
||||
QWidget *sGroup = new QWidget(tabW);
|
||||
// sGroup->setCheckable(true);
|
||||
QVBoxLayout *vLay2 = new QVBoxLayout (sGroup,11,6);
|
||||
QVBoxLayout *vLay2 = new QVBoxLayout (sGroup);
|
||||
vLay2->setMargin(11);
|
||||
vLay2->setSpacing(6);
|
||||
vLay2->addSpacing(11); // to get the proper gb top offset
|
||||
useShadows = new QCheckBox(i18n("Use shadows"),sGroup);
|
||||
vLay2->addWidget(useShadows);
|
||||
|
||||
vLay2->addSpacing(11);
|
||||
|
||||
QGridLayout *gLay2 = new QGridLayout(vLay2,6,2);
|
||||
gLay2->setColStretch(1,1);
|
||||
QGridLayout *gLay2 = new QGridLayout();
|
||||
gLay2->setColumnStretch(1,1);
|
||||
vLay2->addLayout( gLay2 );
|
||||
|
||||
QLabel *label1 = new QLabel(i18n("Active window size:"),sGroup);
|
||||
gLay2->addWidget(label1,0,0);
|
||||
|
@ -1344,7 +1372,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
|
|||
gLay2->addWidget(label6,5,0);
|
||||
shadowColor = new KColorButton(Qt::black,sGroup);
|
||||
gLay2->addWidget(shadowColor,5,1);
|
||||
gLay2->setColStretch(1,1);
|
||||
gLay2->setColumnStretch(1,1);
|
||||
vLay2->addSpacing(11);
|
||||
removeShadowsOnMove = new QCheckBox(i18n("Remove shadows on move"),sGroup);
|
||||
vLay2->addWidget(removeShadowsOnMove);
|
||||
|
@ -1354,7 +1382,9 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
|
|||
tabW->addTab(sGroup, i18n("Shadows"));
|
||||
|
||||
QWidget *eGroup = new QWidget(this);
|
||||
QVBoxLayout *vLay3 = new QVBoxLayout (eGroup,11,6);
|
||||
QVBoxLayout *vLay3 = new QVBoxLayout (eGroup);
|
||||
vLay3->setMargin( 11 );
|
||||
vLay3->setSpacing( 6 );
|
||||
|
||||
fadeInWindows = new QCheckBox(i18n("Fade-in windows (including popups)"),eGroup);
|
||||
fadeOnOpacityChange = new QCheckBox(i18n("Fade between opacity changes"),eGroup);
|
||||
|
@ -1494,7 +1524,7 @@ void KTranslucencyConfig::load( void )
|
|||
uint r, g, b;
|
||||
r = g = b = 256;
|
||||
|
||||
if (sscanf(hex.latin1(), "0x%02x%02x%02x", &r, &g, &b)!=3 || r > 255 || g > 255 || b > 255)
|
||||
if (sscanf(hex.toLatin1(), "0x%02x%02x%02x", &r, &g, &b)!=3 || r > 255 || g > 255 || b > 255)
|
||||
shadowColor->setColor(Qt::black);
|
||||
else
|
||||
shadowColor->setColor(QColor(r,g,b));
|
||||
|
|
|
@ -46,7 +46,7 @@ DetectWidget::DetectWidget( QWidget* parent, const char* name )
|
|||
}
|
||||
|
||||
DetectDialog::DetectDialog( QWidget* parent, const char* name )
|
||||
: KDialogBase( parent, name, true, "", Ok | Cancel )
|
||||
: KDialogBase( Swallow, 0, parent, name, true, "", Ok | Cancel )
|
||||
, grabber( NULL )
|
||||
{
|
||||
widget = new DetectWidget( this );
|
||||
|
@ -167,7 +167,7 @@ void DetectDialog::selectWindow()
|
|||
// use a dialog, so that all user input is blocked
|
||||
// use WX11BypassWM and moving away so that it's not actually visible
|
||||
// grab only mouse, so that keyboard can be used e.g. for switching windows
|
||||
grabber = new QDialog( NULL, NULL, true, Qt::WX11BypassWM );
|
||||
grabber = new QDialog( 0, Qt::WX11BypassWM );
|
||||
grabber->move( -1000, -1000 );
|
||||
grabber->show();
|
||||
grabber->grabMouse( Qt::CrossCursor );
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "ruleslist.h"
|
||||
|
||||
extern "C"
|
||||
KDE_EXPORT KCModule *create_kwinrules( QWidget *parent, const char *name )
|
||||
KDE_EXPORT KCModule *create_kwinrules( QWidget *parent, const char* )
|
||||
{
|
||||
KInstance *inst = new KInstance("kcmkwinrules");
|
||||
return new KWinInternal::KCMRules( inst, parent );
|
||||
|
|
|
@ -249,9 +249,9 @@ static int edit( Window wid, bool whole_app )
|
|||
}
|
||||
else if( edited_rule != orig_rule )
|
||||
{
|
||||
QList< Rules* >::Iterator pos = rules.find( orig_rule );
|
||||
if( pos != rules.end())
|
||||
*pos = edited_rule;
|
||||
int pos = rules.indexOf( orig_rule );
|
||||
if( pos != -1)
|
||||
rules[ pos ] = edited_rule;
|
||||
else
|
||||
rules.prepend( edited_rule );
|
||||
delete orig_rule;
|
||||
|
|
|
@ -113,8 +113,8 @@ RulesWidget::RulesWidget( QWidget* parent )
|
|||
for( i = 1;
|
||||
i <= module.numberOfDesktops();
|
||||
++i )
|
||||
desktop->insertItem( QString::number( i ).rightJustified( 2 ) + ":" + module.desktopName( i ));
|
||||
desktop->insertItem( i18n( "All Desktops" ));
|
||||
desktop->addItem( QString::number( i ).rightJustified( 2 ) + ":" + module.desktopName( i ));
|
||||
desktop->addItem( i18n( "All Desktops" ));
|
||||
}
|
||||
|
||||
#undef SETUP
|
||||
|
@ -673,7 +673,7 @@ bool RulesWidget::finalCheck()
|
|||
|
||||
void RulesWidget::prepareWindowSpecific( WId window )
|
||||
{
|
||||
tabs->setCurrentPage( 2 ); // geometry tab, skip tabs for window identification
|
||||
tabs->setCurrentIndex( 2 ); // geometry tab, skip tabs for window identification
|
||||
KWin::WindowInfo info( window, -1U, -1U ); // read everything
|
||||
prefillUnusedValues( info );
|
||||
}
|
||||
|
@ -687,7 +687,7 @@ void RulesWidget::shortcutEditClicked()
|
|||
}
|
||||
|
||||
RulesDialog::RulesDialog( QWidget* parent, const char* name )
|
||||
: KDialogBase( parent, name, true, i18n( "Edit Window-Specific Settings" ), Ok | Cancel )
|
||||
: KDialogBase( Swallow, 0, parent, name, true, i18n( "Edit Window-Specific Settings" ), Ok | Cancel )
|
||||
{
|
||||
widget = new RulesWidget( this );
|
||||
setMainWidget( widget );
|
||||
|
@ -746,7 +746,7 @@ void EditShortcut::clearShortcut()
|
|||
}
|
||||
|
||||
EditShortcutDialog::EditShortcutDialog( QWidget* parent, const char* name )
|
||||
: KDialogBase( parent, name, true, i18n( "Edit Shortcut" ), Ok | Cancel )
|
||||
: KDialogBase( Swallow, 0, parent, name, true, i18n( "Edit Shortcut" ), Ok | Cancel )
|
||||
{
|
||||
widget = new EditShortcut( this );
|
||||
setMainWidget( widget );
|
||||
|
|
|
@ -78,7 +78,7 @@ unsigned long KDecorationOptionsPrivate::updateKWinSettings( KConfig* config )
|
|||
|
||||
QPalette appPal = QApplication::palette();
|
||||
// normal colors
|
||||
colors[ColorFrame] = appPal.active().background();
|
||||
colors[ColorFrame] = appPal.color( QPalette::Active, QPalette::Background );
|
||||
colors[ColorFrame] = config->readEntry("frame", colors[ColorFrame]);
|
||||
colors[ColorHandle] = colors[ColorFrame];
|
||||
colors[ColorHandle] = config->readEntry("handle", colors[ColorHandle]);
|
||||
|
@ -90,7 +90,7 @@ unsigned long KDecorationOptionsPrivate::updateKWinSettings( KConfig* config )
|
|||
colors[ColorButtonBg] = colors[ColorFrame];
|
||||
colors[ColorButtonBg] = config->readEntry("activeTitleBtnBg",
|
||||
colors[ColorFrame]);
|
||||
colors[ColorTitleBar] = appPal.active().highlight();
|
||||
colors[ColorTitleBar] = appPal.color( QPalette::Active, QPalette::Highlight );
|
||||
colors[ColorTitleBar] = config->readEntry("activeBackground",
|
||||
colors[ColorTitleBar]);
|
||||
if(QPixmap::defaultDepth() > 8)
|
||||
|
@ -100,7 +100,7 @@ unsigned long KDecorationOptionsPrivate::updateKWinSettings( KConfig* config )
|
|||
colors[ColorTitleBlend] = config->readEntry("activeBlend",
|
||||
colors[ColorTitleBlend]);
|
||||
|
||||
colors[ColorFont] = appPal.active().highlightedText();
|
||||
colors[ColorFont] = appPal.color( QPalette::Active, QPalette::HighlightedText );
|
||||
colors[ColorFont] = config->readEntry("activeForeground", colors[ColorFont]);
|
||||
|
||||
// inactive
|
||||
|
|
|
@ -37,8 +37,10 @@ namespace KWinInternal
|
|||
{
|
||||
|
||||
PopupInfo::PopupInfo( const char *name )
|
||||
: QWidget( 0, name )
|
||||
: QWidget( 0 )
|
||||
{
|
||||
setObjectName( name );
|
||||
|
||||
m_infoString = "";
|
||||
m_shown = false;
|
||||
reset();
|
||||
|
@ -98,7 +100,7 @@ void PopupInfo::paintContents()
|
|||
QPainter p( this );
|
||||
QRect r( 6, 6, width()-12, height()-12 );
|
||||
|
||||
p.fillRect( r, colorGroup().brush( QColorGroup::Background ) );
|
||||
p.fillRect( r, palette().brush( QPalette::Background ) );
|
||||
|
||||
/*
|
||||
p.setPen(Qt::white);
|
||||
|
|
10
rules.cpp
10
rules.cpp
|
@ -117,13 +117,13 @@ static int limit0to4( int i ) { return qMax( 0, qMin( 4, i )); }
|
|||
void Rules::readFromCfg( KConfig& cfg )
|
||||
{
|
||||
description = cfg.readEntry( "description" );
|
||||
READ_MATCH_STRING( wmclass, .toLower().latin1() );
|
||||
READ_MATCH_STRING( wmclass, .toLower().toLatin1() );
|
||||
wmclasscomplete = cfg.readEntry( "wmclasscomplete" , QVariant(false)).toBool();
|
||||
READ_MATCH_STRING( windowrole, .toLower().latin1() );
|
||||
READ_MATCH_STRING( windowrole, .toLower().toLatin1() );
|
||||
READ_MATCH_STRING( title, );
|
||||
READ_MATCH_STRING( extrarole, .toLower().latin1() );
|
||||
READ_MATCH_STRING( clientmachine, .toLower().latin1() );
|
||||
types = cfg.readUnsignedLongNumEntry( "types", NET::AllTypesMask );
|
||||
READ_MATCH_STRING( extrarole, .toLower().toLatin1() );
|
||||
READ_MATCH_STRING( clientmachine, .toLower().toLatin1() );
|
||||
types = cfg.readEntry( "types", NET::AllTypesMask ).toULongLong();
|
||||
READ_FORCE_RULE2( placement,QString(), Placement::policyFromString,false );
|
||||
READ_SET_RULE_DEF( position, , invalidPoint );
|
||||
READ_SET_RULE( size,, QSize());
|
||||
|
|
14
sm.cpp
14
sm.cpp
|
@ -157,12 +157,12 @@ void Workspace::loadSessionInfo()
|
|||
QString n = QString::number(i);
|
||||
SessionInfo* info = new SessionInfo;
|
||||
session.append( info );
|
||||
info->sessionId = config->readEntry( QString("sessionId")+n, QString() ).latin1();
|
||||
info->windowRole = config->readEntry( QString("windowRole")+n, QString() ).latin1();
|
||||
info->wmCommand = config->readEntry( QString("wmCommand")+n, QString() ).latin1();
|
||||
info->wmClientMachine = config->readEntry( QString("wmClientMachine")+n, QString() ).latin1();
|
||||
info->resourceName = config->readEntry( QString("resourceName")+n, QString() ).latin1();
|
||||
info->resourceClass = config->readEntry( QString("resourceClass")+n, QString() ).toLower().latin1();
|
||||
info->sessionId = config->readEntry( QString("sessionId")+n, QString() ).toLatin1();
|
||||
info->windowRole = config->readEntry( QString("windowRole")+n, QString() ).toLatin1();
|
||||
info->wmCommand = config->readEntry( QString("wmCommand")+n, QString() ).toLatin1();
|
||||
info->wmClientMachine = config->readEntry( QString("wmClientMachine")+n, QString() ).toLatin1();
|
||||
info->resourceName = config->readEntry( QString("resourceName")+n, QString() ).toLatin1();
|
||||
info->resourceClass = config->readEntry( QString("resourceClass")+n, QString() ).toLower().toLatin1();
|
||||
info->geometry = config->readEntry( QString("geometry")+n,QRect() );
|
||||
info->restore = config->readEntry( QString("restore")+n,QRect() );
|
||||
info->fsrestore = config->readEntry( QString("fsrestore")+n,QRect() );
|
||||
|
@ -177,7 +177,7 @@ void Workspace::loadSessionInfo()
|
|||
info->skipTaskbar = config->readEntry( QString("skipTaskbar")+n, false );
|
||||
info->skipPager = config->readEntry( QString("skipPager")+n, false );
|
||||
info->userNoBorder = config->readEntry( QString("userNoBorder")+n, false );
|
||||
info->windowType = txtToWindowType( config->readEntry( QString("windowType")+n, QString() ).latin1());
|
||||
info->windowType = txtToWindowType( config->readEntry( QString("windowType")+n, QString() ).toLatin1());
|
||||
info->shortcut = config->readEntry( QString("shortcut")+n, QString() );
|
||||
info->active = ( active_client == i );
|
||||
}
|
||||
|
|
66
tabbox.cpp
66
tabbox.cpp
|
@ -329,7 +329,7 @@ void TabBox::drawContents( QPainter * )
|
|||
pix.fill(this, 0, 0);
|
||||
|
||||
QPainter p;
|
||||
p.begin(&pix, this);
|
||||
p.begin(&pix);
|
||||
|
||||
QPixmap* menu_pix = kwin_get_menu_pix_hack();
|
||||
|
||||
|
@ -356,7 +356,7 @@ void TabBox::drawContents( QPainter * )
|
|||
{
|
||||
// draw highlight background
|
||||
if ( (*it) == currentClient() )
|
||||
p.fillRect(x, y, r.width(), lineHeight, colorGroup().highlight());
|
||||
p.fillRect(x, y, r.width(), lineHeight, palette().brush( QPalette::Highlight ));
|
||||
|
||||
// draw icon
|
||||
QPixmap icon;
|
||||
|
@ -393,11 +393,11 @@ void TabBox::drawContents( QPainter * )
|
|||
|
||||
// draw text
|
||||
if ( (*it) == currentClient() )
|
||||
p.setPen(colorGroup().highlightedText());
|
||||
p.setPen(palette().color( QPalette::HighlightedText ));
|
||||
else if( (*it)->isMinimized())
|
||||
{
|
||||
QColor c1 = colorGroup().text();
|
||||
QColor c2 = colorGroup().background();
|
||||
QColor c1 = palette().color( QPalette::Text );
|
||||
QColor c2 = palette().color( QPalette::Background );
|
||||
// from kicker's TaskContainer::blendColors()
|
||||
int r1, g1, b1;
|
||||
int r2, g2, b2;
|
||||
|
@ -412,7 +412,7 @@ void TabBox::drawContents( QPainter * )
|
|||
p.setPen(QColor( r1, g1, b1 ));
|
||||
}
|
||||
else
|
||||
p.setPen(colorGroup().text());
|
||||
p.setPen(palette().color( QPalette::Text ));
|
||||
|
||||
p.drawText(x+5 + iconWidth + 8, y, r.width() - 5 - iconWidth - 8, lineHeight,
|
||||
Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine, s);
|
||||
|
@ -450,13 +450,13 @@ void TabBox::drawContents( QPainter * )
|
|||
{
|
||||
// draw highlight background
|
||||
if ( iDesktop == desk ) // current desktop
|
||||
p.fillRect(x, y, r.width(), lineHeight, colorGroup().highlight());
|
||||
p.fillRect(x, y, r.width(), lineHeight, palette().brush( QPalette::Highlight ));
|
||||
|
||||
p.save();
|
||||
|
||||
// draw "icon" (here: number of desktop)
|
||||
p.fillRect(x+5, y+2, iconWidth, iconHeight, colorGroup().base());
|
||||
p.setPen(colorGroup().text());
|
||||
p.fillRect(x+5, y+2, iconWidth, iconHeight, palette().brush( QPalette::Base ));
|
||||
p.setPen(palette().color( QPalette::Text ));
|
||||
p.drawRect(x+5, y+2, iconWidth, iconHeight);
|
||||
|
||||
// draw desktop-number
|
||||
|
@ -468,9 +468,9 @@ void TabBox::drawContents( QPainter * )
|
|||
|
||||
// draw desktop name text
|
||||
if ( iDesktop == desk )
|
||||
p.setPen(colorGroup().highlightedText());
|
||||
p.setPen(palette().color( QPalette::HighlightedText ));
|
||||
else
|
||||
p.setPen(colorGroup().text());
|
||||
p.setPen(palette().color( QPalette::Text ));
|
||||
|
||||
p.drawText(x+5 + iconWidth + 8, y, r.width() - 5 - iconWidth - 8, lineHeight,
|
||||
Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine,
|
||||
|
@ -505,7 +505,9 @@ void TabBox::drawContents( QPainter * )
|
|||
}
|
||||
}
|
||||
p.end();
|
||||
bitBlt(this, r.x(), r.y(), &pix);
|
||||
|
||||
QPainter localPainter( this );
|
||||
localPainter.drawImage( QPoint( r.x(), r.y() ), pix.toImage() );
|
||||
}
|
||||
|
||||
void TabBox::hide()
|
||||
|
@ -1168,13 +1170,13 @@ Client* Workspace::nextFocusChainClient( Client* c ) const
|
|||
{
|
||||
if ( global_focus_chain.isEmpty() )
|
||||
return 0;
|
||||
ClientList::ConstIterator it = global_focus_chain.find( c );
|
||||
if ( it == global_focus_chain.end() )
|
||||
int pos = global_focus_chain.indexOf( c );
|
||||
if ( pos == -1 )
|
||||
return global_focus_chain.last();
|
||||
if ( it == global_focus_chain.begin() )
|
||||
if ( pos == 0 )
|
||||
return global_focus_chain.last();
|
||||
--it;
|
||||
return *it;
|
||||
pos--;
|
||||
return global_focus_chain[ pos ];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -1185,13 +1187,13 @@ Client* Workspace::previousFocusChainClient( Client* c ) const
|
|||
{
|
||||
if ( global_focus_chain.isEmpty() )
|
||||
return 0;
|
||||
ClientList::ConstIterator it = global_focus_chain.find( c );
|
||||
if ( it == global_focus_chain.end() )
|
||||
int pos = global_focus_chain.indexOf( c );
|
||||
if ( pos == -1 )
|
||||
return global_focus_chain.first();
|
||||
++it;
|
||||
if ( it == global_focus_chain.end() )
|
||||
pos++;
|
||||
if ( pos == global_focus_chain.count() )
|
||||
return global_focus_chain.first();
|
||||
return *it;
|
||||
return global_focus_chain[ pos ];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -1202,13 +1204,13 @@ Client* Workspace::nextStaticClient( Client* c ) const
|
|||
{
|
||||
if ( !c || clients.isEmpty() )
|
||||
return 0;
|
||||
ClientList::ConstIterator it = clients.find( c );
|
||||
if ( it == clients.end() )
|
||||
int pos = clients.indexOf( c );
|
||||
if ( pos == -1 )
|
||||
return clients.first();
|
||||
++it;
|
||||
if ( it == clients.end() )
|
||||
++pos;
|
||||
if ( pos == clients.count() )
|
||||
return clients.first();
|
||||
return *it;
|
||||
return clients[ pos ];
|
||||
}
|
||||
/*!
|
||||
auxiliary functions to travers all clients according the static
|
||||
|
@ -1218,13 +1220,13 @@ Client* Workspace::previousStaticClient( Client* c ) const
|
|||
{
|
||||
if ( !c || clients.isEmpty() )
|
||||
return 0;
|
||||
ClientList::ConstIterator it = clients.find( c );
|
||||
if ( it == clients.end() )
|
||||
int pos = clients.indexOf( c );
|
||||
if ( pos == -1 )
|
||||
return clients.last();
|
||||
if ( it == clients.begin() )
|
||||
if ( pos == 0 )
|
||||
return clients.last();
|
||||
--it;
|
||||
return *it;
|
||||
--pos;
|
||||
return clients[ pos ];
|
||||
}
|
||||
|
||||
bool Workspace::establishTabBoxGrab()
|
||||
|
|
199
useractions.cpp
199
useractions.cpp
|
@ -54,62 +54,117 @@ QMenu* Workspace::clientPopup()
|
|||
popup = new QMenu;
|
||||
popup->setFont(KGlobalSettings::menuFont());
|
||||
connect( popup, SIGNAL( aboutToShow() ), this, SLOT( clientPopupAboutToShow() ) );
|
||||
connect( popup, SIGNAL( activated(int) ), this, SLOT( clientPopupActivated(int) ) );
|
||||
|
||||
connect( popup, SIGNAL( triggered(QAction*) ), this, SLOT( clientPopupActivated(QAction*) ) );
|
||||
|
||||
advanced_popup = new QMenu( popup );
|
||||
advanced_popup->setFont(KGlobalSettings::menuFont());
|
||||
connect( advanced_popup, SIGNAL( activated(int) ), this, SLOT( clientPopupActivated(int) ) );
|
||||
advanced_popup->insertItem( SmallIconSet( "up" ),
|
||||
i18n("Keep &Above Others")+'\t'+keys->action("Window Above Other Windows")->shortcut().seq(0).toString(), Options::KeepAboveOp );
|
||||
advanced_popup->insertItem( SmallIconSet( "down" ),
|
||||
i18n("Keep &Below Others")+'\t'+keys->action("Window Below Other Windows")->shortcut().seq(0).toString(), Options::KeepBelowOp );
|
||||
advanced_popup->insertItem( SmallIconSet( "window_fullscreen" ),
|
||||
i18n("&Fullscreen")+'\t'+keys->action("Window Fullscreen")->shortcut().seq(0).toString(), Options::FullScreenOp );
|
||||
advanced_popup->insertItem( i18n("&No Border")+'\t'+keys->action("Window No Border")->shortcut().seq(0).toString(), Options::NoBorderOp );
|
||||
advanced_popup->insertItem( SmallIconSet("key_bindings"),
|
||||
i18n("Window &Shortcut...")+'\t'+keys->action("Setup Window Shortcut")->shortcut().seq(0).toString(), Options::SetupWindowShortcutOp );
|
||||
advanced_popup->insertItem( SmallIconSet( "wizard" ), i18n("&Special Window Settings..."), Options::WindowRulesOp );
|
||||
advanced_popup->insertItem( SmallIconSet( "wizard" ), i18n("&Special Application Settings..."), Options::ApplicationRulesOp );
|
||||
connect( advanced_popup, SIGNAL( triggered(QAction*) ), this, SLOT( clientPopupActivated(QAction*) ) );
|
||||
|
||||
mKeepAboveOpAction = advanced_popup->addAction( i18n("Keep &Above Others") );
|
||||
mKeepAboveOpAction->setIcon( SmallIconSet( "up" ) );
|
||||
mKeepAboveOpAction->setShortcut( keys->action("Window Above Other Windows")->shortcut() );
|
||||
mKeepAboveOpAction->setCheckable( true );
|
||||
mKeepAboveOpAction->setData( Options::KeepAboveOp );
|
||||
|
||||
mKeepBelowOpAction = advanced_popup->addAction( i18n("Keep &Below Others") );
|
||||
mKeepBelowOpAction->setIcon( SmallIconSet( "down" ) );
|
||||
mKeepBelowOpAction->setShortcut( keys->action("Window Below Other Windows")->shortcut() );
|
||||
mKeepBelowOpAction->setCheckable( true );
|
||||
mKeepBelowOpAction->setData( Options::KeepBelowOp );
|
||||
|
||||
mFullScreenOpAction = advanced_popup->addAction( i18n("&Fullscreen") );
|
||||
mFullScreenOpAction->setIcon( SmallIconSet( "window_fullscreen" ) );
|
||||
mFullScreenOpAction->setShortcut( keys->action("Window Fullscreen")->shortcut() );
|
||||
mFullScreenOpAction->setCheckable( true );
|
||||
mFullScreenOpAction->setData( Options::FullScreenOp );
|
||||
|
||||
mNoBorderOpAction = advanced_popup->addAction( i18n("&No Border") );
|
||||
mNoBorderOpAction->setShortcut( keys->action("Window No Border")->shortcut() );
|
||||
mNoBorderOpAction->setCheckable( true );
|
||||
mNoBorderOpAction->setData( Options::NoBorderOp );
|
||||
|
||||
QAction *action = advanced_popup->addAction( i18n("Window &Shortcut...") );
|
||||
action->setIcon( SmallIconSet("key_bindings") );
|
||||
action->setShortcut( keys->action("Setup Window Shortcut")->shortcut() );
|
||||
action->setData( Options::SetupWindowShortcutOp );
|
||||
|
||||
action = advanced_popup->addAction( i18n("&Special Window Settings...") );
|
||||
action->setIcon( SmallIconSet( "wizard" ) );
|
||||
action->setData( Options::WindowRulesOp );
|
||||
|
||||
action = advanced_popup->addAction( i18n("&Special Application Settings...") );
|
||||
action->setIcon( SmallIconSet( "wizard" ) );
|
||||
action->setData( Options::ApplicationRulesOp );
|
||||
|
||||
action = popup->addMenu( advanced_popup );
|
||||
action->setText( i18n("Ad&vanced") );
|
||||
|
||||
desk_popup_index = popup->actions().count();
|
||||
|
||||
popup->insertItem(i18n("Ad&vanced"), advanced_popup );
|
||||
desk_popup_index = popup->count();
|
||||
|
||||
if (options->useTranslucency){
|
||||
QMenu *trans_popup = new QMenu( popup );
|
||||
QVBoxLayout *transLayout = new QVBoxLayout(trans_popup);
|
||||
trans_popup->setLayout( transLayout );
|
||||
transButton = new QPushButton(trans_popup, "transButton");
|
||||
QVBoxLayout *transLayout = new QVBoxLayout(trans_popup);
|
||||
trans_popup->setLayout( transLayout );
|
||||
transButton = new QPushButton(trans_popup);
|
||||
transButton->setObjectName("transButton");
|
||||
transButton->setToolTip( i18n("Reset opacity to default value"));
|
||||
transSlider = new QSlider(0, 100, 1, 100, Qt::Vertical, trans_popup, "transSlider");
|
||||
transSlider = new QSlider(trans_popup);
|
||||
transSlider->setObjectName( "transSlider" );
|
||||
transSlider->setRange( 0, 100 );
|
||||
transSlider->setValue( 100 );
|
||||
transSlider->setOrientation( Qt::Vertical );
|
||||
transSlider->setToolTip( i18n("Slide this to set the window's opacity"));
|
||||
connect(transButton, SIGNAL(clicked()), SLOT(resetClientOpacity()));
|
||||
connect(transButton, SIGNAL(clicked()), trans_popup, SLOT(hide()));
|
||||
connect(transSlider, SIGNAL(valueChanged(int)), SLOT(setTransButtonText(int)));
|
||||
connect(transSlider, SIGNAL(valueChanged(int)), this, SLOT(setPopupClientOpacity(int)));
|
||||
// connect(transSlider, SIGNAL(sliderReleased()), trans_popup, SLOT(hide()));
|
||||
popup->insertItem(i18n("&Opacity"), trans_popup );
|
||||
action = popup->addMenu( trans_popup );
|
||||
action->setText( i18n("&Opacity") );
|
||||
}
|
||||
|
||||
popup->insertItem( SmallIconSet( "move" ), i18n("&Move")+'\t'+keys->action("Window Move")->shortcut().seq(0).toString(), Options::MoveOp );
|
||||
popup->insertItem( i18n("Re&size")+'\t'+keys->action("Window Resize")->shortcut().seq(0).toString(), Options::ResizeOp );
|
||||
popup->insertItem( i18n("Mi&nimize")+'\t'+keys->action("Window Minimize")->shortcut().seq(0).toString(), Options::MinimizeOp );
|
||||
popup->insertItem( i18n("Ma&ximize")+'\t'+keys->action("Window Maximize")->shortcut().seq(0).toString(), Options::MaximizeOp );
|
||||
popup->insertItem( i18n("Sh&ade")+'\t'+keys->action("Window Shade")->shortcut().seq(0).toString(), Options::ShadeOp );
|
||||
|
||||
popup->insertSeparator();
|
||||
mMoveOpAction = popup->addAction( i18n("&Move") );
|
||||
mMoveOpAction->setIcon( SmallIconSet( "move" ) );
|
||||
mMoveOpAction->setShortcut( keys->action("Window Move")->shortcut() );
|
||||
mMoveOpAction->setData( Options::MoveOp );
|
||||
|
||||
mResizeOpAction = popup->addAction( i18n("Re&size") );
|
||||
mResizeOpAction->setShortcut( keys->action("Window Resize")->shortcut() );
|
||||
mResizeOpAction->setData( Options::ResizeOp );
|
||||
|
||||
mMinimizeOpAction = popup->addAction( i18n("Mi&nimize") );
|
||||
mMinimizeOpAction->setShortcut( keys->action("Window Minimize")->shortcut() );
|
||||
mMinimizeOpAction->setData( Options::MinimizeOp );
|
||||
|
||||
mMaximizeOpAction = popup->addAction( i18n("Ma&ximize") );
|
||||
mMaximizeOpAction->setShortcut( keys->action("Window Maximize")->shortcut() );
|
||||
mMaximizeOpAction->setCheckable( true );
|
||||
mMaximizeOpAction->setData( Options::MaximizeOp );
|
||||
|
||||
mShadeOpAction = popup->addAction( i18n("Sh&ade") );
|
||||
mShadeOpAction->setShortcut( keys->action("Window Shade")->shortcut() );
|
||||
mShadeOpAction->setCheckable( true );
|
||||
mShadeOpAction->setData( Options::ShadeOp );
|
||||
|
||||
popup->addSeparator();
|
||||
|
||||
if (!KGlobal::config()->isImmutable() &&
|
||||
!KAuthorized::authorizeControlModules(Workspace::configModules(true)).isEmpty())
|
||||
{
|
||||
popup->insertItem(SmallIconSet( "configure" ), i18n("Configur&e Window Behavior..."), this, SLOT( configureWM() ));
|
||||
popup->insertSeparator();
|
||||
action = popup->addAction( i18n("Configur&e Window Behavior...") );
|
||||
action->setIcon( SmallIconSet( "configure" ) );
|
||||
connect( action, SIGNAL( triggered() ), this, SLOT( configureWM() ) );
|
||||
popup->addSeparator();
|
||||
}
|
||||
|
||||
popup->insertItem( SmallIconSet( "fileclose" ), i18n("&Close")+'\t'+keys->action("Window Close")->shortcut().seq(0).toString(), Options::CloseOp );
|
||||
mCloseOpAction = popup->addAction( i18n("&Close") );
|
||||
mCloseOpAction->setIcon( SmallIconSet( "fileclose" ) );
|
||||
mCloseOpAction->setShortcut( keys->action("Window Close")->shortcut() );
|
||||
mCloseOpAction->setData( Options::CloseOp );
|
||||
}
|
||||
return popup;
|
||||
}
|
||||
|
||||
|
||||
//sets the transparency of the client to given value(given by slider)
|
||||
void Workspace::setPopupClientOpacity(int value)
|
||||
{
|
||||
|
@ -160,21 +215,21 @@ void Workspace::clientPopupAboutToShow()
|
|||
initDesktopPopup();
|
||||
}
|
||||
|
||||
popup->setItemEnabled( Options::ResizeOp, active_popup_client->isResizable() );
|
||||
popup->setItemEnabled( Options::MoveOp, active_popup_client->isMovable() );
|
||||
popup->setItemEnabled( Options::MaximizeOp, active_popup_client->isMaximizable() );
|
||||
popup->setItemChecked( Options::MaximizeOp, active_popup_client->maximizeMode() == Client::MaximizeFull );
|
||||
// This should be checked also when hover unshaded
|
||||
popup->setItemChecked( Options::ShadeOp, active_popup_client->shadeMode() != ShadeNone );
|
||||
popup->setItemEnabled( Options::ShadeOp, active_popup_client->isShadeable());
|
||||
advanced_popup->setItemChecked( Options::KeepAboveOp, active_popup_client->keepAbove() );
|
||||
advanced_popup->setItemChecked( Options::KeepBelowOp, active_popup_client->keepBelow() );
|
||||
advanced_popup->setItemChecked( Options::FullScreenOp, active_popup_client->isFullScreen() );
|
||||
advanced_popup->setItemEnabled( Options::FullScreenOp, active_popup_client->userCanSetFullScreen() );
|
||||
advanced_popup->setItemChecked( Options::NoBorderOp, active_popup_client->noBorder() );
|
||||
advanced_popup->setItemEnabled( Options::NoBorderOp, active_popup_client->userCanSetNoBorder() );
|
||||
popup->setItemEnabled( Options::MinimizeOp, active_popup_client->isMinimizable() );
|
||||
popup->setItemEnabled( Options::CloseOp, active_popup_client->isCloseable() );
|
||||
mResizeOpAction->setEnabled( active_popup_client->isResizable() );
|
||||
mMoveOpAction->setEnabled( active_popup_client->isMovable() );
|
||||
mMaximizeOpAction->setEnabled( active_popup_client->isMaximizable() );
|
||||
mMaximizeOpAction->setChecked( active_popup_client->maximizeMode() == Client::MaximizeFull );
|
||||
mShadeOpAction->setEnabled( active_popup_client->isShadeable() );
|
||||
mShadeOpAction->setChecked( active_popup_client->shadeMode() != ShadeNone );
|
||||
mKeepAboveOpAction->setChecked( active_popup_client->keepAbove() );
|
||||
mKeepBelowOpAction->setChecked( active_popup_client->keepBelow() );
|
||||
mFullScreenOpAction->setEnabled( active_popup_client->userCanSetFullScreen() );
|
||||
mFullScreenOpAction->setChecked( active_popup_client->isFullScreen() );
|
||||
mNoBorderOpAction->setEnabled( active_popup_client->userCanSetNoBorder() );
|
||||
mNoBorderOpAction->setChecked( active_popup_client->noBorder() );
|
||||
mMinimizeOpAction->setEnabled( active_popup_client->isMinimizable() );
|
||||
mCloseOpAction->setEnabled( active_popup_client->isCloseable() );
|
||||
|
||||
if (options->useTranslucency)
|
||||
{
|
||||
transSlider->setValue(100-active_popup_client->opacityPercentage());
|
||||
|
@ -190,12 +245,14 @@ void Workspace::initDesktopPopup()
|
|||
|
||||
desk_popup = new QMenu( popup );
|
||||
desk_popup->setFont(KGlobalSettings::menuFont());
|
||||
connect( desk_popup, SIGNAL( activated(int) ),
|
||||
this, SLOT( slotSendToDesktop(int) ) );
|
||||
connect( desk_popup, SIGNAL( triggered(QAction*) ),
|
||||
this, SLOT( slotSendToDesktop(QAction*) ) );
|
||||
connect( desk_popup, SIGNAL( aboutToShow() ),
|
||||
this, SLOT( desktopPopupAboutToShow() ) );
|
||||
|
||||
popup->insertItem(i18n("To &Desktop"), desk_popup, -1, desk_popup_index );
|
||||
QAction *action = popup->addMenu( desk_popup );
|
||||
action->setText( i18n("To &Desktop") );
|
||||
action->setData( desk_popup_index );
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -208,27 +265,27 @@ void Workspace::desktopPopupAboutToShow()
|
|||
return;
|
||||
|
||||
desk_popup->clear();
|
||||
desk_popup->insertItem( i18n("&All Desktops"), 0 );
|
||||
QAction *action = desk_popup->addAction( i18n("&All Desktops") );
|
||||
action->setData( 0 );
|
||||
action->setCheckable( true );
|
||||
|
||||
if ( active_popup_client && active_popup_client->isOnAllDesktops() )
|
||||
desk_popup->setItemChecked( 0, true );
|
||||
desk_popup->insertSeparator( -1 );
|
||||
int id;
|
||||
action->setChecked( true );
|
||||
desk_popup->addSeparator();
|
||||
|
||||
const int BASE = 10;
|
||||
for ( int i = 1; i <= numberOfDesktops(); i++ )
|
||||
{
|
||||
for ( int i = 1; i <= numberOfDesktops(); i++ ) {
|
||||
QString basic_name("%1 %2");
|
||||
if (i<BASE)
|
||||
{
|
||||
if (i<BASE) {
|
||||
basic_name.prepend('&');
|
||||
}
|
||||
id = desk_popup->insertItem(
|
||||
basic_name
|
||||
.arg(i)
|
||||
.arg( desktopName(i).replace( '&', "&&" )),
|
||||
i );
|
||||
}
|
||||
action = desk_popup->addAction( basic_name.arg(i).arg( desktopName(i).replace( '&', "&&" ) ) );
|
||||
action->setData( i );
|
||||
action->setCheckable( true );
|
||||
|
||||
if ( active_popup_client &&
|
||||
!active_popup_client->isOnAllDesktops() && active_popup_client->desktop() == i )
|
||||
desk_popup->setItemChecked( id, true );
|
||||
action->setChecked( true );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -331,9 +388,12 @@ void Workspace::clientShortcutUpdated( Client* c )
|
|||
}
|
||||
}
|
||||
|
||||
void Workspace::clientPopupActivated( int id )
|
||||
void Workspace::clientPopupActivated( QAction *action )
|
||||
{
|
||||
WindowOperation op = static_cast< WindowOperation >( id );
|
||||
if ( !action->data().isValid() )
|
||||
return;
|
||||
|
||||
WindowOperation op = static_cast< WindowOperation >( action->data().toInt() );
|
||||
Client* c = active_popup_client ? active_popup_client : active_client;
|
||||
QString type;
|
||||
switch( op )
|
||||
|
@ -950,8 +1010,9 @@ void Workspace::slotKillWindow()
|
|||
|
||||
Internal slot for the window operation menu
|
||||
*/
|
||||
void Workspace::slotSendToDesktop( int desk )
|
||||
void Workspace::slotSendToDesktop( QAction *action )
|
||||
{
|
||||
int desk = action->data().toInt();
|
||||
if ( !active_popup_client )
|
||||
return;
|
||||
if ( desk == 0 )
|
||||
|
|
|
@ -72,7 +72,7 @@ bool allowKompmgrRestart = true;
|
|||
// code.
|
||||
Workspace::Workspace( bool restore )
|
||||
: DCOPObject ("KWinInterface"),
|
||||
QObject (0, "workspace"),
|
||||
QObject (0),
|
||||
current_desktop (0),
|
||||
number_of_desktops(0),
|
||||
active_popup( NULL ),
|
||||
|
@ -128,6 +128,7 @@ Workspace::Workspace( bool restore )
|
|||
block_stacking_updates( 0 ),
|
||||
forced_global_mouse_grab( false )
|
||||
{
|
||||
setObjectName( "workspace" );
|
||||
_self = this;
|
||||
mgr = new PluginMgr;
|
||||
root = QX11Info::appRootWindow();
|
||||
|
@ -153,12 +154,9 @@ Workspace::Workspace( bool restore )
|
|||
|
||||
(void) QApplication::desktop(); // trigger creation of desktop widget
|
||||
|
||||
desktop_widget =
|
||||
new QWidget(
|
||||
0,
|
||||
"desktop_widget",
|
||||
Qt::Desktop );
|
||||
desktop_widget->setAttribute( Qt::WA_PaintUnclipped );
|
||||
desktop_widget = new QWidget( 0, Qt::Desktop );
|
||||
desktop_widget->setObjectName( "desktop_widget" );
|
||||
desktop_widget->setAttribute( Qt::WA_PaintUnclipped );
|
||||
|
||||
// call this before XSelectInput() on the root window
|
||||
startup = new KStartupInfo(
|
||||
|
@ -639,7 +637,7 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change )
|
|||
}
|
||||
else if( change == FocusChainMakeLast )
|
||||
{
|
||||
focus_chain[ i ].remove( c );
|
||||
focus_chain[ i ].removeAll( c );
|
||||
focus_chain[ i ].prepend( c );
|
||||
}
|
||||
else if( !focus_chain[ i ].contains( c ))
|
||||
|
@ -656,7 +654,7 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change )
|
|||
}
|
||||
else if( change == FocusChainMakeLast )
|
||||
{
|
||||
global_focus_chain.remove( c );
|
||||
global_focus_chain.removeAll( c );
|
||||
global_focus_chain.prepend( c );
|
||||
}
|
||||
else if( !global_focus_chain.contains( c ))
|
||||
|
@ -2335,7 +2333,7 @@ int Workspace::topMenuHeight() const
|
|||
if( topmenu_height == 0 )
|
||||
{ // simply create a dummy menubar and use its preffered height as the menu height
|
||||
KMenuBar tmpmenu;
|
||||
tmpmenu.insertItem( "dummy" );
|
||||
tmpmenu.addAction( "dummy" );
|
||||
topmenu_height = tmpmenu.sizeHint().height();
|
||||
}
|
||||
return topmenu_height;
|
||||
|
|
14
workspace.h
14
workspace.h
|
@ -363,8 +363,8 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine
|
|||
private slots:
|
||||
void desktopPopupAboutToShow();
|
||||
void clientPopupAboutToShow();
|
||||
void slotSendToDesktop( int );
|
||||
void clientPopupActivated( int );
|
||||
void slotSendToDesktop( QAction* );
|
||||
void clientPopupActivated( QAction* );
|
||||
void configureWM();
|
||||
void desktopResized();
|
||||
void slotUpdateToolWindows();
|
||||
|
@ -549,6 +549,16 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine
|
|||
|
||||
KActionCollection *keys;
|
||||
KActionCollection *client_keys;
|
||||
QAction *mResizeOpAction;
|
||||
QAction *mMoveOpAction;
|
||||
QAction *mMaximizeOpAction;
|
||||
QAction *mShadeOpAction;
|
||||
QAction *mKeepAboveOpAction;
|
||||
QAction *mKeepBelowOpAction;
|
||||
QAction *mFullScreenOpAction;
|
||||
QAction *mNoBorderOpAction;
|
||||
QAction *mMinimizeOpAction;
|
||||
QAction *mCloseOpAction;
|
||||
ShortcutDialog* client_keys_dialog;
|
||||
Client* client_keys_client;
|
||||
KActionCollection *disable_shortcuts_keys;
|
||||
|
|
Loading…
Reference in a new issue