summaryrefslogtreecommitdiffstats
path: root/kicker/taskbar
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-12-30 20:54:16 -0600
committerTimothy Pearson <[email protected]>2012-12-30 20:54:16 -0600
commitce3da132361e281919a222a519ff9901c8d6c3e1 (patch)
treee622ebded549e5f7c87a0cb1ab56a7a974032098 /kicker/taskbar
parent4d3d2420430fb53000ceda25ae7498e49f6e94b2 (diff)
downloadtdebase-ce3da132361e281919a222a519ff9901c8d6c3e1.tar.gz
tdebase-ce3da132361e281919a222a519ff9901c8d6c3e1.zip
Fix media:/ kioslave handling of audio CDs
Allow separate settings for each taskbar applet Add mouse-driven Kicker resize support
Diffstat (limited to 'kicker/taskbar')
-rw-r--r--kicker/taskbar/taskbar.cpp63
-rw-r--r--kicker/taskbar/taskbar.h3
-rw-r--r--kicker/taskbar/taskbar.kcfg2
-rw-r--r--kicker/taskbar/taskbarcontainer.cpp38
-rw-r--r--kicker/taskbar/taskbarcontainer.h7
-rw-r--r--kicker/taskbar/taskbarsettings.kcfgc2
-rw-r--r--kicker/taskbar/taskcontainer.cpp97
-rw-r--r--kicker/taskbar/taskcontainer.h8
8 files changed, 129 insertions, 91 deletions
diff --git a/kicker/taskbar/taskbar.cpp b/kicker/taskbar/taskbar.cpp
index dd66c22b2..fdb7e0ebf 100644
--- a/kicker/taskbar/taskbar.cpp
+++ b/kicker/taskbar/taskbar.cpp
@@ -50,7 +50,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "taskbar.moc"
-TaskBar::TaskBar( TQWidget *parent, const char *name )
+TaskBar::TaskBar( TaskBarSettings* settingsObject, TQWidget *parent, const char *name )
: Panner( parent, name ),
m_showAllWindows(false),
m_cycleWheel(false),
@@ -66,7 +66,13 @@ TaskBar::TaskBar( TQWidget *parent, const char *name )
{
arrowType = LeftArrow;
blocklayout = true;
-
+
+ m_settingsObject = settingsObject;
+ if (m_settingsObject)
+ {
+ m_settingsObject->readConfig();
+ }
+
// init
setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) );
@@ -167,8 +173,8 @@ TQSize TaskBar::sizeHint() const
// get our minimum height based on the minimum button height or the
// height of the font in use, which is largest
TQFontMetrics fm(KGlobalSettings::taskbarFont());
- int minButtonHeight = fm.height() > TaskBarSettings::minimumButtonHeight() ?
- fm.height() : TaskBarSettings::minimumButtonHeight();
+ int minButtonHeight = fm.height() > m_settingsObject->minimumButtonHeight() ?
+ fm.height() : m_settingsObject->minimumButtonHeight();
return TQSize(BUTTON_MIN_WIDTH, minButtonHeight);
}
@@ -178,8 +184,8 @@ TQSize TaskBar::sizeHint( KPanelExtension::Position p, TQSize maxSize) const
// get our minimum height based on the minimum button height or the
// height of the font in use, which is largest
TQFontMetrics fm(KGlobalSettings::taskbarFont());
- int minButtonHeight = fm.height() > TaskBarSettings::minimumButtonHeight() ?
- fm.height() : TaskBarSettings::minimumButtonHeight();
+ int minButtonHeight = fm.height() > m_settingsObject->minimumButtonHeight() ?
+ fm.height() : m_settingsObject->minimumButtonHeight();
if ( p == KPanelExtension::Left || p == KPanelExtension::Right )
{
@@ -206,7 +212,7 @@ TQSize TaskBar::sizeHint( KPanelExtension::Position p, TQSize maxSize) const
rows = 1;
}
- int maxWidth = TaskBarSettings::maximumButtonWidth();
+ int maxWidth = m_settingsObject->maximumButtonWidth();
if (maxWidth == 0)
{
maxWidth = BUTTON_MAX_WIDTH;
@@ -240,15 +246,15 @@ void TaskBar::configure()
bool wasShowOnlyIconified = m_showOnlyIconified;
int wasShowTaskStates = m_showTaskStates;
- m_showAllWindows = TaskBarSettings::showAllWindows();
- m_sortByDesktop = m_showAllWindows && TaskBarSettings::sortByDesktop();
- m_showIcon = TaskBarSettings::showIcon();
- m_showOnlyIconified = TaskBarSettings::showOnlyIconified();
- m_cycleWheel = TaskBarSettings::cycleWheel();
- m_showTaskStates = TaskBarSettings::showTaskStates();
+ m_showAllWindows = m_settingsObject->showAllWindows();
+ m_sortByDesktop = m_showAllWindows && m_settingsObject->sortByDesktop();
+ m_showIcon = m_settingsObject->showIcon();
+ m_showOnlyIconified = m_settingsObject->showOnlyIconified();
+ m_cycleWheel = m_settingsObject->cycleWheel();
+ m_showTaskStates = m_settingsObject->showTaskStates();
m_currentScreen = -1; // Show all screens or re-get our screen
- m_showOnlyCurrentScreen = (TaskBarSettings::showCurrentScreenOnly() &&
+ m_showOnlyCurrentScreen = (m_settingsObject->showCurrentScreenOnly() &&
TQApplication::desktop()->isVirtualDesktop() &&
TQApplication::desktop()->numScreens() > 1) || (TQApplication::desktop()->numScreens() < 2);
@@ -281,7 +287,7 @@ void TaskBar::configure()
}
}
- TaskManager::the()->setXCompositeEnabled(TaskBarSettings::showThumbnails());
+ TaskManager::the()->setXCompositeEnabled(m_settingsObject->showThumbnails());
reLayoutEventually();
}
@@ -344,7 +350,7 @@ void TaskBar::add(Task::Ptr task)
}
// create new container
- TaskContainer *container = new TaskContainer(task, this, viewport());
+ TaskContainer *container = new TaskContainer(task, this, m_settingsObject, viewport());
m_hiddenContainers.append(container);
// even though there is a signal to listen to, we have to add this
@@ -373,7 +379,7 @@ void TaskBar::add(Startup::Ptr startup)
}
// create new container
- TaskContainer *container = new TaskContainer(startup, frames, this, viewport());
+ TaskContainer *container = new TaskContainer(startup, frames, this, m_settingsObject, viewport());
m_hiddenContainers.append(container);
connect(container, TQT_SIGNAL(showMe(TaskContainer*)), this, TQT_SLOT(showTaskContainer(TaskContainer*)));
}
@@ -392,7 +398,7 @@ void TaskBar::showTaskContainer(TaskContainer* container)
}
// try to place the container after one of the same app
- if (TaskBarSettings::sortByApp())
+ if (m_settingsObject->sortByApp())
{
TaskContainer::Iterator it = containers.begin();
for (; it != containers.end(); ++it)
@@ -601,8 +607,7 @@ void TaskBar::windowChanged(Task::Ptr task)
if (!container ||
(!m_showAllWindows &&
!container->onCurrentDesktop() &&
- !container->isVisibleTo(this)) ||
- container->isHidden())
+ !container->isVisibleTo(this)))
{
return;
}
@@ -706,8 +711,8 @@ void TaskBar::reLayout()
// minimum button height or the height of the font in use, whichever is
// largest
TQFontMetrics fm(KGlobalSettings::taskbarFont());
- int minButtonHeight = fm.height() > TaskBarSettings::minimumButtonHeight() ?
- fm.height() : TaskBarSettings::minimumButtonHeight();
+ int minButtonHeight = fm.height() > m_settingsObject->minimumButtonHeight() ?
+ fm.height() : m_settingsObject->minimumButtonHeight();
// horizontal layout
if (orientation() == Qt::Horizontal)
@@ -745,7 +750,7 @@ void TaskBar::reLayout()
if (mbpr > bpr)
{
bwidth = contentsRect().width() / bpr;
- int maxWidth = TaskBarSettings::maximumButtonWidth();
+ int maxWidth = m_settingsObject->maximumButtonWidth();
if (maxWidth > 0 && bwidth > maxWidth)
{
bwidth = maxWidth;
@@ -966,8 +971,8 @@ int TaskBar::taskCount() const
int TaskBar::maximumButtonsWithoutShrinking() const
{
TQFontMetrics fm(KGlobalSettings::taskbarFont());
- int minButtonHeight = fm.height() > TaskBarSettings::minimumButtonHeight() ?
- fm.height() : TaskBarSettings::minimumButtonHeight();
+ int minButtonHeight = fm.height() > m_settingsObject->minimumButtonHeight() ?
+ fm.height() : m_settingsObject->minimumButtonHeight();
int rows = contentsRect().height() / minButtonHeight;
if (rows < 1)
@@ -977,7 +982,7 @@ int TaskBar::maximumButtonsWithoutShrinking() const
if ( orientation() == Qt::Horizontal ) {
// maxWidth of 0 means no max width, drop back to default
- int maxWidth = TaskBarSettings::maximumButtonWidth();
+ int maxWidth = m_settingsObject->maximumButtonWidth();
if (maxWidth == 0)
{
maxWidth = BUTTON_MAX_WIDTH;
@@ -995,8 +1000,8 @@ int TaskBar::maximumButtonsWithoutShrinking() const
bool TaskBar::shouldGroup() const
{
- return TaskBarSettings::groupTasks() == TaskBarSettings::GroupAlways ||
- (TaskBarSettings::groupTasks() == TaskBarSettings::GroupWhenFull &&
+ return m_settingsObject->groupTasks() == m_settingsObject->GroupAlways ||
+ (m_settingsObject->groupTasks() == m_settingsObject->GroupWhenFull &&
taskCount() > maximumButtonsWithoutShrinking());
}
@@ -1144,7 +1149,7 @@ void TaskBar::activateNextTask(bool forward)
void TaskBar::wheelEvent(TQWheelEvent* e)
{
- if(TaskBarSettings::cycleWheel()) {
+ if(m_settingsObject->cycleWheel()) {
if (e->delta() > 0)
{
diff --git a/kicker/taskbar/taskbar.h b/kicker/taskbar/taskbar.h
index dc75fab9c..78f95844c 100644
--- a/kicker/taskbar/taskbar.h
+++ b/kicker/taskbar/taskbar.h
@@ -44,7 +44,7 @@ class TaskBar : public Panner
Q_OBJECT
public:
- TaskBar( TQWidget *parent = 0, const char *name = 0 );
+ TaskBar( TaskBarSettings* settingsObject, TQWidget *parent = 0, const char *name = 0 );
~TaskBar();
TQSize sizeHint() const;
@@ -132,6 +132,7 @@ private:
bool m_ignoreUpdates;
TQTimer m_relayoutTimer;
TQImage m_blendGradient;
+ TaskBarSettings* m_settingsObject;
};
#endif
diff --git a/kicker/taskbar/taskbar.kcfg b/kicker/taskbar/taskbar.kcfg
index 1ac6dadbf..7d8d1f5d9 100644
--- a/kicker/taskbar/taskbar.kcfg
+++ b/kicker/taskbar/taskbar.kcfg
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
- <kcfgfile name="ktaskbarrc"/>
+ <kcfgfile arg="true"/>
<group name="General">
<entry key="ShowAllWindows" type="Bool" >
diff --git a/kicker/taskbar/taskbarcontainer.cpp b/kicker/taskbar/taskbarcontainer.cpp
index 938487dfc..00ed9786c 100644
--- a/kicker/taskbar/taskbarcontainer.cpp
+++ b/kicker/taskbar/taskbarcontainer.cpp
@@ -42,15 +42,25 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "taskbarcontainer.h"
#include "taskbarcontainer.moc"
-TaskBarContainer::TaskBarContainer( bool enableFrame, TQWidget *parent, const char *name )
+#define GLOBAL_TASKBAR_CONFIG_FILE_NAME "ktaskbarrc"
+
+TaskBarContainer::TaskBarContainer( bool enableFrame, TQString configFileOverride, TQWidget *parent, const char *name )
: TQFrame(parent, name),
+ configFile(configFileOverride),
direction( KPanelApplet::Up ),
showWindowListButton( true ),
windowListButton(0),
- windowListMenu(0)
+ windowListMenu(0),
+ settingsObject(NULL)
{
+ if (configFile == "")
+ {
+ configFile = GLOBAL_TASKBAR_CONFIG_FILE_NAME;
+ }
+ settingsObject = new TaskBarSettings(KSharedConfig::openConfig(configFile));
+
setBackgroundOrigin( AncestorOrigin );
-
+
uint margin;
if ( enableFrame )
{
@@ -69,7 +79,7 @@ TaskBarContainer::TaskBarContainer( bool enableFrame, TQWidget *parent, const ch
layout->setMargin( margin );
// scrollable taskbar
- taskBar = new TaskBar(this);
+ taskBar = new TaskBar(settingsObject, this);
layout->addWidget( taskBar );
connect( taskBar, TQT_SIGNAL( containerCountChanged() ), TQT_SIGNAL( containerCountChanged() ) );
@@ -85,13 +95,14 @@ TaskBarContainer::TaskBarContainer( bool enableFrame, TQWidget *parent, const ch
TaskBarContainer::~TaskBarContainer()
{
- delete windowListMenu;
+ if (windowListMenu) delete windowListMenu;
+ if (settingsObject) delete settingsObject;
}
void TaskBarContainer::configure()
{
- setFont(TaskBarSettings::taskbarFont());
- showWindowListButton = TaskBarSettings::showWindowListBtn();
+ setFont(settingsObject->taskbarFont());
+ showWindowListButton = settingsObject->showWindowListBtn();
if (!showWindowListButton)
{
@@ -148,7 +159,7 @@ void TaskBarContainer::configChanged()
// doesn't have to also connect to the DCOP signal (less places
// to change/fix it if/when it changes) without calling
// configure() twice on taskbar on start up
- TaskBarSettings::self()->readConfig();
+ settingsObject->readConfig();
configure();
taskBar->configure();
@@ -163,7 +174,16 @@ void TaskBarContainer::preferences()
kapp->dcopClient()->attach();
}
- kapp->dcopClient()->send("kicker", "kicker", "showTaskBarConfig()", data);
+ if (configFile == GLOBAL_TASKBAR_CONFIG_FILE_NAME)
+ {
+ kapp->dcopClient()->send("kicker", "kicker", "showTaskBarConfig()", data);
+ }
+ else
+ {
+ TQDataStream args( data, IO_WriteOnly );
+ args << configFile;
+ kapp->dcopClient()->send("kicker", "kicker", "showTaskBarConfig(TQString)", data);
+ }
}
void TaskBarContainer::orientationChange(Orientation o)
diff --git a/kicker/taskbar/taskbarcontainer.h b/kicker/taskbar/taskbarcontainer.h
index 87a55c2b9..cac8f1f2d 100644
--- a/kicker/taskbar/taskbarcontainer.h
+++ b/kicker/taskbar/taskbarcontainer.h
@@ -34,6 +34,7 @@ class TQBoxLayout;
class SimpleButton;
class KWindowListMenu;
class TaskBar;
+class TaskBarSettings;
class KDE_EXPORT TaskBarContainer : public TQFrame, public DCOPObject
{
@@ -41,7 +42,7 @@ class KDE_EXPORT TaskBarContainer : public TQFrame, public DCOPObject
K_DCOP
public:
- TaskBarContainer( bool enableFrame, TQWidget* parent = 0, const char* name = 0 );
+ TaskBarContainer( bool enableFrame, TQString configFileOverride = TQString::null, TQWidget* parent = 0, const char* name = 0 );
~TaskBarContainer();
void orientationChange( Orientation );
@@ -64,12 +65,14 @@ protected slots:
void reconnectWindowListButton();
private:
+ TQString configFile;
KPanelApplet::Direction direction;
bool showWindowListButton;
- TQBoxLayout * layout;
+ TQBoxLayout * layout;
TaskBar * taskBar;
SimpleButton * windowListButton;
KWindowListMenu * windowListMenu;
+ TaskBarSettings * settingsObject;
};
#endif
diff --git a/kicker/taskbar/taskbarsettings.kcfgc b/kicker/taskbar/taskbarsettings.kcfgc
index 45c0da407..c5219f64e 100644
--- a/kicker/taskbar/taskbarsettings.kcfgc
+++ b/kicker/taskbar/taskbarsettings.kcfgc
@@ -1,5 +1,5 @@
File=taskbar.kcfg
-Singleton=true
+Singleton=false
ClassName=TaskBarSettings
Mutators=true
Visibility=KDE_EXPORT
diff --git a/kicker/taskbar/taskcontainer.cpp b/kicker/taskbar/taskcontainer.cpp
index 79aca98e8..600bac7e9 100644
--- a/kicker/taskbar/taskcontainer.cpp
+++ b/kicker/taskbar/taskcontainer.cpp
@@ -112,7 +112,7 @@ bool is_process_resumable(pid_t pid) {
}
}
-TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar,
+TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar, TaskBarSettings* settingsObject,
TQWidget *parent, const char *name)
: TQToolButton(parent, name),
animationTimer(0, "TaskContainer::animationTimer"),
@@ -129,7 +129,8 @@ TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar,
discardNextMouseEvent(false),
aboutToActivate(false),
m_mouseOver(false),
- m_paintEventCompression(false)
+ m_paintEventCompression(false),
+ m_settingsObject(settingsObject)
{
init();
setAcceptDrops(true); // Always enabled to activate task during drag&drop.
@@ -144,7 +145,7 @@ TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar,
}
TaskContainer::TaskContainer(Startup::Ptr startup, PixmapList& startupFrames,
- TaskBar* bar, TQWidget *parent, const char *name)
+ TaskBar* bar, TaskBarSettings* settingsObject, TQWidget *parent, const char *name)
: TQToolButton(parent, name),
animationTimer(0, "TaskContainer::animationTimer"),
dragSwitchTimer(0, "TaskContainer::dragSwitchTimer"),
@@ -161,7 +162,8 @@ TaskContainer::TaskContainer(Startup::Ptr startup, PixmapList& startupFrames,
discardNextMouseEvent(false),
aboutToActivate(false),
m_mouseOver(false),
- m_paintEventCompression(false)
+ m_paintEventCompression(false),
+ m_settingsObject(settingsObject)
{
init();
setEnabled(false);
@@ -175,6 +177,11 @@ TaskContainer::TaskContainer(Startup::Ptr startup, PixmapList& startupFrames,
void TaskContainer::init()
{
+ if (m_settingsObject)
+ {
+ m_settingsObject->readConfig();
+ }
+
if (!netwm_atoms_created) create_atoms(TQPaintDevice::x11AppDisplay());
setWFlags(TQt::WNoAutoErase);
@@ -349,11 +356,11 @@ void TaskContainer::checkAttention(const Task::Ptr t)
void TaskContainer::attentionTimerFired()
{
assert( attentionState != -1 );
- if (attentionState < TaskBarSettings::attentionBlinkIterations()*2)
+ if (attentionState < m_settingsObject->attentionBlinkIterations()*2)
{
++attentionState;
}
- else if (TaskBarSettings::attentionBlinkIterations() < 1000)
+ else if (m_settingsObject->attentionBlinkIterations() < 1000)
{
attentionTimer.stop();
}
@@ -564,12 +571,12 @@ void TaskContainer::drawButton(TQPainter *p)
TQPixmap *pm((TQPixmap*)p->device());
TQPixmap pixmap; // icon
Task::Ptr task = 0;
- bool iconified = !TaskBarSettings::showOnlyIconified();
- bool halo = TaskBarSettings::haloText();
- bool alwaysDrawButtons = TaskBarSettings::drawButtons();
+ bool iconified = !m_settingsObject->showOnlyIconified();
+ bool halo = m_settingsObject->haloText();
+ bool alwaysDrawButtons = m_settingsObject->drawButtons();
bool drawButton = alwaysDrawButtons ||
(m_mouseOver && !halo && isEnabled() &&
- TaskBarSettings::showButtonOnHover());
+ m_settingsObject->showButtonOnHover());
TQFont font(KGlobalSettings::taskbarFont());
// draw sunken if we contain the active task
@@ -591,7 +598,7 @@ void TaskContainer::drawButton(TQPainter *p)
if (task->demandsAttention())
{
- demandsAttention = attentionState == TaskBarSettings::attentionBlinkIterations() ||
+ demandsAttention = attentionState == m_settingsObject->attentionBlinkIterations() ||
attentionState % 2 == 0;
}
}
@@ -600,12 +607,12 @@ void TaskContainer::drawButton(TQPainter *p)
TQColorGroup colors = palette().active();
- if (TaskBarSettings::useCustomColors())
+ if (m_settingsObject->useCustomColors())
{
- colors.setColor( TQColorGroup::Button, TaskBarSettings::taskBackgroundColor());
- colors.setColor( TQColorGroup::Background, TaskBarSettings::taskBackgroundColor() );
- colors.setColor( TQColorGroup::ButtonText, TaskBarSettings::inactiveTaskTextColor() );
- colors.setColor( TQColorGroup::Text, TaskBarSettings::inactiveTaskTextColor() );
+ colors.setColor( TQColorGroup::Button, m_settingsObject->taskBackgroundColor());
+ colors.setColor( TQColorGroup::Background, m_settingsObject->taskBackgroundColor() );
+ colors.setColor( TQColorGroup::ButtonText, m_settingsObject->inactiveTaskTextColor() );
+ colors.setColor( TQColorGroup::Text, m_settingsObject->inactiveTaskTextColor() );
}
if (demandsAttention)
@@ -753,9 +760,9 @@ void TaskContainer::drawButton(TQPainter *p)
}
else // hack for the dotNET style and others
{
- if (TaskBarSettings::useCustomColors())
+ if (m_settingsObject->useCustomColors())
{
- textPen = TQPen(TaskBarSettings::activeTaskTextColor());
+ textPen = TQPen(m_settingsObject->activeTaskTextColor());
}
else
{
@@ -982,20 +989,20 @@ void TaskContainer::mousePressEvent( TQMouseEvent* e )
switch (e->button())
{
case Qt::LeftButton:
- buttonAction = TaskBarSettings::action(TaskBarSettings::LeftButton);
+ buttonAction = m_settingsObject->action(m_settingsObject->LeftButton);
break;
case Qt::MidButton:
- buttonAction = TaskBarSettings::action(TaskBarSettings::MiddleButton);
+ buttonAction = m_settingsObject->action(m_settingsObject->MiddleButton);
break;
case Qt::RightButton:
default:
- buttonAction = TaskBarSettings::action(TaskBarSettings::RightButton);
+ buttonAction = m_settingsObject->action(m_settingsObject->RightButton);
break;
}
- if ((buttonAction == TaskBarSettings::ShowTaskList &&
+ if ((buttonAction == m_settingsObject->ShowTaskList &&
m_filteredTasks.count() > 1) ||
- buttonAction == TaskBarSettings::ShowOperationsMenu)
+ buttonAction == m_settingsObject->ShowOperationsMenu)
{
performAction(buttonAction);
}
@@ -1005,7 +1012,7 @@ void TaskContainer::mouseReleaseEvent(TQMouseEvent *e)
{
m_dragStartPos = TQPoint();
- if (!TaskBarSettings::drawButtons())
+ if (!m_settingsObject->drawButtons())
{
setDown(false);
}
@@ -1023,20 +1030,20 @@ void TaskContainer::mouseReleaseEvent(TQMouseEvent *e)
switch (e->button())
{
case Qt::LeftButton:
- buttonAction = TaskBarSettings::action(TaskBarSettings::LeftButton);
+ buttonAction = m_settingsObject->action(m_settingsObject->LeftButton);
break;
case Qt::MidButton:
- buttonAction = TaskBarSettings::action(TaskBarSettings::MiddleButton);
+ buttonAction = m_settingsObject->action(m_settingsObject->MiddleButton);
break;
case Qt::RightButton:
default:
- buttonAction = TaskBarSettings::action(TaskBarSettings::RightButton);
+ buttonAction = m_settingsObject->action(m_settingsObject->RightButton);
break;
}
- if ((buttonAction == TaskBarSettings::ShowTaskList &&
+ if ((buttonAction == m_settingsObject->ShowTaskList &&
m_filteredTasks.count() > 1) ||
- buttonAction == TaskBarSettings::ShowOperationsMenu)
+ buttonAction == m_settingsObject->ShowOperationsMenu)
{
return;
}
@@ -1063,13 +1070,13 @@ void TaskContainer::performAction(int action)
// If there is only one task, the correct behavior is
// to activate, raise, or iconify it, not show the task menu.
if( m_filteredTasks.count() > 1 ) {
- popupMenu( TaskBarSettings::ShowTaskList );
+ popupMenu( m_settingsObject->ShowTaskList );
} else {
performAction( TaskBarSettings::ActivateRaiseOrMinimize );
}
break;
case TaskBarSettings::ShowOperationsMenu:
- popupMenu( TaskBarSettings::ShowOperationsMenu );
+ popupMenu( m_settingsObject->ShowOperationsMenu );
break;
case TaskBarSettings::ActivateRaiseOrMinimize:
if (m_filteredTasks.isEmpty())
@@ -1199,11 +1206,11 @@ bool TaskContainer::activateNextTask(bool forward, bool& forcenext)
void TaskContainer::popupMenu(int action)
{
- if (action == TaskBarSettings::ShowTaskList )
+ if (action == m_settingsObject->ShowTaskList )
{
m_menu = new TaskLMBMenu(m_filteredTasks);
}
- else if (action == TaskBarSettings::ShowOperationsMenu)
+ else if (action == m_settingsObject->ShowOperationsMenu)
{
if (!kapp->authorizeKAction("twin_rmb"))
{
@@ -1447,7 +1454,7 @@ void TaskContainer::dragSwitch()
}
else
{
- popupMenu(TaskBarSettings::ShowTaskList);
+ popupMenu(m_settingsObject->ShowTaskList);
}
}
@@ -1540,7 +1547,7 @@ void TaskContainer::updateFilteredTaskList()
{
Task::Ptr t = *it;
if ((taskBar->showAllWindows() || t->isOnCurrentDesktop()) &&
- (!TaskBarSettings::showOnlyIconified() || t->isIconified()))
+ (!m_settingsObject->showOnlyIconified() || t->isIconified()))
{
pid_t pid = 0;
#ifdef Q_WS_X11
@@ -1561,15 +1568,15 @@ void TaskContainer::updateFilteredTaskList()
if (pid < 0) {
m_filteredTasks.append(t);
}
- else if (TaskBarSettings::showTaskStates() != TaskBarSettings::ShowAll) {
+ else if (m_settingsObject->showTaskStates() != m_settingsObject->ShowAll) {
if (is_process_resumable(pid)) {
- if (TaskBarSettings::showTaskStates() == TaskBarSettings::ShowAll) {
+ if (m_settingsObject->showTaskStates() == m_settingsObject->ShowAll) {
m_filteredTasks.append(t);
}
- else if (TaskBarSettings::showTaskStates() == TaskBarSettings::ShowStopped) {
+ else if (m_settingsObject->showTaskStates() == m_settingsObject->ShowStopped) {
m_filteredTasks.append(t);
}
- else if (TaskBarSettings::showTaskStates() == TaskBarSettings::ShowRunning) {
+ else if (m_settingsObject->showTaskStates() == m_settingsObject->ShowRunning) {
t->publishIconGeometry( TQRect());
}
else {
@@ -1577,13 +1584,13 @@ void TaskContainer::updateFilteredTaskList()
}
}
else {
- if (TaskBarSettings::showTaskStates() == TaskBarSettings::ShowAll) {
+ if (m_settingsObject->showTaskStates() == m_settingsObject->ShowAll) {
m_filteredTasks.append(t);
}
- else if (TaskBarSettings::showTaskStates() == TaskBarSettings::ShowStopped) {
+ else if (m_settingsObject->showTaskStates() == m_settingsObject->ShowStopped) {
t->publishIconGeometry( TQRect());
}
- else if (TaskBarSettings::showTaskStates() == TaskBarSettings::ShowRunning) {
+ else if (m_settingsObject->showTaskStates() == m_settingsObject->ShowRunning) {
m_filteredTasks.append(t);
}
else {
@@ -1670,12 +1677,12 @@ void TaskContainer::updateKickerTip(KickerTip::Data& data)
if (m_filteredTasks.count() > 0)
{
- if (TaskBarSettings::showThumbnails() &&
+ if (m_settingsObject->showThumbnails() &&
m_filteredTasks.count() == 1)
{
Task::Ptr t = m_filteredTasks.first();
- pixmap = t->thumbnail(TaskBarSettings::thumbnailMaxDimension());
+ pixmap = t->thumbnail(m_settingsObject->thumbnailMaxDimension());
}
if (pixmap.isNull() && tasks.count())
@@ -1718,7 +1725,7 @@ void TaskContainer::updateKickerTip(KickerTip::Data& data)
}
}
- if (TaskBarSettings::showAllWindows() && KWin::numberOfDesktops() > 1)
+ if (m_settingsObject->showAllWindows() && KWin::numberOfDesktops() > 1)
{
if (desktopMap.isEmpty())
{
diff --git a/kicker/taskbar/taskcontainer.h b/kicker/taskbar/taskcontainer.h
index 766d37639..a176a0787 100644
--- a/kicker/taskbar/taskcontainer.h
+++ b/kicker/taskbar/taskcontainer.h
@@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "taskmanager.h"
class TaskBar;
+class TaskBarSettings;
typedef TQValueList<TQPixmap*> PixmapList;
@@ -44,8 +45,8 @@ public:
typedef TQValueList<TaskContainer*> List;
typedef TQValueList<TaskContainer*>::iterator Iterator;
- TaskContainer(Task::Ptr, TaskBar*, TQWidget *parent = 0, const char *name = 0);
- TaskContainer(Startup::Ptr, PixmapList&, TaskBar*,
+ TaskContainer(Task::Ptr, TaskBar*, TaskBarSettings* settingsObject, TQWidget *parent = 0, const char *name = 0);
+ TaskContainer(Startup::Ptr, PixmapList&, TaskBar*, TaskBarSettings* settingsObject,
TQWidget *parent = 0, const char *name = 0);
virtual ~TaskContainer();
@@ -148,7 +149,8 @@ private:
bool m_mouseOver;
bool m_paintEventCompression;
enum { ATTENTION_BLINK_TIMEOUT = 4 };
- TQPoint m_dragStartPos;
+ TQPoint m_dragStartPos;
+ TaskBarSettings* m_settingsObject;
};
#endif