forked from pool/breeze
43 lines
2.0 KiB
Diff
43 lines
2.0 KiB
Diff
From 6b0d93d316f14cf00e7b7a5f6f13c4d16ee0ce68 Mon Sep 17 00:00:00 2001
|
|
From: Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
|
Date: Sun, 22 Mar 2015 19:52:14 +0100
|
|
Subject: [PATCH 1/5] Cleanup code to align with master Check for
|
|
drawBordersOnMaximizedWindows when testing edges flags. BUG: 345424
|
|
|
|
---
|
|
kdecoration/breezedecoration.cpp | 10 +++++++---
|
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/kdecoration/breezedecoration.cpp b/kdecoration/breezedecoration.cpp
|
|
index 1c042861e1207c812032eb772849c88b503a3792..dc4219c161f7a2467906083cf62039d5a0645303 100644
|
|
--- a/kdecoration/breezedecoration.cpp
|
|
+++ b/kdecoration/breezedecoration.cpp
|
|
@@ -278,9 +278,14 @@ namespace Breeze
|
|
auto s = settings();
|
|
const auto c = client().data();
|
|
const Qt::Edges edges = c->adjacentScreenEdges();
|
|
- int left = isMaximizedHorizontally() || edges.testFlag(Qt::LeftEdge) ? 0 : borderSize();
|
|
- int right = isMaximizedHorizontally() || edges.testFlag(Qt::RightEdge) ? 0 : borderSize();
|
|
|
|
+ // left, right and bottom borders
|
|
+ auto testFlag = [&]( Qt::Edge edge ) { return edges.testFlag(edge) && !m_internalSettings->drawBorderOnMaximizedWindows(); };
|
|
+ const int left = isMaximizedHorizontally() || testFlag(Qt::LeftEdge) ? 0 : borderSize();
|
|
+ const int right = isMaximizedHorizontally() || testFlag(Qt::RightEdge) ? 0 : borderSize();
|
|
+ const int bottom = isMaximizedVertically() || c->isShaded() || testFlag(Qt::BottomEdge) ? 0 : borderSize(true);
|
|
+
|
|
+ // top border
|
|
QFontMetrics fm(s->font());
|
|
int top = qMax(fm.boundingRect(c->caption()).height(), buttonHeight() );
|
|
|
|
@@ -292,7 +297,6 @@ namespace Breeze
|
|
// padding above
|
|
top += baseSize*TitleBar_TopMargin;
|
|
|
|
- int bottom = isMaximizedVertically() || c->isShaded() || edges.testFlag(Qt::BottomEdge) ? 0 : borderSize(true);
|
|
setBorders(QMargins(left, top, right, bottom));
|
|
|
|
// extended sizes
|
|
--
|
|
2.3.3
|
|
|