summaryrefslogtreecommitdiffstats
path: root/kicker/applets/systemtray/systemtrayapplet.cpp
diff options
context:
space:
mode:
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;