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
v3.5.13-sru
tpearson 13 years ago
parent e98e745f1a
commit 80035308b1

@ -63,6 +63,10 @@ advancedDialog::advancedDialog(TQWidget* parent, const char* name)
this, TQT_SLOT(changed())); this, TQT_SLOT(changed()));
connect(m_advancedWidget->menubarPanelTransparent, TQT_SIGNAL(clicked()), connect(m_advancedWidget->menubarPanelTransparent, TQT_SIGNAL(clicked()),
this, TQT_SLOT(changed())); this, TQT_SLOT(changed()));
connect(m_advancedWidget->kickerResizeHandle, TQT_SIGNAL(clicked()),
this, TQT_SLOT(changed()));
connect(m_advancedWidget->kickerDeepButtons, TQT_SIGNAL(clicked()),
this, TQT_SLOT(changed()));
load(); load();
} }
@ -94,6 +98,11 @@ void advancedDialog::load()
bool transparentMenubarPanel = c.readBoolEntry("MenubarPanelTransparent", false); bool transparentMenubarPanel = c.readBoolEntry("MenubarPanelTransparent", false);
m_advancedWidget->menubarPanelTransparent->setChecked( transparentMenubarPanel ); m_advancedWidget->menubarPanelTransparent->setChecked( transparentMenubarPanel );
bool useKickerResizeHandle = c.readBoolEntry("UseResizeHandle", false);
m_advancedWidget->kickerResizeHandle->setChecked( useKickerResizeHandle );
bool usekickerDeepButtons = c.readBoolEntry("ShowDeepButtons", false);
m_advancedWidget->kickerDeepButtons->setChecked( usekickerDeepButtons );
enableButtonApply(false); enableButtonApply(false);
} }
@ -114,6 +123,10 @@ void advancedDialog::save()
m_advancedWidget->tintSlider->value()); m_advancedWidget->tintSlider->value());
c.writeEntry("MenubarPanelTransparent", c.writeEntry("MenubarPanelTransparent",
m_advancedWidget->menubarPanelTransparent->isChecked()); m_advancedWidget->menubarPanelTransparent->isChecked());
c.writeEntry("UseResizeHandle",
m_advancedWidget->kickerResizeHandle->isChecked());
c.writeEntry("ShowDeepButtons",
m_advancedWidget->kickerDeepButtons->isChecked());
TQStringList elist = c.readListEntry("Extensions2"); TQStringList elist = c.readListEntry("Extensions2");
for (TQStringList::Iterator it = elist.begin(); it != elist.end(); ++it) for (TQStringList::Iterator it = elist.begin(); it != elist.end(); ++it)
@ -144,6 +157,10 @@ void advancedDialog::save()
m_advancedWidget->tintSlider->value()); m_advancedWidget->tintSlider->value());
extConfig.writeEntry("MenubarPanelTransparent", extConfig.writeEntry("MenubarPanelTransparent",
m_advancedWidget->menubarPanelTransparent->isChecked()); m_advancedWidget->menubarPanelTransparent->isChecked());
extConfig.writeEntry("UseResizeHandle",
m_advancedWidget->kickerResizeHandle->isChecked());
extConfig.writeEntry("ShowDeepButtons",
m_advancedWidget->kickerDeepButtons->isChecked());
extConfig.sync(); extConfig.sync();
} }

@ -298,6 +298,41 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="TQGroupBox">
<property name="name">
<cstring>groupBox3</cstring>
</property>
<property name="title">
<string>Texture</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQCheckBox" row="0" column="0" rowspan="0" colspan="2">
<property name="name">
<cstring>kickerResizeHandle</cstring>
</property>
<property name="text">
<string>Show resize handle on panels</string>
</property>
<property name="whatsThis" stdset="0">
<string>Enabling this option will show a resize handle on the resizable end of each panel.</string>
</property>
</widget>
<widget class="TQCheckBox" row="0" column="2" rowspan="0" colspan="2">
<property name="name">
<cstring>kickerDeepButtons</cstring>
</property>
<property name="text">
<string>Use deep buttons</string>
</property>
<property name="whatsThis" stdset="0">
<string>Enabling this option will yield more highly textured panels.</string>
</property>
</widget>
</grid>
</widget>
</vbox> </vbox>
</widget> </widget>
<tabstops> <tabstops>

@ -11,6 +11,7 @@
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/kicker/libkicker
${CMAKE_SOURCE_DIR}/kicker/libkicker ${CMAKE_SOURCE_DIR}/kicker/libkicker
${TDE_INCLUDE_DIR} ${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS}
@ -38,4 +39,5 @@ tde_add_kpart( ${target} AUTOMOC
SOURCES ${${target}_SRCS} SOURCES ${${target}_SRCS}
LINK kickermain-shared LINK kickermain-shared
DESTINATION ${PLUGIN_INSTALL_DIR} DESTINATION ${PLUGIN_INSTALL_DIR}
DEPENDENCIES kicker_core-static kicker-static kicker-shared
) )

@ -27,7 +27,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************/ ******************************************************************/
#include <tqcursor.h> #include <tqcursor.h>
#include <tqlayout.h>
#include <tqpopupmenu.h> #include <tqpopupmenu.h>
#include <tqtimer.h> #include <tqtimer.h>
#include <tqpixmap.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 <kiconloader.h>
#include <kwin.h> #include <kwin.h>
#include "kickerSettings.h"
#include "simplebutton.h" #include "simplebutton.h"
#include "systemtrayapplet.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> #include <X11/Xlib.h>
//#define ICON_MARGIN KickerSettings::showDeepButtons()?2:1
#define ICON_MARGIN 1 #define ICON_MARGIN 1
#define ICON_END_MARGIN KickerSettings::showDeepButtons()?4:0
extern "C" extern "C"
{ {
@ -70,9 +73,11 @@ extern "C"
SystemTrayApplet::SystemTrayApplet(const TQString& configFile, Type type, int actions, SystemTrayApplet::SystemTrayApplet(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name) TQWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name), : KPanelApplet(configFile, type, actions, parent, name),
m_showFrame(false), m_showFrame(KickerSettings::showDeepButtons()?true:false),
m_showHidden(false), m_showHidden(false),
m_expandButton(0), m_expandButton(0),
m_leftSpacer(0),
m_rightSpacer(0),
m_settingsDialog(0), m_settingsDialog(0),
m_iconSelector(0), m_iconSelector(0),
m_autoRetractTimer(0), m_autoRetractTimer(0),
@ -83,6 +88,11 @@ SystemTrayApplet::SystemTrayApplet(const TQString& configFile, Type type, int ac
DCOPObject::setObjId("SystemTrayApplet"); DCOPObject::setObjId("SystemTrayApplet");
loadSettings(); 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); setBackgroundOrigin(AncestorOrigin);
kwin_module = new KWinModule(TQT_TQOBJECT(this)); kwin_module = new KWinModule(TQT_TQOBJECT(this));
@ -445,13 +455,13 @@ void SystemTrayApplet::loadSettings()
{ {
// set our defaults // set our defaults
setFrameStyle(NoFrame); setFrameStyle(NoFrame);
m_showFrame = false; m_showFrame = KickerSettings::showDeepButtons()?true:false;
KConfig *conf = config(); KConfig *conf = config();
conf->reparseConfiguration(); conf->reparseConfiguration();
conf->setGroup("General"); conf->setGroup("General");
if (conf->readBoolEntry("ShowPanelFrame", false)) if (conf->readBoolEntry("ShowPanelFrame", false) || m_showFrame) // Does ShowPanelFrame even exist?
{ {
setFrameStyle(Panel | Sunken); setFrameStyle(Panel | Sunken);
} }
@ -918,13 +928,19 @@ void SystemTrayApplet::layoutTray()
heightWidth = heightWidth < iconWidth ? iconWidth : heightWidth; heightWidth = heightWidth < iconWidth ? iconWidth : heightWidth;
nbrOfLines = heightWidth / iconWidth; nbrOfLines = heightWidth / iconWidth;
m_layout->addMultiCellWidget(m_leftSpacer,
0, 0,
0, nbrOfLines - 1,
Qt::AlignHCenter | Qt::AlignVCenter);
col = 1;
if (showExpandButton) if (showExpandButton)
{ {
m_layout->addMultiCellWidget(m_expandButton, m_layout->addMultiCellWidget(m_expandButton,
0, 0, 1, 1,
0, nbrOfLines - 1, 0, nbrOfLines - 1,
Qt::AlignHCenter | Qt::AlignVCenter); Qt::AlignHCenter | Qt::AlignVCenter);
col = 1; col = 2;
} }
if (m_showHidden) if (m_showHidden)
@ -963,6 +979,11 @@ void SystemTrayApplet::layoutTray()
++i; ++i;
} }
m_layout->addMultiCellWidget(m_rightSpacer,
col, col,
0, nbrOfLines - 1,
Qt::AlignHCenter | Qt::AlignVCenter);
} }
else // horizontal else // horizontal
{ {
@ -971,13 +992,19 @@ void SystemTrayApplet::layoutTray()
heightWidth = heightWidth < iconHeight ? iconHeight : heightWidth; // to avoid nbrOfLines=0 heightWidth = heightWidth < iconHeight ? iconHeight : heightWidth; // to avoid nbrOfLines=0
nbrOfLines = heightWidth / iconHeight; nbrOfLines = heightWidth / iconHeight;
m_layout->addMultiCellWidget(m_leftSpacer,
0, nbrOfLines - 1,
0, 0,
Qt::AlignHCenter | Qt::AlignVCenter);
col = 1;
if (showExpandButton) if (showExpandButton)
{ {
m_layout->addMultiCellWidget(m_expandButton, m_layout->addMultiCellWidget(m_expandButton,
0, nbrOfLines - 1, 0, nbrOfLines - 1,
0, 0, 1, 1,
Qt::AlignHCenter | Qt::AlignVCenter); Qt::AlignHCenter | Qt::AlignVCenter);
col = 1; col = 2;
} }
if (m_showHidden) if (m_showHidden)
@ -1015,6 +1042,11 @@ void SystemTrayApplet::layoutTray()
++i; ++i;
} }
m_layout->addMultiCellWidget(m_rightSpacer,
0, nbrOfLines - 1,
col, col,
Qt::AlignHCenter | Qt::AlignVCenter);
} }
tqsetUpdatesEnabled(true); tqsetUpdatesEnabled(true);

@ -27,6 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <tqvaluevector.h> #include <tqvaluevector.h>
#include <tqstringlist.h> #include <tqstringlist.h>
#include <tqevent.h> #include <tqevent.h>
#include <tqlayout.h>
#include <qxembed.h> #include <qxembed.h>
#include <dcopobject.h> #include <dcopobject.h>
@ -105,6 +106,8 @@ private:
bool m_showFrame; bool m_showFrame;
bool m_showHidden; bool m_showHidden;
SimpleArrowButton *m_expandButton; SimpleArrowButton *m_expandButton;
TQWidget *m_leftSpacer;
TQWidget *m_rightSpacer;
KDialogBase* m_settingsDialog; KDialogBase* m_settingsDialog;
KActionSelector* m_iconSelector; KActionSelector* m_iconSelector;
TQTimer* m_autoRetractTimer; TQTimer* m_autoRetractTimer;

@ -22,6 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************/ ******************************************************************/
#include <tqtooltip.h> #include <tqtooltip.h>
#include <tqstyle.h>
#include <klocale.h> #include <klocale.h>
#include <kapplication.h> #include <kapplication.h>
@ -39,7 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "kbutton.moc" #include "kbutton.moc"
KButton::KButton( TQWidget* parent ) KButton::KButton( TQWidget* parent )
: PanelPopupButton( parent, "KButton" ) : PanelPopupButton( parent, "KButton", KickerSettings::showDeepButtons() )
{ {
TQToolTip::add(this, i18n("Applications, tasks and desktop sessions")); TQToolTip::add(this, i18n("Applications, tasks and desktop sessions"));
setTitle(i18n("K Menu")); setTitle(i18n("K Menu"));
@ -79,3 +80,10 @@ void KButton::initPopup()
MenuManager::the()->kmenu()->initialize(); MenuManager::the()->kmenu()->initialize();
} }
void KButton::drawButton(TQPainter *p)
{
if (KickerSettings::showDeepButtons())
PanelPopupButton::drawDeepButton(p);
else
PanelPopupButton::drawButton(p);
}

@ -45,6 +45,7 @@ protected:
virtual TQString tileName() { return "KMenu"; } virtual TQString tileName() { return "KMenu"; }
virtual void initPopup(); virtual void initPopup();
virtual TQString defaultIcon() const { return "go"; } virtual TQString defaultIcon() const { return "go"; }
virtual void drawButton(TQPainter *);
}; };
#endif #endif

@ -32,6 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <tqtimer.h> #include <tqtimer.h>
#include <tqtooltip.h> #include <tqtooltip.h>
#include <tqvbox.h> #include <tqvbox.h>
#include <tqimage.h>
#include <tqstyle.h>
#include <qxembed.h> #include <qxembed.h>
#include <tqcolor.h> #include <tqcolor.h>
@ -67,6 +69,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define PANEL_SPEED_MULTIPLIER 10.0 #define PANEL_SPEED_MULTIPLIER 10.0
#define PANEL_SPEED(x, c) (int)(((1.0-2.0*fabs((x)-(c)/2.0)/c)*m_settings.hideAnimationSpeed()+1.0)*PANEL_SPEED_MULTIPLIER) #define PANEL_SPEED(x, c) (int)(((1.0-2.0*fabs((x)-(c)/2.0)/c)*m_settings.hideAnimationSpeed()+1.0)*PANEL_SPEED_MULTIPLIER)
// #define PANEL_RESIZE_HANDLE_WIDTH 3
// #define PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE 2
// #define PANEL_RESIZE_HANDLE_WIDTH 4
// #define PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE 2
#define PANEL_RESIZE_HANDLE_WIDTH 6
#define PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE 0
ExtensionContainer::ExtensionContainer(const AppletInfo& info, ExtensionContainer::ExtensionContainer(const AppletInfo& info,
const TQString& extensionId, const TQString& extensionId,
TQWidget *parent) TQWidget *parent)
@ -109,6 +120,7 @@ ExtensionContainer::ExtensionContainer(KPanelExtension* extension,
_info(info), _info(info),
_ltHB(0), _ltHB(0),
_rbHB(0), _rbHB(0),
_resizeHandle(0),
m_extension(extension), m_extension(extension),
m_maintainFocus(0), m_maintainFocus(0),
m_panelOrder(ExtensionManager::the()->nextPanelOrder()) m_panelOrder(ExtensionManager::the()->nextPanelOrder())
@ -223,6 +235,11 @@ TQSize ExtensionContainer::tqsizeHint(KPanelExtension::Position p, const TQSize
height += 1; // border height += 1; // border
} }
if (KickerSettings::useResizeHandle())
{
height += (PANEL_RESIZE_HANDLE_WIDTH + PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE); // resize handle area
}
if (m_settings.showLeftHideButton()) if (m_settings.showLeftHideButton())
{ {
width += m_settings.hideButtonSize(); width += m_settings.hideButtonSize();
@ -243,6 +260,11 @@ TQSize ExtensionContainer::tqsizeHint(KPanelExtension::Position p, const TQSize
width += 1; // border width += 1; // border
} }
if (KickerSettings::useResizeHandle())
{
width += (PANEL_RESIZE_HANDLE_WIDTH + PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE); // resize handle area
}
if (m_settings.showLeftHideButton()) if (m_settings.showLeftHideButton())
{ {
height += m_settings.hideButtonSize(); height += m_settings.hideButtonSize();
@ -1186,6 +1208,11 @@ int ExtensionContainer::arrangeHideButtons()
--maxWidth; --maxWidth;
} }
if (KickerSettings::useResizeHandle())
{
maxWidth = maxWidth - (PANEL_RESIZE_HANDLE_WIDTH + PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE);
}
if (_ltHB) if (_ltHB)
{ {
_ltHB->setMaximumWidth(maxWidth); _ltHB->setMaximumWidth(maxWidth);
@ -1211,6 +1238,11 @@ int ExtensionContainer::arrangeHideButtons()
--maxHeight; --maxHeight;
} }
if (KickerSettings::useResizeHandle())
{
maxHeight = maxHeight - (PANEL_RESIZE_HANDLE_WIDTH + PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE);
}
int vertAlignment = (position() == KPanelExtension::Top) ? Qt::AlignTop : 0; int vertAlignment = (position() == KPanelExtension::Top) ? Qt::AlignTop : 0;
int leftAlignment = Qt::AlignRight; int leftAlignment = Qt::AlignRight;
@ -1261,11 +1293,15 @@ int ExtensionContainer::setupBorderSpace()
_layout->setColSpacing(0, 0); _layout->setColSpacing(0, 0);
_layout->setColSpacing(2, 0); _layout->setColSpacing(2, 0);
if (!needsBorder()) if (!needsBorder() && !KickerSettings::useResizeHandle())
{ {
return 0; return 0;
} }
int borderWidth = 1;
if (KickerSettings::useResizeHandle())
borderWidth = PANEL_RESIZE_HANDLE_WIDTH + PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE;
int layoutOffset = 0; int layoutOffset = 0;
TQRect r = TQApplication::desktop()->screenGeometry(xineramaScreen()); TQRect r = TQApplication::desktop()->screenGeometry(xineramaScreen());
TQRect h = geometry(); TQRect h = geometry();
@ -1274,14 +1310,14 @@ int ExtensionContainer::setupBorderSpace()
{ {
if (h.top() > 0) if (h.top() > 0)
{ {
int topHeight = (_ltHB && _ltHB->isVisibleTo(this)) ? _ltHB->height() + 1 : 1; int topHeight = (_ltHB && _ltHB->isVisibleTo(this)) ? _ltHB->height() + borderWidth : borderWidth;
_layout->setRowSpacing(0, topHeight); _layout->setRowSpacing(0, topHeight);
++layoutOffset; ++layoutOffset;
} }
if (h.bottom() < r.bottom()) if (h.bottom() < r.bottom())
{ {
int bottomHeight = (_rbHB && _rbHB->isVisibleTo(this)) ? _rbHB->height() + 1 : 1; int bottomHeight = (_rbHB && _rbHB->isVisibleTo(this)) ? _rbHB->height() + borderWidth : borderWidth;
_layout->setRowSpacing(1, bottomHeight); _layout->setRowSpacing(1, bottomHeight);
++layoutOffset; ++layoutOffset;
} }
@ -1290,14 +1326,14 @@ int ExtensionContainer::setupBorderSpace()
{ {
if (h.left() > 0) if (h.left() > 0)
{ {
int leftWidth = (_ltHB && _ltHB->isVisibleTo(this)) ? _ltHB->width() + 1 : 1; int leftWidth = (_ltHB && _ltHB->isVisibleTo(this)) ? _ltHB->width() + borderWidth : borderWidth;
_layout->setColSpacing(0, leftWidth); _layout->setColSpacing(0, leftWidth);
++layoutOffset; ++layoutOffset;
} }
if (h.right() < r.right()) if (h.right() < r.right())
{ {
int rightWidth = (_rbHB && _rbHB->isVisibleTo(this)) ? _rbHB->width() + 1 : 1; int rightWidth = (_rbHB && _rbHB->isVisibleTo(this)) ? _rbHB->width() + borderWidth : borderWidth;
_layout->setColSpacing(1, rightWidth); _layout->setColSpacing(1, rightWidth);
++layoutOffset; ++layoutOffset;
} }
@ -1306,20 +1342,20 @@ int ExtensionContainer::setupBorderSpace()
switch (position()) switch (position())
{ {
case KPanelExtension::Left: case KPanelExtension::Left:
_layout->setColSpacing(2, 1); _layout->setColSpacing(2, PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE);
break; break;
case KPanelExtension::Right: case KPanelExtension::Right:
_layout->setColSpacing(0, 1); _layout->setColSpacing(0, PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE);
break; break;
case KPanelExtension::Top: case KPanelExtension::Top:
_layout->setRowSpacing(2, 1); _layout->setRowSpacing(2, PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE);
break; break;
case KPanelExtension::Bottom: case KPanelExtension::Bottom:
default: default:
_layout->setRowSpacing(0, 1); _layout->setRowSpacing(0, PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE);
break; break;
} }
@ -1361,6 +1397,39 @@ void ExtensionContainer::paintEvent(TQPaintEvent *e)
p.setPen(palette().color(TQPalette::Active, TQColorGroup::Mid)); p.setPen(palette().color(TQPalette::Active, TQColorGroup::Mid));
p.drawRect(0, 0, width(), height()); p.drawRect(0, 0, width(), height());
} }
if (KickerSettings::useResizeHandle())
{
// draw resize handle [RAJA]
TQRect rect;
TQPainter p( this );
// FIXME
// KPanelExtension::Left/Right don't seem to draw the separators at all!
if (position() == KPanelExtension::Left) {
rect = TQRect(width()-2,0,PANEL_RESIZE_HANDLE_WIDTH,height());
tqstyle().tqdrawPrimitive( TQStyle::PE_Separator, &p, rect, tqcolorGroup(), TQStyle::Style_Horizontal );
}
else if (position() == KPanelExtension::Right) {
rect = TQRect(0,0,PANEL_RESIZE_HANDLE_WIDTH,height());
tqstyle().tqdrawPrimitive( TQStyle::PE_Separator, &p, rect, tqcolorGroup(), TQStyle::Style_Horizontal );
}
else if (position() == KPanelExtension::Top) {
// Nastiness to both vertically flip the PE_Separator
// and make sure it pops out of, not sinks into, the screen
TQPixmap inv_pm(width(),PANEL_RESIZE_HANDLE_WIDTH);
TQPainter myp(TQT_TQPAINTDEVICE(&inv_pm));
rect = TQRect(0,0,width(),PANEL_RESIZE_HANDLE_WIDTH);
TQColorGroup darkcg = tqcolorGroup();
darkcg.setColor(TQColorGroup::Light, tqcolorGroup().dark());
tqstyle().tqdrawPrimitive( TQStyle::PE_Separator, &myp, rect, darkcg, TQStyle::Style_Default );
p.drawPixmap(0,height()-2,inv_pm);
}
else {
rect = TQRect(0,0,width(),PANEL_RESIZE_HANDLE_WIDTH);
tqstyle().tqdrawPrimitive( TQStyle::PE_Separator, &p, rect, tqcolorGroup(), TQStyle::Style_Default );
}
}
} }
void ExtensionContainer::leaveEvent(TQEvent*) void ExtensionContainer::leaveEvent(TQEvent*)
@ -1469,7 +1538,7 @@ void ExtensionContainer::arrange(KPanelExtension::Position p,
{ {
m_settings.setPosition(p); m_settings.setPosition(p);
} }
else if (!needsBorder()) else if (!needsBorder() && !KickerSettings::useResizeHandle())
{ {
// this ensures that the layout gets rejigged // this ensures that the layout gets rejigged
// even if position doesn't change // even if position doesn't change
@ -1653,6 +1722,10 @@ void ExtensionContainer::resetLayout()
{ {
m_extension->setFixedHeight(height() - 1); m_extension->setFixedHeight(height() - 1);
} }
else if (KickerSettings::useResizeHandle())
{
m_extension->setFixedHeight(height() - (PANEL_RESIZE_HANDLE_WIDTH + PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE));
}
else else
{ {
m_extension->setFixedHeight(height()); m_extension->setFixedHeight(height());
@ -1679,6 +1752,10 @@ void ExtensionContainer::resetLayout()
{ {
m_extension->setFixedWidth(width() - 1); m_extension->setFixedWidth(width() - 1);
} }
else if (KickerSettings::useResizeHandle())
{
m_extension->setFixedWidth(width() - (PANEL_RESIZE_HANDLE_WIDTH + PANEL_BOTTOM_SPACING_W_RESIZE_HANDLE));
}
else else
{ {
m_extension->setFixedWidth(width()); m_extension->setFixedWidth(width());
@ -1690,7 +1767,7 @@ void ExtensionContainer::resetLayout()
bool ExtensionContainer::needsBorder() const bool ExtensionContainer::needsBorder() const
{ {
return !KickerSettings::transparent(); return !KickerSettings::transparent() && !KickerSettings::useResizeHandle();
//&& !KickerSettings::useBackgroundTheme(); //&& !KickerSettings::useBackgroundTheme();
} }

@ -190,7 +190,8 @@ private:
// Widgets // Widgets
HideButton *_ltHB; // Left Hide Button HideButton *_ltHB; // Left Hide Button
HideButton *_rbHB; // Right Hide Button HideButton *_rbHB; // Right Hide Button
TQGridLayout *_layout; TQGridLayout *_layout;
TQWidget *_resizeHandle;
KPanelExtension *m_extension; KPanelExtension *m_extension;
int m_maintainFocus; int m_maintainFocus;

@ -1513,6 +1513,24 @@ void ContainerArea::setBackground()
TQTimer::singleShot(0, this, TQT_SLOT(updateContainersBackground())); TQTimer::singleShot(0, this, TQT_SLOT(updateContainersBackground()));
} }
} }
// else { // RAJA
// TQRect rect;
// TQImage bgImage;
// TQPixmap bgPixmap(size().width(), size().height());
// bgPixmap.fill(tqcolorGroup().background());
// TQPainter p( TQT_TQPAINTDEVICE(&bgPixmap) );
//
// // FIXME This should change the rectangle based on the container's location on the screen (top, bottom, etc.)
// rect = TQRect(0,0,size().width(),2);
// tqstyle().tqdrawPrimitive( TQStyle::PE_DockWindowSeparator, &p, rect, tqcolorGroup(), TQStyle::Style_Default );
//
// printf("[RAJA DEBUG 100.0] Hi there!\n\r"); fflush(stdout);
// p.fillRect(0,0,100,100,TQColor(0,0,0));
//
// bgImage = bgPixmap;
// setPaletteBackgroundPixmap(TQPixmap(bgImage));
// TQTimer::singleShot(0, this, TQT_SLOT(updateContainersBackground()));
// }
_bgSet = true; _bgSet = true;
} }

@ -26,6 +26,17 @@
<default>false</default> <default>false</default>
</entry> </entry>
<entry name="UseResizeHandle" type="Bool" >
<label>Enable resize handles</label>
<whatsthis>When this option is enabled, the panel will provide a resize handle on order to change its width via click-and-drag</whatsthis>
<default>false</default>
</entry>
<entry name="ShowDeepButtons" type="Bool" >
<label>Make the task buttons push further into the screen when activated</label>
<default>false</default>
</entry>
<entry name="MenubarPanelTransparent" type="Bool" > <entry name="MenubarPanelTransparent" type="Bool" >
<label>Enable transparency for menubar panel</label> <label>Enable transparency for menubar panel</label>
<whatsthis>When this option is enabled, the panel containing the menubar will become pseudo-transparent as well</whatsthis> <whatsthis>When this option is enabled, the panel containing the menubar will become pseudo-transparent as well</whatsthis>

@ -56,23 +56,27 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "panelbutton.h" #include "panelbutton.h"
#include "panelbutton.moc" #include "panelbutton.moc"
// For now link these two
#define m_disableHighlighting m_forceStandardCursor
// init static variable // init static variable
KShadowEngine* PanelButton::s_textShadowEngine = 0L; KShadowEngine* PanelButton::s_textShadowEngine = 0L;
PanelButton::PanelButton( TQWidget* parent, const char* name ) PanelButton::PanelButton( TQWidget* parent, const char* name, bool forceStandardCursor )
: TQButton(parent, name), : TQButton(parent, name),
m_valid(true), m_valid(true),
m_isLeftMouseButtonDown(false), m_isLeftMouseButtonDown(false),
m_drawArrow(false), m_drawArrow(false),
m_highlight(false), m_highlight(false),
m_changeCursorOverItem(true), m_changeCursorOverItem(forceStandardCursor?false:true),
m_hasAcceptedDrag(false), m_hasAcceptedDrag(false),
m_arrowDirection(KPanelExtension::Bottom), m_arrowDirection(KPanelExtension::Bottom),
m_popupDirection(KPanelApplet::Up), m_popupDirection(KPanelApplet::Up),
m_iconAlignment(AlignCenter), m_iconAlignment(AlignCenter),
m_orientation(Qt::Horizontal), m_orientation(Qt::Horizontal),
m_size((KIcon::StdSizes)-1), m_size((KIcon::StdSizes)-1),
m_fontPercent(0.40) m_fontPercent(0.40),
m_forceStandardCursor(forceStandardCursor)
{ {
setBackgroundOrigin(AncestorOrigin); setBackgroundOrigin(AncestorOrigin);
setWFlags(TQt::WNoAutoErase); setWFlags(TQt::WNoAutoErase);
@ -220,7 +224,10 @@ void PanelButton::updateSettings(int category)
return; return;
} }
m_changeCursorOverItem = KGlobalSettings::changeCursorOverIcon(); if (m_forceStandardCursor == FALSE)
m_changeCursorOverItem = KGlobalSettings::changeCursorOverIcon();
else
m_changeCursorOverItem = FALSE;
if (m_changeCursorOverItem) if (m_changeCursorOverItem)
{ {
@ -319,7 +326,10 @@ int PanelButton::heightForWidth(int width) const
const TQPixmap& PanelButton::labelIcon() const const TQPixmap& PanelButton::labelIcon() const
{ {
return m_highlight ? m_iconh : m_icon; if (m_disableHighlighting)
return m_icon;
else
return m_highlight ? m_iconh : m_icon;
} }
const TQPixmap& PanelButton::zoomIcon() const const TQPixmap& PanelButton::zoomIcon() const
@ -425,7 +435,7 @@ void PanelButton::startDrag()
void PanelButton::enterEvent(TQEvent* e) void PanelButton::enterEvent(TQEvent* e)
{ {
if (!m_highlight) if (!m_highlight && m_disableHighlighting == FALSE)
{ {
m_highlight = true; m_highlight = true;
tqrepaint(false); tqrepaint(false);
@ -564,7 +574,51 @@ void PanelButton::drawButton(TQPainter *p)
} }
} }
void PanelButton::drawDeepButton(TQPainter *p)
{
const TQPixmap& tile = (isDown() || isOn()) ? m_down : m_up;
if (m_tileColor.isValid())
{
p->fillRect(rect(), m_tileColor);
tqstyle().tqdrawPrimitive(TQStyle::PE_Panel, p, rect(), tqcolorGroup());
}
else if (paletteBackgroundPixmap())
{
// Draw the background. This is always needed, even when using tiles,
// because they don't have to cover the entire button.
TQPoint offset = backgroundOffset();
int ox = offset.x();
int oy = offset.y();
p->drawTiledPixmap( 0, 0, width(), height(),*paletteBackgroundPixmap(), ox, oy);
}
TQRect btn_rect = TQRect(rect().x(), rect().y()+1, rect().width(), rect().height()-2);
if (isDown() || isOn()) {
tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonBevel, p, btn_rect, tqcolorGroup(), TQStyle::Style_Down);
}
else {
tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonBevel, p, btn_rect, tqcolorGroup(), TQStyle::Style_Raised);
}
drawButtonLabel(p,0,FALSE);
if (hasFocus() || m_hasAcceptedDrag)
{
int x1, y1, x2, y2;
TQT_TQRECT_OBJECT(rect()).coords(&x1, &y1, &x2, &y2);
TQRect r(x1+2, y1+2, x2-x1-3, y2-y1-3);
tqstyle().tqdrawPrimitive(TQStyle::PE_FocusRect, p, r, tqcolorGroup(),
TQStyle::Style_Default, tqcolorGroup().button());
}
}
void PanelButton::drawButtonLabel(TQPainter *p) void PanelButton::drawButtonLabel(TQPainter *p)
{
drawButtonLabel(p,0,TRUE);
}
void PanelButton::drawButtonLabel(TQPainter *p, int voffset, bool drawArrow)
{ {
TQPixmap icon = labelIcon(); TQPixmap icon = labelIcon();
bool active = isDown() || isOn(); bool active = isDown() || isOn();
@ -604,7 +658,7 @@ void PanelButton::drawButtonLabel(TQPainter *p)
if (!reverse && !icon.isNull()) if (!reverse && !icon.isNull())
{ {
/* Draw icon */ /* Draw icon */
p->drawPixmap(3, y, icon); p->drawPixmap(3, y+voffset, icon);
} }
int tX = reverse ? 3 : icon.width() + KMIN(25, KMAX(5, fm.width('m') / 2)); int tX = reverse ? 3 : icon.width() + KMIN(25, KMAX(5, fm.width('m') / 2));
@ -641,12 +695,12 @@ void PanelButton::drawButtonLabel(TQPainter *p)
p->drawImage(0, 0, img); p->drawImage(0, 0, img);
p->save(); p->save();
p->setPen(m_textColor); p->setPen(m_textColor);
p->drawText(tX, tY, m_buttonText, -1, rtl); p->drawText(tX, tY+voffset, m_buttonText, -1, rtl);
p->restore(); p->restore();
if (reverse && !icon.isNull()) if (reverse && !icon.isNull())
{ {
p->drawPixmap(w - icon.width() - 3, y, icon); p->drawPixmap(w - icon.width() - 3, y+voffset, icon);
} }
p->restore(); p->restore();
@ -658,10 +712,10 @@ void PanelButton::drawButtonLabel(TQPainter *p)
x = (width() - icon.width()) / 2; x = (width() - icon.width()) / 2;
else if (m_iconAlignment & AlignRight) else if (m_iconAlignment & AlignRight)
x = (width() - icon.width()); x = (width() - icon.width());
p->drawPixmap(x, y, icon); p->drawPixmap(x, y+voffset, icon);
} }
if (m_drawArrow && (m_highlight || active)) if (m_drawArrow && (m_highlight || active) && drawArrow)
{ {
TQStyle::PrimitiveElement e = TQStyle::PE_ArrowUp; TQStyle::PrimitiveElement e = TQStyle::PE_ArrowUp;
int arrowSize = tqstyle().tqpixelMetric(TQStyle::PM_MenuButtonIndicator); int arrowSize = tqstyle().tqpixelMetric(TQStyle::PM_MenuButtonIndicator);
@ -887,8 +941,8 @@ void PanelButton::updateKickerTip(KickerTip::Data& data)
// PanelPopupButton class // PanelPopupButton class
// //
PanelPopupButton::PanelPopupButton(TQWidget *parent, const char *name) PanelPopupButton::PanelPopupButton(TQWidget *parent, const char *name, bool forceStandardCursor)
: PanelButton(parent, name), : PanelButton(parent, name, forceStandardCursor),
m_popup(0), m_popup(0),
m_pressedDuringPopup(false), m_pressedDuringPopup(false),
m_initialized(false) m_initialized(false)

@ -53,7 +53,7 @@ public:
* @param parent the parent widget * @param parent the parent widget
* @param name the widget's name * @param name the widget's name
*/ */
PanelButton( TQWidget* parent, const char* name ); PanelButton( TQWidget* parent, const char* name, bool forceStandardCursor = FALSE );
/** /**
* Configures this button according to the user's preferences for * Configures this button according to the user's preferences for
@ -294,7 +294,9 @@ protected:
virtual void mouseReleaseEvent(TQMouseEvent *); virtual void mouseReleaseEvent(TQMouseEvent *);
virtual void resizeEvent(TQResizeEvent*); virtual void resizeEvent(TQResizeEvent*);
virtual void drawButton(TQPainter *); virtual void drawButton(TQPainter *);
virtual void drawDeepButton(TQPainter *);
virtual void drawButtonLabel(TQPainter *); virtual void drawButtonLabel(TQPainter *);
virtual void drawButtonLabel(TQPainter *, int voffset, bool drawArrow);
/** /**
* @return the preferred icon size. * @return the preferred icon size.
@ -397,6 +399,7 @@ private:
Orientation m_orientation; Orientation m_orientation;
int m_size; int m_size;
double m_fontPercent; double m_fontPercent;
bool m_forceStandardCursor;
static KShadowEngine* s_textShadowEngine; static KShadowEngine* s_textShadowEngine;
class PanelPopupPrivate; class PanelPopupPrivate;
@ -416,7 +419,7 @@ public:
* @param parent the parent widget * @param parent the parent widget
* @param name the widget's name * @param name the widget's name
*/ */
PanelPopupButton(TQWidget *parent=0, const char *name=0); PanelPopupButton(TQWidget *parent=0, const char *name=0, bool forceStandardCursor = FALSE);
/** /**
* Sets the button's popup menu. * Sets the button's popup menu.

@ -690,7 +690,7 @@ void TaskBar::reLayout()
} }
// needed because Panner doesn't know how big it's contents are so it's // needed because Panner doesn't know how big it's contents are so it's
// up to use to initialize it. =( // up to us to initialize it. =(
resizeContents(contentsRect().width(), contentsRect().height()); resizeContents(contentsRect().width(), contentsRect().height());
// number of rows simply depends on our height which is either the // number of rows simply depends on our height which is either the

@ -586,9 +586,16 @@ void TaskContainer::drawButton(TQPainter *p)
// draw button background // draw button background
if (drawButton) if (drawButton)
{ {
tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonTool, p, if (KickerSettings::showDeepButtons()) {
tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonBevel, p,
TQRect(1, 1, width()-3, height()-2),
colors, sunken ? TQStyle::Style_On : TQStyle::Style_Raised);
}
else {
tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonTool, p,
TQRect(1, 1, width()-2, height()-2), TQRect(1, 1, width()-2, height()-2),
colors, sunken ? TQStyle::Style_Down : TQStyle::Style_Raised); colors, sunken ? TQStyle::Style_Down : TQStyle::Style_Raised);
}
} }
// shift button label on sunken buttons // shift button label on sunken buttons
@ -688,7 +695,7 @@ void TaskContainer::drawButton(TQPainter *p)
} }
} }
int availableWidth = width() - (br.x() * 2) - textPos - 2; int availableWidth = width() - (br.x() * 2) - textPos - 2 - KickerSettings::showDeepButtons()?2:0;
if (m_filteredTasks.count() > 1) if (m_filteredTasks.count() > 1)
{ {
availableWidth -= 8; availableWidth -= 8;

Loading…
Cancel
Save