Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
fixed #27 rect to redraw titlebar was set way too large
Browse files Browse the repository at this point in the history
  • Loading branch information
n4n0GH committed Nov 27, 2019
1 parent a4ffe8c commit 25fe255
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions window-decoration/kdecoration/hellodecoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ namespace Hello
connect(c, &KDecoration2::DecoratedClient::maximizedHorizontallyChanged, this, &Decoration::recalculateBorders);
connect(c, &KDecoration2::DecoratedClient::maximizedVerticallyChanged, this, &Decoration::recalculateBorders);
connect(c, &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::recalculateBorders);
connect(c, &KDecoration2::DecoratedClient::captionChanged, this,
connect(c, &KDecoration2::DecoratedClient::captionChanged, this,
[this]()
{
// update the caption area
Expand Down Expand Up @@ -334,9 +334,9 @@ namespace Hello
auto s = settings();
auto c = client().data();
const bool maximized = isMaximized();
const int width = maximized ? c->width() : c->width() - 2*s->largeSpacing()*customButtonMargin();
const int width = maximized ? c->width() : c->width() - 2*s->smallSpacing()*customButtonMargin();
const int height = maximized ? borderTop() : borderTop() - s->smallSpacing()*customTitleBarHeight();
const int x = maximized ? 0 : s->largeSpacing()*customButtonMargin();
const int x = maximized ? 0 : s->smallSpacing()*customButtonMargin();
const int y = maximized ? 0 : s->smallSpacing()*customTitleBarHeight();
setTitleBar(QRect(x, y, width, height));
}
Expand Down

0 comments on commit 25fe255

Please sign in to comment.