summaryrefslogtreecommitdiffstats
path: root/kicker/taskbar/taskbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kicker/taskbar/taskbar.cpp')
-rw-r--r--kicker/taskbar/taskbar.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/kicker/taskbar/taskbar.cpp b/kicker/taskbar/taskbar.cpp
index 0838082d1..1e27050f3 100644
--- a/kicker/taskbar/taskbar.cpp
+++ b/kicker/taskbar/taskbar.cpp
@@ -81,6 +81,7 @@ TaskBar::TaskBar( TaskBarSettings* settingsObject, TaskBarSettings* globalSettin
// init
setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) );
+ m_sortByAppPrev = READ_MERGED_TASBKAR_SETTING(sortByApp);
// setup animation frames
for (int i = 1; i < 11; i++)
@@ -293,6 +294,11 @@ void TaskBar::configure()
}
}
+ if (m_sortByAppPrev != READ_MERGED_TASBKAR_SETTING(sortByApp)) {
+ m_sortByAppPrev = READ_MERGED_TASBKAR_SETTING(sortByApp);
+ reSort();
+ }
+
TaskManager::the()->setXCompositeEnabled(READ_MERGED_TASBKAR_SETTING(showThumbnails));
reLayoutEventually();
@@ -390,6 +396,24 @@ void TaskBar::add(Startup::Ptr startup)
connect(container, TQT_SIGNAL(showMe(TaskContainer*)), this, TQT_SLOT(showTaskContainer(TaskContainer*)));
}
+void TaskBar::reSort()
+{
+ TaskContainer::List originalContainers = containers;
+ TaskContainer::Iterator it = originalContainers.begin();
+ for (; it != originalContainers.end(); ++it)
+ {
+ removeChild(*it);
+ }
+ containers.clear();
+ it = originalContainers.begin();
+ for (; it != originalContainers.end(); ++it)
+ {
+ showTaskContainer(*it);
+ }
+ reLayoutEventually();
+ emit containerCountChanged();
+}
+
void TaskBar::showTaskContainer(TaskContainer* container)
{
TaskContainer::List::iterator it = m_hiddenContainers.find(container);
@@ -427,6 +451,16 @@ void TaskBar::showTaskContainer(TaskContainer* container)
}
}
+ // alphabetize containers
+ it = containers.begin();
+ for (; it != containers.end(); ++it)
+ {
+ TaskContainer* c = *it;
+ if (TQString::localeAwareCompare(container->id().lower(), c->id().lower()) < 0) {
+ break;
+ }
+ }
+
if (it != containers.end())
{
containers.insert(it, container);