Adding option to turn on/off the automove of titlebar tab, automove doesn't work with composite anyway
svn path=/trunk/KDE/kdebase/workspace/; revision=1050951icc-effect-5.14.5
parent
67a2bc4016
commit
7b4d5abb47
|
@ -8,6 +8,9 @@
|
|||
improvements, customizable menu double click action and button hover
|
||||
effects are
|
||||
Copyright (c) 2003, 2004, 2006 Luciano Montanaro <mikelima@cirulla.net>
|
||||
|
||||
Added option to turn off titlebar autorelocation
|
||||
Copyright (c) 2009 Jussi Kekkonen <tmt@ubuntu.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -96,7 +99,7 @@ static QPixmap *pixmap[P_NUM_PIXMAPS];
|
|||
|
||||
static QPixmap* titleGradient[2] = {0, 0};
|
||||
|
||||
static int thickness = 4; // Frame thickness
|
||||
static int thickness = 3; // Frame thickness
|
||||
static int buttonSize = 16;
|
||||
|
||||
enum DblClickOperation {
|
||||
|
@ -111,6 +114,7 @@ static DblClickOperation menu_dbl_click_op = NoOp;
|
|||
static bool pixmaps_created = false;
|
||||
static bool colored_frame = false;
|
||||
static bool do_draw_handle = true;
|
||||
static bool do_amove_tb = true;
|
||||
static bool drawSmallBorders = false;
|
||||
|
||||
// =====================================
|
||||
|
@ -140,6 +144,7 @@ static void read_config(B2ClientFactory *f)
|
|||
KConfigGroup conf(&_conf, "General");
|
||||
colored_frame = conf.readEntry("UseTitleBarBorderColors", false);
|
||||
do_draw_handle = conf.readEntry("DrawGrabHandle", true);
|
||||
do_amove_tb = conf.readEntry("AutoMoveTitleBar", true);
|
||||
drawSmallBorders = !options()->moveResizeMaximizedWindows();
|
||||
|
||||
QString opString = conf.readEntry("MenuButtonDoubleClickOperation", "NoOp");
|
||||
|
@ -155,7 +160,7 @@ static void read_config(B2ClientFactory *f)
|
|||
|
||||
switch (options()->preferredBorderSize(f)) {
|
||||
case KDecoration::BorderTiny:
|
||||
thickness = 2;
|
||||
thickness = 1;
|
||||
break;
|
||||
case KDecoration::BorderLarge:
|
||||
thickness = 5;
|
||||
|
@ -174,7 +179,7 @@ static void read_config(B2ClientFactory *f)
|
|||
break;
|
||||
case KDecoration::BorderNormal:
|
||||
default:
|
||||
thickness = 4;
|
||||
thickness = 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -594,6 +599,12 @@ bool B2Client::mustDrawHandle() const
|
|||
}
|
||||
}
|
||||
|
||||
bool B2Client::autoMoveTitlebar() const
|
||||
{
|
||||
return do_amove_tb;
|
||||
}
|
||||
|
||||
|
||||
void B2Client::iconChange()
|
||||
{
|
||||
if (button[BtnMenu])
|
||||
|
@ -687,7 +698,7 @@ void B2Client::paintEvent(QPaintEvent* e)
|
|||
p.drawRect(0, t.bottom() - thickness + 1,
|
||||
fWidth, fHeight - bb + thickness);
|
||||
|
||||
if (thickness >= 2) {
|
||||
if (thickness >= 1) {
|
||||
// inner window rect
|
||||
p.drawRect(thickness - 1, t.bottom(),
|
||||
fWidth - 2 * (thickness - 1), fHeight - bDepth + 2);
|
||||
|
@ -754,7 +765,7 @@ void B2Client::paintEvent(QPaintEvent* e)
|
|||
we now might have the space available, but the titlebar gets no
|
||||
visibilitinotify events until its state changes, so we just try
|
||||
*/
|
||||
if (titlebar->isFullyObscured()) {
|
||||
if (titlebar->isFullyObscured()) { //FIXME this doesn't work in composited X
|
||||
/* We first see, if our repaint contained the titlebar area */
|
||||
QRegion reg(QRect(0, 0, width(), buttonSize + 4));
|
||||
reg = reg.intersect(e->region());
|
||||
|
@ -986,6 +997,8 @@ void B2Client::unobscureTitlebar()
|
|||
so we look at all windows above us (stacking_order) merging their
|
||||
masks, intersecting it with our titlebar area, and see if we can
|
||||
find a place not covered by any window */
|
||||
if (autoMoveTitlebar()) // I'm not sure if earlier check does it right, so let's make it sure, DO WE AUTOMOVE?
|
||||
{
|
||||
if (in_unobs) {
|
||||
return;
|
||||
}
|
||||
|
@ -1000,6 +1013,7 @@ void B2Client::unobscureTitlebar()
|
|||
titleMoveAbs(reg.boundingRect().x());
|
||||
}
|
||||
in_unobs = 0;
|
||||
} // if (autoMoveTitlebar())
|
||||
}
|
||||
|
||||
static void redraw_pixmaps()
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
/*********************************************************************
|
||||
B-II KWin Client
|
||||
|
||||
|
||||
Changes:
|
||||
Customizable button positions by Karol Szwed <gallium@kde.org>
|
||||
Ported to the kde3.2 API by Luciano Montanaro <mikelima@cirulla.net>
|
||||
|
||||
Added option to turn off titlebar autorelocation
|
||||
Copyright (c) 2009 Jussi Kekkonen <tmt@ubuntu.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -152,6 +155,7 @@ private:
|
|||
void positionButtons();
|
||||
void calcHiddenButtons();
|
||||
bool mustDrawHandle() const;
|
||||
bool autoMoveTitlebar() const;
|
||||
|
||||
enum ButtonType{BtnMenu=0, BtnSticky, BtnIconify, BtnMax, BtnClose,
|
||||
BtnHelp, BtnShade, BtnResize, BtnCount};
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
http://gallium.n3.net/
|
||||
Copyright (c) 2007
|
||||
Luciano Montanaro <mikelima@cirulla.net>
|
||||
Automove titlebar bits Copyright (c) 2009 Jussi Kekkonen <tmt@ubuntu.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -68,6 +69,14 @@ B2Config::B2Config(KConfig *conf, QWidget *parent)
|
|||
i18n("When selected, decorations are drawn with a \"grab handle\" "
|
||||
"in the bottom right corner of the windows; "
|
||||
"otherwise, no grab handle is drawn."));
|
||||
|
||||
// Automove Titlebar
|
||||
autoMoveTitlebarCb = new QCheckBox(
|
||||
i18n("Automove titlebar"), gb);
|
||||
autoMoveTitlebarCb->setWhatsThis(
|
||||
i18n("When selected, Titlebars are automatically relovated "
|
||||
"to visible place; "
|
||||
"otherwise, only moved manually."));
|
||||
|
||||
// Double click menu option support
|
||||
actionsGB = new QGroupBox(i18n("Actions Settings"), gb);
|
||||
|
@ -100,6 +109,8 @@ B2Config::B2Config(KConfig *conf, QWidget *parent)
|
|||
this, SLOT(slotSelectionChanged()));
|
||||
connect(showGrabHandleCb, SIGNAL(clicked()),
|
||||
this, SLOT(slotSelectionChanged()));
|
||||
connect(autoMoveTitlebarCb, SIGNAL(clicked()),
|
||||
this, SLOT(slotSelectionChanged()));
|
||||
connect(menuDblClickOp, SIGNAL(activated(int)),
|
||||
this, SLOT(slotSelectionChanged()));
|
||||
// Make the widgets visible in kwindecoration
|
||||
|
@ -129,6 +140,9 @@ void B2Config::load(const KConfigGroup & /*conf*/)
|
|||
override = cg.readEntry("DrawGrabHandle", true);
|
||||
showGrabHandleCb->setChecked(override);
|
||||
|
||||
override = cg.readEntry( "AutoMoveTitleBar", true );
|
||||
autoMoveTitlebarCb->setChecked(override);
|
||||
|
||||
QString returnString = cg.readEntry(
|
||||
"MenuButtonDoubleClickOperation", "NoOp");
|
||||
|
||||
|
@ -167,6 +181,7 @@ void B2Config::save(KConfigGroup & /*conf*/)
|
|||
KConfigGroup cg(b2Config, "General");
|
||||
cg.writeEntry("UseTitleBarBorderColors", cbColorBorder->isChecked());
|
||||
cg.writeEntry("DrawGrabHandle", showGrabHandleCb->isChecked());
|
||||
cg.writeEntry("AutoMoveTitleBar", autoMoveTitlebarCb->isChecked());
|
||||
cg.writeEntry("MenuButtonDoubleClickOperation",
|
||||
opToString(menuDblClickOp->currentIndex()));
|
||||
// Ensure others trying to read this config get updated
|
||||
|
@ -178,6 +193,7 @@ void B2Config::defaults()
|
|||
{
|
||||
cbColorBorder->setChecked(false);
|
||||
showGrabHandleCb->setChecked(true);
|
||||
autoMoveTitlebarCb->setChecked(true);
|
||||
menuDblClickOp->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
http://gallium.n3.net/
|
||||
Copyright (c) 2007
|
||||
Luciano Montanaro <mikelima@cirulla.net>
|
||||
Automove titlebar bits Copyright (c) 2009 Jussi Kekkonen <tmt@ubuntu.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -54,6 +55,7 @@ private:
|
|||
KConfig *b2Config;
|
||||
QCheckBox *cbColorBorder;
|
||||
QCheckBox *showGrabHandleCb;
|
||||
QCheckBox *autoMoveTitlebarCb;
|
||||
QGroupBox *actionsGB;
|
||||
KComboBox *menuDblClickOp;
|
||||
QWidget *gb;
|
||||
|
|
Loading…
Reference in New Issue