Fix shaping - KCommonDecoration has a function where to do it,

and I don't see the point in resetting the shape every time in paintEvent().
Partially fixes resizing problems with Qt4.4.


svn path=/trunk/KDE/kdebase/workspace/; revision=782673
This commit is contained in:
Luboš Luňák 2008-03-05 17:48:45 +00:00
parent e179b84940
commit 9fcd3ad674
2 changed files with 2 additions and 5 deletions

View file

@ -260,8 +260,6 @@ void OxygenClient::paintEvent(QPaintEvent *e)
Q_UNUSED(e) Q_UNUSED(e)
if (!OxygenFactory::initialized()) return; if (!OxygenFactory::initialized()) return;
doShape();
QPalette palette = widget()->palette(); QPalette palette = widget()->palette();
QPainter painter(widget()); QPainter painter(widget());
@ -380,7 +378,7 @@ void OxygenClient::paintEvent(QPaintEvent *e)
renderDot(&painter, QPointF(6.5, 2.5), 1.8); renderDot(&painter, QPointF(6.5, 2.5), 1.8);
} }
void OxygenClient::doShape() void OxygenClient::updateWindowShape()
{ {
bool maximized = maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows(); bool maximized = maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows();
int w=widget()->width(); int w=widget()->width();

View file

@ -48,12 +48,11 @@ public:
virtual KCommonDecorationButton *createButton(::ButtonType type); virtual KCommonDecorationButton *createButton(::ButtonType type);
virtual bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
virtual void updateWindowShape();
virtual void init(); virtual void init();
private: private:
void paintEvent(QPaintEvent *e); void paintEvent(QPaintEvent *e);
void doShape();
QColor titlebarTextColor(const QPalette &palette); QColor titlebarTextColor(const QPalette &palette);
bool colorCacheInvalid_; bool colorCacheInvalid_;
QColor cachedTitlebarTextColor_; QColor cachedTitlebarTextColor_;