From 80035308b1907d75e7e09be7c8f6e14098edd533 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 4 Aug 2011 08:18:22 +0000 Subject: 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 --- kicker/applets/systemtray/systemtrayapplet.cpp | 48 +++++++++++++++++++++----- 1 file changed, 40 insertions(+), 8 deletions(-) (limited to 'kicker/applets/systemtray/systemtrayapplet.cpp') 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 -#include #include #include #include @@ -48,6 +47,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include +#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 +//#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); -- cgit v1.2.1