Sync missing r908463 from Oxygen.
svn path=/trunk/KDE/kdebase/workspace/; revision=999259
This commit is contained in:
parent
2b82601558
commit
35d1ba665f
1 changed files with 27 additions and 9 deletions
|
@ -208,11 +208,13 @@ void OxygenButton::paintEvent(QPaintEvent *)
|
|||
|
||||
dark.setAlpha(120);
|
||||
|
||||
if(client_.isActive()) {
|
||||
if(client_.isActive())
|
||||
{
|
||||
helper_.drawSeparator(&painter, QRect(x, titleHeight-1.5, w, 2), color, Qt::Horizontal);
|
||||
}
|
||||
|
||||
if (type_ == ButtonMenu) {
|
||||
if (type_ == ButtonMenu)
|
||||
{
|
||||
// we paint the mini icon (which is 16 pixels high)
|
||||
int dx = (width() - 16) / 2;
|
||||
int dy = (height() - 16) / 2 - 1;
|
||||
|
@ -222,31 +224,47 @@ void OxygenButton::paintEvent(QPaintEvent *)
|
|||
|
||||
|
||||
if(client_.maximizeMode() == OxygenClient::MaximizeRestore)
|
||||
{
|
||||
painter.translate(0,-1);
|
||||
}
|
||||
|
||||
QColor bg = helper_.backgroundTopColor(OxygenFactory::blendTitlebarColors()?pal.window().color()
|
||||
:client_.options()->color(KDecorationDefines::ColorTitleBar,client_.isActive()));
|
||||
|
||||
// get icon color
|
||||
color = buttonDetailColor(pal);
|
||||
if(status_ == Oxygen::Hovered || status_ == Oxygen::Pressed) {
|
||||
if (status_ == Oxygen::Hovered || status_ == Oxygen::Pressed)
|
||||
{
|
||||
if (type_ == ButtonClose)
|
||||
{
|
||||
color = KColorScheme(pal.currentColorGroup()).foreground(KColorScheme::NegativeText).color();
|
||||
else
|
||||
color = KColorScheme(pal.currentColorGroup()).decoration(KColorScheme::HoverColor).color();
|
||||
|
||||
}
|
||||
QLinearGradient lg = helper_.decoGradient(QRect(4,4,13,13), color);
|
||||
else
|
||||
{
|
||||
color = KColorScheme(pal.currentColorGroup()).decoration(KColorScheme::HoverColor).color();
|
||||
}
|
||||
}
|
||||
|
||||
// draw button
|
||||
QColor bt = OxygenFactory::blendTitlebarColors()?pal.window().color()
|
||||
:client_.options()->color(KDecorationDefines::ColorButtonBg,client_.isActive());
|
||||
painter.drawPixmap(0, 0, helper_.windecoButton(bt, status_ == Oxygen::Pressed));
|
||||
|
||||
if (client_.isActive()) {
|
||||
// draw glow on hover
|
||||
if (status_ == Oxygen::Hovered)
|
||||
{
|
||||
painter.drawPixmap(0, 0, helper_.windecoButtonGlow(color));
|
||||
}
|
||||
|
||||
if (client_.isActive())
|
||||
{
|
||||
painter.setRenderHints(QPainter::Antialiasing);
|
||||
painter.setBrush(Qt::NoBrush);
|
||||
painter.setPen(QPen(lg, 2.2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
painter.setPen(QPen(color, 1.4, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
drawIcon(&painter, pal, type_);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
// outlined mode
|
||||
QPixmap pixmap(size());
|
||||
pixmap.fill(Qt::transparent);
|
||||
|
|
Loading…
Reference in a new issue