summaryrefslogtreecommitdiffstats
path: root/kicker/taskbar
diff options
context:
space:
mode:
Diffstat (limited to 'kicker/taskbar')
-rw-r--r--kicker/taskbar/taskbar.cpp58
-rw-r--r--kicker/taskbar/taskbar.h5
-rw-r--r--kicker/taskbar/taskbar.kcfg5
-rw-r--r--kicker/taskbar/taskbarcontainer.cpp15
-rw-r--r--kicker/taskbar/taskbarcontainer.h1
-rw-r--r--kicker/taskbar/taskcontainer.cpp89
-rw-r--r--kicker/taskbar/taskcontainer.h6
7 files changed, 103 insertions, 76 deletions
diff --git a/kicker/taskbar/taskbar.cpp b/kicker/taskbar/taskbar.cpp
index 5f92b9fa4..0838082d1 100644
--- a/kicker/taskbar/taskbar.cpp
+++ b/kicker/taskbar/taskbar.cpp
@@ -49,8 +49,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "taskbar.h"
#include "taskbar.moc"
+#define READ_MERGED_TASBKAR_SETTING(x) ((m_settingsObject->useGlobalSettings())?m_globalSettingsObject->x():m_settingsObject->x())
-TaskBar::TaskBar( TaskBarSettings* settingsObject, TQWidget *parent, const char *name )
+TaskBar::TaskBar( TaskBarSettings* settingsObject, TaskBarSettings* globalSettingsObject, TQWidget *parent, const char *name )
: Panner( parent, name ),
m_showAllWindows(false),
m_cycleWheel(false),
@@ -72,6 +73,11 @@ TaskBar::TaskBar( TaskBarSettings* settingsObject, TQWidget *parent, const char
{
m_settingsObject->readConfig();
}
+ m_globalSettingsObject = globalSettingsObject;
+ if (m_globalSettingsObject)
+ {
+ m_globalSettingsObject->readConfig();
+ }
// init
setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) );
@@ -173,8 +179,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(TDEGlobalSettings::taskbarFont());
- int minButtonHeight = fm.height() > m_settingsObject->minimumButtonHeight() ?
- fm.height() : m_settingsObject->minimumButtonHeight();
+ int minButtonHeight = fm.height() > READ_MERGED_TASBKAR_SETTING(minimumButtonHeight) ?
+ fm.height() : READ_MERGED_TASBKAR_SETTING(minimumButtonHeight);
return TQSize(BUTTON_MIN_WIDTH, minButtonHeight);
}
@@ -184,8 +190,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(TDEGlobalSettings::taskbarFont());
- int minButtonHeight = fm.height() > m_settingsObject->minimumButtonHeight() ?
- fm.height() : m_settingsObject->minimumButtonHeight();
+ int minButtonHeight = fm.height() > READ_MERGED_TASBKAR_SETTING(minimumButtonHeight) ?
+ fm.height() : READ_MERGED_TASBKAR_SETTING(minimumButtonHeight);
if ( p == KPanelExtension::Left || p == KPanelExtension::Right )
{
@@ -212,7 +218,7 @@ TQSize TaskBar::sizeHint( KPanelExtension::Position p, TQSize maxSize) const
rows = 1;
}
- int maxWidth = m_settingsObject->maximumButtonWidth();
+ int maxWidth = READ_MERGED_TASBKAR_SETTING(maximumButtonWidth);
if (maxWidth == 0)
{
maxWidth = BUTTON_MAX_WIDTH;
@@ -246,15 +252,15 @@ void TaskBar::configure()
bool wasShowOnlyIconified = m_showOnlyIconified;
int wasShowTaskStates = m_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_showAllWindows = READ_MERGED_TASBKAR_SETTING(showAllWindows);
+ m_sortByDesktop = m_showAllWindows && READ_MERGED_TASBKAR_SETTING(sortByDesktop);
+ m_showIcon = READ_MERGED_TASBKAR_SETTING(showIcon);
+ m_showOnlyIconified = READ_MERGED_TASBKAR_SETTING(showOnlyIconified);
+ m_cycleWheel = READ_MERGED_TASBKAR_SETTING(cycleWheel);
+ m_showTaskStates = READ_MERGED_TASBKAR_SETTING(showTaskStates);
m_currentScreen = -1; // Show all screens or re-get our screen
- m_showOnlyCurrentScreen = (m_settingsObject->showCurrentScreenOnly() &&
+ m_showOnlyCurrentScreen = (READ_MERGED_TASBKAR_SETTING(showCurrentScreenOnly) &&
TQApplication::desktop()->isVirtualDesktop() &&
TQApplication::desktop()->numScreens() > 1);
@@ -287,7 +293,7 @@ void TaskBar::configure()
}
}
- TaskManager::the()->setXCompositeEnabled(m_settingsObject->showThumbnails());
+ TaskManager::the()->setXCompositeEnabled(READ_MERGED_TASBKAR_SETTING(showThumbnails));
reLayoutEventually();
}
@@ -350,7 +356,7 @@ void TaskBar::add(Task::Ptr task)
}
// create new container
- TaskContainer *container = new TaskContainer(task, this, m_settingsObject, viewport());
+ TaskContainer *container = new TaskContainer(task, this, m_settingsObject, m_globalSettingsObject, viewport());
m_hiddenContainers.append(container);
// even though there is a signal to listen to, we have to add this
@@ -379,7 +385,7 @@ void TaskBar::add(Startup::Ptr startup)
}
// create new container
- TaskContainer *container = new TaskContainer(startup, frames, this, m_settingsObject, viewport());
+ TaskContainer *container = new TaskContainer(startup, frames, this, m_settingsObject, m_globalSettingsObject, viewport());
m_hiddenContainers.append(container);
connect(container, TQT_SIGNAL(showMe(TaskContainer*)), this, TQT_SLOT(showTaskContainer(TaskContainer*)));
}
@@ -398,7 +404,7 @@ void TaskBar::showTaskContainer(TaskContainer* container)
}
// try to place the container after one of the same app
- if (m_settingsObject->sortByApp())
+ if (READ_MERGED_TASBKAR_SETTING(sortByApp))
{
TaskContainer::Iterator it = containers.begin();
for (; it != containers.end(); ++it)
@@ -711,8 +717,8 @@ void TaskBar::reLayout()
// minimum button height or the height of the font in use, whichever is
// largest
TQFontMetrics fm(TDEGlobalSettings::taskbarFont());
- int minButtonHeight = fm.height() > m_settingsObject->minimumButtonHeight() ?
- fm.height() : m_settingsObject->minimumButtonHeight();
+ int minButtonHeight = fm.height() > READ_MERGED_TASBKAR_SETTING(minimumButtonHeight) ?
+ fm.height() : READ_MERGED_TASBKAR_SETTING(minimumButtonHeight);
// horizontal layout
if (orientation() == Qt::Horizontal)
@@ -750,7 +756,7 @@ void TaskBar::reLayout()
if (mbpr > bpr)
{
bwidth = contentsRect().width() / bpr;
- int maxWidth = m_settingsObject->maximumButtonWidth();
+ int maxWidth = READ_MERGED_TASBKAR_SETTING(maximumButtonWidth);
if (maxWidth > 0 && bwidth > maxWidth)
{
bwidth = maxWidth;
@@ -971,8 +977,8 @@ int TaskBar::taskCount() const
int TaskBar::maximumButtonsWithoutShrinking() const
{
TQFontMetrics fm(TDEGlobalSettings::taskbarFont());
- int minButtonHeight = fm.height() > m_settingsObject->minimumButtonHeight() ?
- fm.height() : m_settingsObject->minimumButtonHeight();
+ int minButtonHeight = fm.height() > READ_MERGED_TASBKAR_SETTING(minimumButtonHeight) ?
+ fm.height() : READ_MERGED_TASBKAR_SETTING(minimumButtonHeight);
int rows = contentsRect().height() / minButtonHeight;
if (rows < 1)
@@ -982,7 +988,7 @@ int TaskBar::maximumButtonsWithoutShrinking() const
if ( orientation() == Qt::Horizontal ) {
// maxWidth of 0 means no max width, drop back to default
- int maxWidth = m_settingsObject->maximumButtonWidth();
+ int maxWidth = READ_MERGED_TASBKAR_SETTING(maximumButtonWidth);
if (maxWidth == 0)
{
maxWidth = BUTTON_MAX_WIDTH;
@@ -1000,8 +1006,8 @@ int TaskBar::maximumButtonsWithoutShrinking() const
bool TaskBar::shouldGroup() const
{
- return m_settingsObject->groupTasks() == m_settingsObject->GroupAlways ||
- (m_settingsObject->groupTasks() == m_settingsObject->GroupWhenFull &&
+ return READ_MERGED_TASBKAR_SETTING(groupTasks) == m_settingsObject->GroupAlways ||
+ (READ_MERGED_TASBKAR_SETTING(groupTasks) == m_settingsObject->GroupWhenFull &&
taskCount() > maximumButtonsWithoutShrinking());
}
@@ -1149,7 +1155,7 @@ void TaskBar::activateNextTask(bool forward)
void TaskBar::wheelEvent(TQWheelEvent* e)
{
- if(m_settingsObject->cycleWheel()) {
+ if(READ_MERGED_TASBKAR_SETTING(cycleWheel)) {
if (e->delta() > 0)
{
diff --git a/kicker/taskbar/taskbar.h b/kicker/taskbar/taskbar.h
index 7c9540efe..b94928d0f 100644
--- a/kicker/taskbar/taskbar.h
+++ b/kicker/taskbar/taskbar.h
@@ -44,7 +44,7 @@ class TaskBar : public Panner
Q_OBJECT
public:
- TaskBar( TaskBarSettings* settingsObject, TQWidget *parent = 0, const char *name = 0 );
+ TaskBar( TaskBarSettings* settingsObject, TaskBarSettings* globalSettingsObject, TQWidget *parent = 0, const char *name = 0 );
~TaskBar();
TQSize sizeHint() const;
@@ -62,7 +62,7 @@ public:
bool showAllWindows() const { return m_showAllWindows; }
TQImage* blendGradient(const TQSize& size);
-
+
KTextShadowEngine *textShadowEngine();
public slots:
@@ -133,6 +133,7 @@ private:
TQTimer m_relayoutTimer;
TQImage m_blendGradient;
TaskBarSettings* m_settingsObject;
+ TaskBarSettings* m_globalSettingsObject;
};
#endif
diff --git a/kicker/taskbar/taskbar.kcfg b/kicker/taskbar/taskbar.kcfg
index 7d8d1f5d9..246ee36b7 100644
--- a/kicker/taskbar/taskbar.kcfg
+++ b/kicker/taskbar/taskbar.kcfg
@@ -6,6 +6,11 @@
<kcfgfile arg="true"/>
<group name="General">
+ <entry key="UseGlobalSettings" type="Bool" >
+ <default>true</default>
+ <label>Use the global (floating) taskbar configuration</label>
+ <whatsthis>Turning this option off will cause the taskbar to ignore the global (floating) taskbar configuration, instead using a specific configuration for that particular taskbar.</whatsthis>
+ </entry>
<entry key="ShowAllWindows" type="Bool" >
<default>true</default>
<label>Show windows from all desktops</label>
diff --git a/kicker/taskbar/taskbarcontainer.cpp b/kicker/taskbar/taskbarcontainer.cpp
index aacd22519..5a75f7c15 100644
--- a/kicker/taskbar/taskbarcontainer.cpp
+++ b/kicker/taskbar/taskbarcontainer.cpp
@@ -46,6 +46,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define GLOBAL_TASKBAR_CONFIG_FILE_NAME "ktaskbarrc"
+#define READ_MERGED_TASBKAR_SETTING(x) ((settingsObject->useGlobalSettings())?globalSettingsObject->x():settingsObject->x())
+
TaskBarContainer::TaskBarContainer( bool enableFrame, TQString configFileOverride, TQWidget *parent, const char *name )
: TQFrame(parent, name),
configFile(configFileOverride),
@@ -53,7 +55,8 @@ TaskBarContainer::TaskBarContainer( bool enableFrame, TQString configFileOverrid
showWindowListButton( true ),
windowListButton(0),
windowListMenu(0),
- settingsObject(NULL)
+ settingsObject(NULL),
+ globalSettingsObject(NULL)
{
if (configFile == "")
{
@@ -65,9 +68,11 @@ TaskBarContainer::TaskBarContainer( bool enableFrame, TQString configFileOverrid
TDEConfig globalConfig(GLOBAL_TASKBAR_CONFIG_FILE_NAME, TRUE, TRUE);
TDEConfig localConfig(configFile);
globalConfig.copyTo(configFile, &localConfig);
+ localConfig.writeEntry("UseGlobalSettings", TRUE);
localConfig.sync();
}
settingsObject = new TaskBarSettings(TDESharedConfig::openConfig(configFile));
+ globalSettingsObject = new TaskBarSettings(TDESharedConfig::openConfig(GLOBAL_TASKBAR_CONFIG_FILE_NAME));
setBackgroundOrigin( AncestorOrigin );
@@ -89,7 +94,7 @@ TaskBarContainer::TaskBarContainer( bool enableFrame, TQString configFileOverrid
layout->setMargin( margin );
// scrollable taskbar
- taskBar = new TaskBar(settingsObject, this);
+ taskBar = new TaskBar(settingsObject, globalSettingsObject, this);
layout->addWidget( taskBar );
connect( taskBar, TQT_SIGNAL( containerCountChanged() ), TQT_SIGNAL( containerCountChanged() ) );
@@ -107,12 +112,13 @@ TaskBarContainer::~TaskBarContainer()
{
if (windowListMenu) delete windowListMenu;
if (settingsObject) delete settingsObject;
+ if (globalSettingsObject) delete globalSettingsObject;
}
void TaskBarContainer::configure()
{
- setFont(settingsObject->taskbarFont());
- showWindowListButton = settingsObject->showWindowListBtn();
+ setFont(READ_MERGED_TASBKAR_SETTING(taskbarFont));
+ showWindowListButton = READ_MERGED_TASBKAR_SETTING(showWindowListBtn);
if (!showWindowListButton)
{
@@ -170,6 +176,7 @@ void TaskBarContainer::configChanged()
// to change/fix it if/when it changes) without calling
// configure() twice on taskbar on start up
settingsObject->readConfig();
+ globalSettingsObject->readConfig();
configure();
taskBar->configure();
diff --git a/kicker/taskbar/taskbarcontainer.h b/kicker/taskbar/taskbarcontainer.h
index cac8f1f2d..fb5f26dd1 100644
--- a/kicker/taskbar/taskbarcontainer.h
+++ b/kicker/taskbar/taskbarcontainer.h
@@ -73,6 +73,7 @@ private:
SimpleButton * windowListButton;
KWindowListMenu * windowListMenu;
TaskBarSettings * settingsObject;
+ TaskBarSettings * globalSettingsObject;
};
#endif
diff --git a/kicker/taskbar/taskcontainer.cpp b/kicker/taskbar/taskcontainer.cpp
index 166175f66..d63166bb8 100644
--- a/kicker/taskbar/taskcontainer.cpp
+++ b/kicker/taskbar/taskcontainer.cpp
@@ -61,6 +61,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "taskcontainer.h"
#include "taskcontainer.moc"
+#define READ_MERGED_TASBKAR_SETTING(x) ((m_settingsObject->useGlobalSettings())?m_globalSettingsObject->x():m_settingsObject->x())
+#define READ_MERGED_TASBKAR_ACTION(x) ((m_settingsObject->useGlobalSettings())?m_globalSettingsObject->action(x):m_settingsObject->action(x))
+
static Bool netwm_atoms_created = False;
static Atom net_wm_pid = 0;
@@ -112,8 +115,7 @@ bool is_process_resumable(pid_t pid) {
}
}
-TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar, TaskBarSettings* settingsObject,
- TQWidget *parent, const char *name)
+TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar, TaskBarSettings* settingsObject, TaskBarSettings* globalSettingsObject, TQWidget *parent, const char *name)
: TQToolButton(parent, name),
animationTimer(0, "TaskContainer::animationTimer"),
dragSwitchTimer(0, "TaskContainer::dragSwitchTimer"),
@@ -130,7 +132,8 @@ TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar, TaskBarSettings* sett
aboutToActivate(false),
m_mouseOver(false),
m_paintEventCompression(false),
- m_settingsObject(settingsObject)
+ m_settingsObject(settingsObject),
+ m_globalSettingsObject(globalSettingsObject)
{
init();
setAcceptDrops(true); // Always enabled to activate task during drag&drop.
@@ -144,8 +147,7 @@ TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar, TaskBarSettings* sett
dragSwitchTimer.start(0, true);
}
-TaskContainer::TaskContainer(Startup::Ptr startup, PixmapList& startupFrames,
- TaskBar* bar, TaskBarSettings* settingsObject, TQWidget *parent, const char *name)
+TaskContainer::TaskContainer(Startup::Ptr startup, PixmapList& startupFrames, TaskBar* bar, TaskBarSettings* settingsObject, TaskBarSettings* globalSettingsObject, TQWidget *parent, const char *name)
: TQToolButton(parent, name),
animationTimer(0, "TaskContainer::animationTimer"),
dragSwitchTimer(0, "TaskContainer::dragSwitchTimer"),
@@ -163,7 +165,8 @@ TaskContainer::TaskContainer(Startup::Ptr startup, PixmapList& startupFrames,
aboutToActivate(false),
m_mouseOver(false),
m_paintEventCompression(false),
- m_settingsObject(settingsObject)
+ m_settingsObject(settingsObject),
+ m_globalSettingsObject(globalSettingsObject)
{
init();
setEnabled(false);
@@ -181,6 +184,10 @@ void TaskContainer::init()
{
m_settingsObject->readConfig();
}
+ if (m_globalSettingsObject)
+ {
+ m_globalSettingsObject->readConfig();
+ }
if (!netwm_atoms_created) create_atoms(TQPaintDevice::x11AppDisplay());
@@ -356,11 +363,11 @@ void TaskContainer::checkAttention(const Task::Ptr t)
void TaskContainer::attentionTimerFired()
{
assert( attentionState != -1 );
- if (attentionState < m_settingsObject->attentionBlinkIterations()*2)
+ if (attentionState < READ_MERGED_TASBKAR_SETTING(attentionBlinkIterations)*2)
{
++attentionState;
}
- else if (m_settingsObject->attentionBlinkIterations() < 1000)
+ else if (READ_MERGED_TASBKAR_SETTING(attentionBlinkIterations) < 1000)
{
attentionTimer.stop();
}
@@ -571,12 +578,12 @@ void TaskContainer::drawButton(TQPainter *p)
TQPixmap *pm((TQPixmap*)p->device());
TQPixmap pixmap; // icon
Task::Ptr task = 0;
- bool iconified = !m_settingsObject->showOnlyIconified();
- bool halo = m_settingsObject->haloText();
- bool alwaysDrawButtons = m_settingsObject->drawButtons();
+ bool iconified = !READ_MERGED_TASBKAR_SETTING(showOnlyIconified);
+ bool halo = READ_MERGED_TASBKAR_SETTING(haloText);
+ bool alwaysDrawButtons = READ_MERGED_TASBKAR_SETTING(drawButtons);
bool drawButton = alwaysDrawButtons ||
(m_mouseOver && !halo && isEnabled() &&
- m_settingsObject->showButtonOnHover());
+ READ_MERGED_TASBKAR_SETTING(showButtonOnHover));
TQFont font(TDEGlobalSettings::taskbarFont());
// draw sunken if we contain the active task
@@ -598,7 +605,7 @@ void TaskContainer::drawButton(TQPainter *p)
if (task->demandsAttention())
{
- demandsAttention = attentionState == m_settingsObject->attentionBlinkIterations() ||
+ demandsAttention = attentionState == READ_MERGED_TASBKAR_SETTING(attentionBlinkIterations) ||
attentionState % 2 == 0;
}
}
@@ -607,12 +614,12 @@ void TaskContainer::drawButton(TQPainter *p)
TQColorGroup colors = palette().active();
- if (m_settingsObject->useCustomColors())
+ if (READ_MERGED_TASBKAR_SETTING(useCustomColors))
{
- 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() );
+ colors.setColor( TQColorGroup::Button, READ_MERGED_TASBKAR_SETTING(taskBackgroundColor));
+ colors.setColor( TQColorGroup::Background, READ_MERGED_TASBKAR_SETTING(taskBackgroundColor) );
+ colors.setColor( TQColorGroup::ButtonText, READ_MERGED_TASBKAR_SETTING(inactiveTaskTextColor) );
+ colors.setColor( TQColorGroup::Text, READ_MERGED_TASBKAR_SETTING(inactiveTaskTextColor) );
}
if (demandsAttention)
@@ -661,7 +668,7 @@ void TaskContainer::drawButton(TQPainter *p)
// draw button background
if (drawButton)
{
- if (m_settingsObject->drawButtons() && KickerSettings::showDeepButtons()) {
+ if (READ_MERGED_TASBKAR_SETTING(drawButtons) && KickerSettings::showDeepButtons()) {
style().tqdrawPrimitive(TQStyle::PE_ButtonBevel, p,
TQRect(1, 1, width()-3, height()-2),
colors, sunken ? TQStyle::Style_On : TQStyle::Style_Raised);
@@ -760,9 +767,9 @@ void TaskContainer::drawButton(TQPainter *p)
}
else // hack for the dotNET style and others
{
- if (m_settingsObject->useCustomColors())
+ if (READ_MERGED_TASBKAR_SETTING(useCustomColors))
{
- textPen = TQPen(m_settingsObject->activeTaskTextColor());
+ textPen = TQPen(READ_MERGED_TASBKAR_SETTING(activeTaskTextColor));
}
else
{
@@ -770,7 +777,7 @@ void TaskContainer::drawButton(TQPainter *p)
}
}
- int availableWidth = width() - (br.x() * 2) - textPos - 2 - (m_settingsObject->drawButtons() && KickerSettings::showDeepButtons())?2:0;
+ int availableWidth = width() - (br.x() * 2) - textPos - 2 - (READ_MERGED_TASBKAR_SETTING(drawButtons) && KickerSettings::showDeepButtons())?2:0;
if (m_filteredTasks.count() > 1)
{
availableWidth -= 8;
@@ -846,7 +853,7 @@ void TaskContainer::drawButton(TQPainter *p)
}
// draw popup arrow
- if ((m_filteredTasks.count() > 1) && (!(m_settingsObject->drawButtons() && KickerSettings::showDeepButtons())))
+ if ((m_filteredTasks.count() > 1) && (!(READ_MERGED_TASBKAR_SETTING(drawButtons) && KickerSettings::showDeepButtons())))
{
TQStyle::PrimitiveElement e = TQStyle::PE_ArrowLeft;
@@ -989,14 +996,14 @@ void TaskContainer::mousePressEvent( TQMouseEvent* e )
switch (e->button())
{
case Qt::LeftButton:
- buttonAction = m_settingsObject->action(m_settingsObject->LeftButton);
+ buttonAction = READ_MERGED_TASBKAR_ACTION(m_settingsObject->LeftButton);
break;
case Qt::MidButton:
- buttonAction = m_settingsObject->action(m_settingsObject->MiddleButton);
+ buttonAction = READ_MERGED_TASBKAR_ACTION(m_settingsObject->MiddleButton);
break;
case Qt::RightButton:
default:
- buttonAction = m_settingsObject->action(m_settingsObject->RightButton);
+ buttonAction = READ_MERGED_TASBKAR_ACTION(m_settingsObject->RightButton);
break;
}
@@ -1012,7 +1019,7 @@ void TaskContainer::mouseReleaseEvent(TQMouseEvent *e)
{
m_dragStartPos = TQPoint();
- if (!m_settingsObject->drawButtons())
+ if (!READ_MERGED_TASBKAR_SETTING(drawButtons))
{
setDown(false);
}
@@ -1030,14 +1037,14 @@ void TaskContainer::mouseReleaseEvent(TQMouseEvent *e)
switch (e->button())
{
case Qt::LeftButton:
- buttonAction = m_settingsObject->action(m_settingsObject->LeftButton);
+ buttonAction = READ_MERGED_TASBKAR_ACTION(m_settingsObject->LeftButton);
break;
case Qt::MidButton:
- buttonAction = m_settingsObject->action(m_settingsObject->MiddleButton);
+ buttonAction = READ_MERGED_TASBKAR_ACTION(m_settingsObject->MiddleButton);
break;
case Qt::RightButton:
default:
- buttonAction = m_settingsObject->action(m_settingsObject->RightButton);
+ buttonAction = READ_MERGED_TASBKAR_ACTION(m_settingsObject->RightButton);
break;
}
@@ -1547,7 +1554,7 @@ void TaskContainer::updateFilteredTaskList()
{
Task::Ptr t = *it;
if ((taskBar->showAllWindows() || t->isOnCurrentDesktop()) &&
- (!m_settingsObject->showOnlyIconified() || t->isIconified()))
+ (!READ_MERGED_TASBKAR_SETTING(showOnlyIconified) || t->isIconified()))
{
pid_t pid = 0;
#ifdef Q_WS_X11
@@ -1568,15 +1575,15 @@ void TaskContainer::updateFilteredTaskList()
if (pid < 0) {
m_filteredTasks.append(t);
}
- else if (m_settingsObject->showTaskStates() != m_settingsObject->ShowAll) {
+ else if (READ_MERGED_TASBKAR_SETTING(showTaskStates) != m_settingsObject->ShowAll) {
if (is_process_resumable(pid)) {
- if (m_settingsObject->showTaskStates() == m_settingsObject->ShowAll) {
+ if (READ_MERGED_TASBKAR_SETTING(showTaskStates) == m_settingsObject->ShowAll) {
m_filteredTasks.append(t);
}
- else if (m_settingsObject->showTaskStates() == m_settingsObject->ShowStopped) {
+ else if (READ_MERGED_TASBKAR_SETTING(showTaskStates) == m_settingsObject->ShowStopped) {
m_filteredTasks.append(t);
}
- else if (m_settingsObject->showTaskStates() == m_settingsObject->ShowRunning) {
+ else if (READ_MERGED_TASBKAR_SETTING(showTaskStates) == m_settingsObject->ShowRunning) {
t->publishIconGeometry( TQRect());
}
else {
@@ -1584,13 +1591,13 @@ void TaskContainer::updateFilteredTaskList()
}
}
else {
- if (m_settingsObject->showTaskStates() == m_settingsObject->ShowAll) {
+ if (READ_MERGED_TASBKAR_SETTING(showTaskStates) == m_settingsObject->ShowAll) {
m_filteredTasks.append(t);
}
- else if (m_settingsObject->showTaskStates() == m_settingsObject->ShowStopped) {
+ else if (READ_MERGED_TASBKAR_SETTING(showTaskStates) == m_settingsObject->ShowStopped) {
t->publishIconGeometry( TQRect());
}
- else if (m_settingsObject->showTaskStates() == m_settingsObject->ShowRunning) {
+ else if (READ_MERGED_TASBKAR_SETTING(showTaskStates) == m_settingsObject->ShowRunning) {
m_filteredTasks.append(t);
}
else {
@@ -1677,12 +1684,12 @@ void TaskContainer::updateKickerTip(KickerTip::Data& data)
if (m_filteredTasks.count() > 0)
{
- if (m_settingsObject->showThumbnails() &&
+ if (READ_MERGED_TASBKAR_SETTING(showThumbnails) &&
m_filteredTasks.count() == 1)
{
Task::Ptr t = m_filteredTasks.first();
- pixmap = t->thumbnail(m_settingsObject->thumbnailMaxDimension());
+ pixmap = t->thumbnail(READ_MERGED_TASBKAR_SETTING(thumbnailMaxDimension));
}
if (pixmap.isNull() && tasks.count())
@@ -1725,7 +1732,7 @@ void TaskContainer::updateKickerTip(KickerTip::Data& data)
}
}
- if (m_settingsObject->showAllWindows() && KWin::numberOfDesktops() > 1)
+ if (READ_MERGED_TASBKAR_SETTING(showAllWindows) && KWin::numberOfDesktops() > 1)
{
if (desktopMap.isEmpty())
{
diff --git a/kicker/taskbar/taskcontainer.h b/kicker/taskbar/taskcontainer.h
index a176a0787..b7016477e 100644
--- a/kicker/taskbar/taskcontainer.h
+++ b/kicker/taskbar/taskcontainer.h
@@ -45,9 +45,8 @@ public:
typedef TQValueList<TaskContainer*> List;
typedef TQValueList<TaskContainer*>::iterator Iterator;
- 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);
+ TaskContainer(Task::Ptr, TaskBar*, TaskBarSettings* settingsObject, TaskBarSettings* globalSettingsObject, TQWidget *parent = 0, const char *name = 0);
+ TaskContainer(Startup::Ptr, PixmapList&, TaskBar*, TaskBarSettings* settingsObject, TaskBarSettings* globalSettingsObject, TQWidget *parent = 0, const char *name = 0);
virtual ~TaskContainer();
void setArrowType( TQt::ArrowType at );
@@ -151,6 +150,7 @@ private:
enum { ATTENTION_BLINK_TIMEOUT = 4 };
TQPoint m_dragStartPos;
TaskBarSettings* m_settingsObject;
+ TaskBarSettings* m_globalSettingsObject;
};
#endif