summaryrefslogtreecommitdiffstats
path: root/kicker/applets/systemtray
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-04 08:18:22 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-04 08:18:22 +0000
commit80035308b1907d75e7e09be7c8f6e14098edd533 (patch)
treed089bef7060df95dd21096b3e3f699036e617f02 /kicker/applets/systemtray
parente98e745f1a8b79a0444e6a4d60b0cb5c1b1f1ce0 (diff)
downloadtdebase-80035308b1907d75e7e09be7c8f6e14098edd533.tar.gz
tdebase-80035308b1907d75e7e09be7c8f6e14098edd533.zip
Add initial support for Kicker "Deep Buttons", a more highly textured style than the normal "flat" Kicker GUI
Add preliminary GUI and configuration structures needed for hot-resizing panels git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1244835 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker/applets/systemtray')
-rw-r--r--kicker/applets/systemtray/CMakeLists.txt2
-rw-r--r--kicker/applets/systemtray/systemtrayapplet.cpp48
-rw-r--r--kicker/applets/systemtray/systemtrayapplet.h3
3 files changed, 45 insertions, 8 deletions
diff --git a/kicker/applets/systemtray/CMakeLists.txt b/kicker/applets/systemtray/CMakeLists.txt
index 9dc4f41ae..cd3fd6348 100644
--- a/kicker/applets/systemtray/CMakeLists.txt
+++ b/kicker/applets/systemtray/CMakeLists.txt
@@ -11,6 +11,7 @@
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/kicker/libkicker
${CMAKE_SOURCE_DIR}/kicker/libkicker
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
@@ -38,4 +39,5 @@ tde_add_kpart( ${target} AUTOMOC
SOURCES ${${target}_SRCS}
LINK kickermain-shared
DESTINATION ${PLUGIN_INSTALL_DIR}
+ DEPENDENCIES kicker_core-static kicker-static kicker-shared
)
diff --git a/kicker/applets/systemtray/systemtrayapplet.cpp b/kicker/applets/systemtray/systemtrayapplet.cpp
index c347108cc..ceeebc381 100644
--- a/kicker/applets/systemtray/systemtrayapplet.cpp
+++ b/kicker/applets/systemtray/systemtrayapplet.cpp
@@ -27,7 +27,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************/
#include <tqcursor.h>
-#include <tqlayout.h>
#include <tqpopupmenu.h>
#include <tqtimer.h>
#include <tqpixmap.h>
@@ -48,6 +47,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <kiconloader.h>
#include <kwin.h>
+#include "kickerSettings.h"
+
#include "simplebutton.h"
#include "systemtrayapplet.h"
@@ -55,7 +56,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/Xlib.h>
+//#define ICON_MARGIN KickerSettings::showDeepButtons()?2:1
#define ICON_MARGIN 1
+#define ICON_END_MARGIN KickerSettings::showDeepButtons()?4:0
extern "C"
{
@@ -70,9 +73,11 @@ extern "C"
SystemTrayApplet::SystemTrayApplet(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name),
- m_showFrame(false),
+ m_showFrame(KickerSettings::showDeepButtons()?true:false),
m_showHidden(false),
m_expandButton(0),
+ m_leftSpacer(0),
+ m_rightSpacer(0),
m_settingsDialog(0),
m_iconSelector(0),
m_autoRetractTimer(0),
@@ -83,6 +88,11 @@ SystemTrayApplet::SystemTrayApplet(const TQString& configFile, Type type, int ac
DCOPObject::setObjId("SystemTrayApplet");
loadSettings();
+ m_leftSpacer = new TQWidget(this);
+ m_leftSpacer->setFixedSize(ICON_END_MARGIN,1);
+ m_rightSpacer = new TQWidget(this);
+ m_rightSpacer->setFixedSize(ICON_END_MARGIN,1);
+
setBackgroundOrigin(AncestorOrigin);
kwin_module = new KWinModule(TQT_TQOBJECT(this));
@@ -445,13 +455,13 @@ void SystemTrayApplet::loadSettings()
{
// set our defaults
setFrameStyle(NoFrame);
- m_showFrame = false;
+ m_showFrame = KickerSettings::showDeepButtons()?true:false;
KConfig *conf = config();
conf->reparseConfiguration();
conf->setGroup("General");
- if (conf->readBoolEntry("ShowPanelFrame", false))
+ if (conf->readBoolEntry("ShowPanelFrame", false) || m_showFrame) // Does ShowPanelFrame even exist?
{
setFrameStyle(Panel | Sunken);
}
@@ -918,13 +928,19 @@ void SystemTrayApplet::layoutTray()
heightWidth = heightWidth < iconWidth ? iconWidth : heightWidth;
nbrOfLines = heightWidth / iconWidth;
+ m_layout->addMultiCellWidget(m_leftSpacer,
+ 0, 0,
+ 0, nbrOfLines - 1,
+ Qt::AlignHCenter | Qt::AlignVCenter);
+ col = 1;
+
if (showExpandButton)
{
m_layout->addMultiCellWidget(m_expandButton,
- 0, 0,
+ 1, 1,
0, nbrOfLines - 1,
Qt::AlignHCenter | Qt::AlignVCenter);
- col = 1;
+ col = 2;
}
if (m_showHidden)
@@ -963,6 +979,11 @@ void SystemTrayApplet::layoutTray()
++i;
}
+
+ m_layout->addMultiCellWidget(m_rightSpacer,
+ col, col,
+ 0, nbrOfLines - 1,
+ Qt::AlignHCenter | Qt::AlignVCenter);
}
else // horizontal
{
@@ -971,13 +992,19 @@ void SystemTrayApplet::layoutTray()
heightWidth = heightWidth < iconHeight ? iconHeight : heightWidth; // to avoid nbrOfLines=0
nbrOfLines = heightWidth / iconHeight;
+ m_layout->addMultiCellWidget(m_leftSpacer,
+ 0, nbrOfLines - 1,
+ 0, 0,
+ Qt::AlignHCenter | Qt::AlignVCenter);
+ col = 1;
+
if (showExpandButton)
{
m_layout->addMultiCellWidget(m_expandButton,
0, nbrOfLines - 1,
- 0, 0,
+ 1, 1,
Qt::AlignHCenter | Qt::AlignVCenter);
- col = 1;
+ col = 2;
}
if (m_showHidden)
@@ -1015,6 +1042,11 @@ void SystemTrayApplet::layoutTray()
++i;
}
+
+ m_layout->addMultiCellWidget(m_rightSpacer,
+ 0, nbrOfLines - 1,
+ col, col,
+ Qt::AlignHCenter | Qt::AlignVCenter);
}
tqsetUpdatesEnabled(true);
diff --git a/kicker/applets/systemtray/systemtrayapplet.h b/kicker/applets/systemtray/systemtrayapplet.h
index f66e0caa5..c656cfe3d 100644
--- a/kicker/applets/systemtray/systemtrayapplet.h
+++ b/kicker/applets/systemtray/systemtrayapplet.h
@@ -27,6 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <tqvaluevector.h>
#include <tqstringlist.h>
#include <tqevent.h>
+#include <tqlayout.h>
#include <qxembed.h>
#include <dcopobject.h>
@@ -105,6 +106,8 @@ private:
bool m_showFrame;
bool m_showHidden;
SimpleArrowButton *m_expandButton;
+ TQWidget *m_leftSpacer;
+ TQWidget *m_rightSpacer;
KDialogBase* m_settingsDialog;
KActionSelector* m_iconSelector;
TQTimer* m_autoRetractTimer;