Fix the "redmond" kwin client

It is highly recommended that "window resize and move when maximized" be disabled when this client is in use


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1243970 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent ba1d97533c
commit 4f396b03eb

@ -395,7 +395,7 @@ int RedmondDeco::layoutMetric(LayoutMetric lm, bool respectWindowState, const KC
return border ? borderWidth+2 : 2;
case LM_TitleEdgeTop:
return border ? borderWidth+2 : 2;
return border ? borderWidth+1 : 2;
case LM_TitleEdgeBottom:
return border ? 1 : 0;
@ -422,6 +422,12 @@ int RedmondDeco::layoutMetric(LayoutMetric lm, bool respectWindowState, const KC
case LM_ExplicitButtonSpacer:
return 2;
case LM_ButtonMarginTop:
return 0;
case LM_RightButtonsMarginTop:
return 1;
default:
return KCommonDecoration::layoutMetric(lm, respectWindowState, btn);
}
@ -560,8 +566,12 @@ void RedmondDeco::paintEvent( TQPaintEvent* )
p2.setFont( fnt );
p2.setPen( options()->color(KDecoration::ColorFont, isActive() ));
p2.drawText( r.x(), fontoffset, r.width()-3, r.height()-1,
AlignLeft | AlignVCenter, caption() );
if (border)
p2.drawText( r.x()-3, fontoffset, r.width(), r.height()+1,
AlignLeft | AlignVCenter, caption() );
else
p2.drawText( r.x()+1, fontoffset, r.width()-4, r.height()+1,
AlignLeft | AlignVCenter, caption() );
p2.end();
p.drawPixmap( modBorderWidth, modBorderWidth, *titleBuffer );
@ -576,7 +586,7 @@ void RedmondDeco::paintEvent( TQPaintEvent* )
// Draw the title text.
p.setFont( fnt );
p.setPen(options()->color(KDecoration::ColorFont, isActive() ));
p.drawText(r.x()+4, r.y()+fontoffset-2, r.width()-3, r.height()-1,
p.drawText(r.x()+4, r.y()+fontoffset-2, r.width()-3, r.height()+1,
AlignLeft | AlignVCenter, caption() );
}
@ -616,7 +626,7 @@ void RedmondDecoFactory::readConfig() {
case BorderTiny:
case BorderNormal:
default:
borderWidth = 4;
borderWidth = 3;
if (normalTitleHeight < 16) normalTitleHeight = 16;
if (toolTitleHeight < 16) toolTitleHeight = 16;
}

@ -97,6 +97,7 @@ int KCommonDecoration::layoutMetric(LayoutMetric lm, bool, const KCommonDecorati
return 5;
case LM_ButtonMarginTop:
case LM_RightButtonsMarginTop:
return 0;
case LM_ExplicitButtonSpacer:
@ -212,6 +213,7 @@ void KCommonDecoration::updateLayout() const
}
if (m_buttonsRight.count() > 0) {
int y = r_y + layoutMetric(LM_TitleEdgeTop) + layoutMetric(LM_ButtonMarginTop) + layoutMetric(LM_RightButtonsMarginTop);
const int titleEdgeRightLeft = r_x2-layoutMetric(LM_TitleEdgeRight)+1;
const int buttonSpacing = layoutMetric(LM_ButtonSpacing);

@ -113,7 +113,8 @@ class KWIN_EXPORT KCommonDecoration : public KDecoration
LM_ButtonHeight,
LM_ButtonSpacing,
LM_ExplicitButtonSpacer,
LM_ButtonMarginTop
LM_ButtonMarginTop,
LM_RightButtonsMarginTop
};
enum DecorationBehaviour

Loading…
Cancel
Save