summaryrefslogtreecommitdiffstats
path: root/kicker/applets/systemtray/systemtrayapplet.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-10-12 12:44:21 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-10-12 12:50:19 +0900
commita839f1ce6f70b7863f48b6e2ffa566814d0f949f (patch)
tree071d0483c8c089ef54ad9aa29d796e696f84b166 /kicker/applets/systemtray/systemtrayapplet.cpp
parenta84397aebb34c846cda46dcefe8c381085c73312 (diff)
downloadtdebase-workaround/issue-647.tar.gz
tdebase-workaround/issue-647.zip
Temporary workaround for issue #647, until a proper solution is prepared.workaround/issue-647
The workaround is intended mainly for the r14.1.x branch, but it is also applied to master branch to ease further updates in the future. The commit partially revert the code related to the systray icon margin from commit fa284a45. Rather than completely removing the code for the icon margin checkbox, I have opted to keep the work already done and simply gray out the checkbox to make it unusable for the time being. The logic for the margin calculation has been reverted too. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kicker/applets/systemtray/systemtrayapplet.cpp')
-rw-r--r--kicker/applets/systemtray/systemtrayapplet.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/kicker/applets/systemtray/systemtrayapplet.cpp b/kicker/applets/systemtray/systemtrayapplet.cpp
index 175e037e5..90f9c97ad 100644
--- a/kicker/applets/systemtray/systemtrayapplet.cpp
+++ b/kicker/applets/systemtray/systemtrayapplet.cpp
@@ -61,6 +61,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/Xlib.h>
+#define ICON_MARGIN 1
#define ICON_END_MARGIN KickerSettings::showDeepButtons()?4:0
extern "C"
@@ -299,6 +300,7 @@ void SystemTrayApplet::preferences()
m_iconMarginSB = new TQSpinBox(0, 20, 1, hbox);
m_iconMarginSB->setSuffix(i18n(" px"));
m_iconMarginSB->setValue(m_iconMargin);
+ m_iconMarginSB->setEnabled(false);
m_settingsDialog->show();
}
@@ -947,7 +949,7 @@ void SystemTrayApplet::layoutTray()
int i = 0, line, nbrOfLines, heightWidth;
bool showExpandButton = m_expandButton && m_expandButton->isVisibleTo(this);
delete m_layout;
- m_layout = new TQGridLayout(this, 1, 1, 0, m_iconMargin);
+ m_layout = new TQGridLayout(this, 1, 1, ICON_MARGIN, ICON_MARGIN);
if (m_expandButton)
{
@@ -967,18 +969,18 @@ void SystemTrayApplet::layoutTray()
//
// The margin and spacing specified in the layout implies that:
- // [-- m_iconMargin pixels --] [-- first icon --] [-- m_iconMargin pixels --] ... [-- m_iconMargin pixels --] [-- last icon --] [-- m_iconMargin pixels --]
+ // [-- ICON_MARGIN pixels --] [-- first icon --] [-- ICON_MARGIN pixels --] ... [-- ICON_MARGIN pixels --] [-- last icon --] [-- ICON_MARGIN pixels --]
//
- // So, if we say that iconWidth is the icon width plus the m_iconMargin pixels spacing, then the available width for the icons
- // is the widget width minus m_iconMargin pixels margin. Forgetting these m_iconMargin pixels broke the layout algorithm in KDE <= 3.5.9.
+ // So, if we say that iconWidth is the icon width plus the ICON_MARGIN pixels spacing, then the available width for the icons
+ // is the widget width minus ICON_MARGIN pixels margin. Forgetting these ICON_MARGIN pixels broke the layout algorithm in KDE <= 3.5.9.
//
// This fix makes the workarounds in the heightForWidth() and widthForHeight() methods unneeded.
//
if (orientation() == TQt::Vertical)
{
- int iconWidth = maxIconWidth() + m_iconMargin * 2; // +2 for the margins that implied by the layout
- heightWidth = width() - m_iconMargin * 2;
+ int iconWidth = maxIconWidth() + ICON_MARGIN; // +2 for the margins that implied by the layout
+ heightWidth = width() - ICON_MARGIN;
// to avoid nbrOfLines=0 we ensure heightWidth >= iconWidth!
heightWidth = heightWidth < iconWidth ? iconWidth : heightWidth;
nbrOfLines = heightWidth / iconWidth;
@@ -1054,8 +1056,8 @@ void SystemTrayApplet::layoutTray()
}
else // horizontal
{
- int iconHeight = maxIconHeight() + m_iconMargin * 2; // +2 for the margins that implied by the layout
- heightWidth = height() - m_iconMargin * 2;
+ int iconHeight = maxIconHeight() + ICON_MARGIN; // +2 for the margins that implied by the layout
+ heightWidth = height() - ICON_MARGIN;
heightWidth = heightWidth < iconHeight ? iconHeight : heightWidth; // to avoid nbrOfLines=0
nbrOfLines = heightWidth / iconHeight;