<table><tr><td style="">zzag added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D10438" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Alright here's a patch which would make possible to turn off reserving space. Yet, a checkbox should be added in "Fine tuning" tab.</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="diff" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">From 45be224b2fb31966a3117aa1f226f8ea711f8109 Mon Sep 17 00:00:00 2001
From: Vlad Zagorodniy <vladzzag@gmail.com>
Date: Tue, 13 Feb 2018 17:44:43 +0200
Subject: [PATCH] add reserve space from checkboxes option
<span style="color: #a00000">---</span>
kstyle/breezestyle.cpp | 20 +++++++++++++++++---
kstyle/breezestyle.h | 3 +++
2 files changed, 20 insertions(+), 3 deletions(-)
<span style="color: #000080">diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp</span>
<span style="color: #000080">index 07f0be7d..02189575 100644</span>
<span style="color: #a00000">--- a/kstyle/breezestyle.cpp</span>
<span style="color: #00a000">+++ b/kstyle/breezestyle.cpp</span>
<span style="color: #800080">@@ -2728,7 +2728,11 @@ namespace Breeze</span>
leftColumnWidth += Metrics::MenuItem_ItemSpacing;
// add checkbox indicator width
<span style="color: #a00000">- leftColumnWidth += Metrics::CheckBox_Size + Metrics::MenuItem_ItemSpacing;</span>
<span style="color: #00a000">+ if( menuItemOption->menuHasCheckableItems || reserveSpaceForCheckboxesInMenus() )</span>
<span style="color: #00a000">+ {</span>
<span style="color: #00a000">+ leftColumnWidth += Metrics::CheckBox_Size</span>
<span style="color: #00a000">+ + Metrics::MenuItem_ItemSpacing;</span>
<span style="color: #00a000">+ }</span>
// add spacing for accelerator
/*
<span style="color: #800080">@@ -4697,8 +4701,11 @@ namespace Breeze</span>
// define relevant rectangles
// checkbox
QRect checkBoxRect;
<span style="color: #a00000">- checkBoxRect = QRect( contentsRect.left(), contentsRect.top() + (contentsRect.height()-Metrics::CheckBox_Size)/2, Metrics::CheckBox_Size, Metrics::CheckBox_Size );</span>
<span style="color: #a00000">- contentsRect.setLeft( checkBoxRect.right() + Metrics::MenuItem_ItemSpacing + 1 );</span>
<span style="color: #00a000">+ if( menuItemOption->menuHasCheckableItems || reserveSpaceForCheckboxesInMenus() )</span>
<span style="color: #00a000">+ {</span>
<span style="color: #00a000">+ checkBoxRect = QRect( contentsRect.left(), contentsRect.top() + (contentsRect.height()-Metrics::CheckBox_Size)/2, Metrics::CheckBox_Size, Metrics::CheckBox_Size );</span>
<span style="color: #00a000">+ contentsRect.setLeft( checkBoxRect.right() + Metrics::MenuItem_ItemSpacing + 1 );</span>
<span style="color: #00a000">+ }</span>
// render checkbox indicator
if( menuItemOption->checkType == QStyleOptionMenuItem::NonExclusive )
<span style="color: #800080">@@ -7074,6 +7081,13 @@ namespace Breeze</span>
return g.readEntry("ShowIconsInMenuItems", true);
}
<span style="color: #00a000">+ //____________________________________________________________________</span>
<span style="color: #00a000">+ bool Style::reserveSpaceForCheckboxesInMenus() const</span>
<span style="color: #00a000">+ {</span>
<span style="color: #00a000">+ const KConfigGroup g(KSharedConfig::openConfig(), "KDE");</span>
<span style="color: #00a000">+ return g.readEntry("ReserveSpaceForCheckboxesInMenus", true);</span>
<span style="color: #00a000">+ }</span>
<span style="color: #00a000">+</span>
//____________________________________________________________________
bool Style::showIconsOnPushButtons() const
{
<span style="color: #000080">diff --git a/kstyle/breezestyle.h b/kstyle/breezestyle.h</span>
<span style="color: #000080">index 12548c92..031a1225 100644</span>
<span style="color: #a00000">--- a/kstyle/breezestyle.h</span>
<span style="color: #00a000">+++ b/kstyle/breezestyle.h</span>
<span style="color: #800080">@@ -468,6 +468,9 @@ namespace Breeze</span>
//* return true if icons should be shown in menus
bool showIconsInMenuItems() const;
<span style="color: #00a000">+ //* return true if space is reserved for checkboxes in menus</span>
<span style="color: #00a000">+ bool reserveSpaceForCheckboxesInMenus() const;</span>
<span style="color: #00a000">+</span>
//* return true if icons should be shown on buttons
bool showIconsOnPushButtons() const;
<span style="color: #a00000">-- </span>
2.16.1</pre></div>
<p>But, I would like to have <a href="https://phabricator.kde.org/D10480" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">D10480</a> in master so I could complete the patch above.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R31 Breeze</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D10438" rel="noreferrer">https://phabricator.kde.org/D10438</a></div></div><br /><div><strong>To: </strong>zzag, Breeze, VDG, ngraham, hpereiradacosta<br /><strong>Cc: </strong>alake, colomar, januz, fabianr, mmustac, abetts, anemeth, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, sebas, apol, mart<br /></div>