Don't crash. Thanks to gallium for pointing this out.
svn path=/trunk/kdebase/kwin/; revision=97773icc-effect-5.14.5
parent
8b5d812a5f
commit
8a597cc22e
|
@ -70,17 +70,13 @@ extern "C"
|
||||||
}
|
}
|
||||||
|
|
||||||
Web::Web(Workspace * ws, WId w, bool tool, QWidget * parent, const char * name)
|
Web::Web(Workspace * ws, WId w, bool tool, QWidget * parent, const char * name)
|
||||||
: Client(ws, w, parent, name, WResizeNoErase),
|
: Client (ws, w, parent, name, WResizeNoErase),
|
||||||
tool_(tool),
|
tool_ (tool),
|
||||||
mainLayout_(0),
|
mainLayout_ (0),
|
||||||
titleSpacer_(0)
|
titleSpacer_ (0)
|
||||||
{
|
{
|
||||||
setBackgroundMode(NoBackground);
|
setBackgroundMode(NoBackground);
|
||||||
|
|
||||||
KConfig c(locate("config", "kwinwebrc"));
|
|
||||||
c.setGroup("General");
|
|
||||||
shape_ = c.readBoolEntry("Shape", true);
|
|
||||||
|
|
||||||
_resetLayout();
|
_resetLayout();
|
||||||
|
|
||||||
leftButtonList_ .setAutoDelete(true);
|
leftButtonList_ .setAutoDelete(true);
|
||||||
|
@ -166,7 +162,9 @@ Web::paintEvent(QPaintEvent * pe)
|
||||||
}
|
}
|
||||||
|
|
||||||
p.setFont(options->font(isActive(), tool_));
|
p.setFont(options->font(isActive(), tool_));
|
||||||
|
|
||||||
p.setPen(options->color(Options::Font, isActive()));
|
p.setPen(options->color(Options::Font, isActive()));
|
||||||
|
|
||||||
p.drawText(titleSpacer_->geometry(), AlignCenter, caption());
|
p.drawText(titleSpacer_->geometry(), AlignCenter, caption());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,6 +418,10 @@ Web::_createButtons()
|
||||||
void
|
void
|
||||||
Web::_resetLayout()
|
Web::_resetLayout()
|
||||||
{
|
{
|
||||||
|
KConfig c(locate("config", "kwinwebrc"));
|
||||||
|
c.setGroup("General");
|
||||||
|
shape_ = c.readBoolEntry("Shape", true);
|
||||||
|
|
||||||
// ____________________________________
|
// ____________________________________
|
||||||
// | | | |
|
// | | | |
|
||||||
// |Xo| titleSpacer |v^| <--- topLayout
|
// |Xo| titleSpacer |v^| <--- topLayout
|
||||||
|
@ -444,26 +446,18 @@ Web::_resetLayout()
|
||||||
if (0 != titleHeight % 2)
|
if (0 != titleHeight % 2)
|
||||||
titleHeight += 1;
|
titleHeight += 1;
|
||||||
|
|
||||||
if (0 == titleSpacer_)
|
|
||||||
{
|
|
||||||
titleSpacer_ =
|
|
||||||
new QSpacerItem
|
|
||||||
(
|
|
||||||
0,
|
|
||||||
titleHeight,
|
|
||||||
QSizePolicy::Expanding,
|
|
||||||
QSizePolicy::Fixed
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete mainLayout_;
|
delete mainLayout_;
|
||||||
mainLayout_ = 0;
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
|
|
||||||
mainLayout_ = new QVBoxLayout(this, 0, 0);
|
mainLayout_ = new QVBoxLayout(this, 0, 0);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
titleSpacer_ =
|
||||||
|
new QSpacerItem
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
titleHeight,
|
||||||
|
QSizePolicy::Expanding,
|
||||||
|
QSizePolicy::Fixed
|
||||||
|
);
|
||||||
|
|
||||||
QHBoxLayout * topLayout = new QHBoxLayout(mainLayout_, 0, 0);
|
QHBoxLayout * topLayout = new QHBoxLayout(mainLayout_, 0, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue