Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
dukzcry committed Mar 15, 2017
1 parent 5483451 commit cb507f0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
A quick port of "KDE 2" window decoration to KDE5
A quick port of "KDE 2" window decoration to KDE Plasma 5

To install do the following in your terminal:

git clone git://github.com/repos-holder/kdecoration2-kde2
cd kdecoration2-kde2
cmake . -DCMAKE_INSTALL_PREFIX=/usr
make install

It should be then available in System Settings -> Application Style -> Window Decorations
13 changes: 7 additions & 6 deletions src/skeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ void Decoration::createPixmaps()

delete g;
}
int getBottom(Decoration *d)
{
return d->client().data()->isMaximized() ? side : bottom_;
}

QVariantMap ThemeLister::themes() const
{
Expand Down Expand Up @@ -463,11 +467,10 @@ void Decoration::updateLayout()
#endif

//int frame = settings()->fontMetrics().height() / 5;
int bottom = (isMaximized ? side : bottom_);
int titleHeight = qRound(1.25 * settings()->fontMetrics().height());
if (titleHeight < 16)
if (titleHeight < 19)
titleHeight = 19;
setBorders(QMargins(side, titleHeight + top, side, bottom));
setBorders(QMargins(side, titleHeight + top, side, getBottom(this)));

m_frameRect = QRect(0, 0, size().width(), size().height());
setTitleBar(QRect(side, top, size().width() - 2 * side, borderTop()));
Expand Down Expand Up @@ -573,7 +576,7 @@ void Decoration::paint(QPainter *painter, const QRect &repaintArea)
QPalette *g2 = new QPalette(client().data()->color(colorGroup, KDecoration2::ColorRole::TitleBar));
QColor c2 = client().data()->color(colorGroup, KDecoration2::ColorRole::Frame);
int leftFrameStart = m_captionRect.height()+leftFrameOffset;
int bottom = client().data()->isMaximized() ? side : bottom_;
int bottom = getBottom(this);

// left side
painter->setPen(c2);
Expand Down Expand Up @@ -735,8 +738,6 @@ void DecorationButton::paint(QPainter *painter, const QRect &/*repaintArea*/)

painter->drawPixmap( geometry().x(), geometry().y(), btnbg );

// If we have a decoration bitmap, then draw that
// otherwise we paint a sticky button.
// Select the appropriate button decoration color
bool darkDeco = qGray( decoration()->client().data()->color(
colorGroup,
Expand Down

0 comments on commit cb507f0

Please sign in to comment.