kcmtaskbar: UI improvements

The module settings are now split between three tabs,
which looks better overall and a little less overloaded.

Additionaly, some new settings which were already present
for the config have been exposed (thumbnails, max button
width).

Finally, some settings have been further refined for
customization (button styles, which were previously
hardcoded -Clssic, Optimal, For transparency- can
now be precisely configured.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/266/head
Mavridis Philippe 3 years ago committed by Michele Calgaro
parent e8acdbd891
commit 8059293813
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -24,6 +24,7 @@
#include <tqfile.h> #include <tqfile.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <tqbuttongroup.h> #include <tqbuttongroup.h>
#include <tqtabwidget.h>
#include <dcopclient.h> #include <dcopclient.h>
@ -218,6 +219,7 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL
{ {
m_widget->appearance->insertItem((*it).name()); m_widget->appearance->insertItem((*it).name());
} }
m_widget->appearance->insertItem(i18n("Custom"));
connect(m_widget->appearance, TQT_SIGNAL(activated(int)), connect(m_widget->appearance, TQT_SIGNAL(activated(int)),
this, TQT_SLOT(appearanceChanged(int))); this, TQT_SLOT(appearanceChanged(int)));
@ -247,7 +249,7 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL
{ {
m_widget->kcfg_ShowAllWindows->hide(); m_widget->kcfg_ShowAllWindows->hide();
m_widget->kcfg_SortByDesktop->hide(); m_widget->kcfg_SortByDesktop->hide();
m_widget->spacer2->changeSize(0, 0); // m_widget->spacer2->changeSize(0, 0);
} }
if (!TQApplication::desktop()->isVirtualDesktop() || if (!TQApplication::desktop()->isVirtualDesktop() ||
@ -306,14 +308,12 @@ void TaskbarConfig::processLockouts()
m_widget->localConfigWarning->show(); m_widget->localConfigWarning->show();
m_widget->kcfg_UseGlobalSettings->show(); m_widget->kcfg_UseGlobalSettings->show();
if (m_widget->kcfg_UseGlobalSettings->isChecked()) { if (m_widget->kcfg_UseGlobalSettings->isChecked()) {
m_widget->taskbarGroup->hide(); m_widget->tabs->hide();
m_widget->actionsGroup->hide();
m_widget->globalConfigReload->hide(); m_widget->globalConfigReload->hide();
m_widget->globalConfigEdit->show(); m_widget->globalConfigEdit->show();
} }
else { else {
m_widget->taskbarGroup->show(); m_widget->tabs->show();
m_widget->actionsGroup->show();
// FIXME // FIXME
// Disable this feature until a method can be found to force the TDECModule to reload its settings from disk after the global settings have been copied! // Disable this feature until a method can be found to force the TDECModule to reload its settings from disk after the global settings have been copied!
//m_widget->globalConfigReload->show(); //m_widget->globalConfigReload->show();
@ -384,23 +384,37 @@ void TaskbarConfig::updateAppearanceCombo()
if (i < m_appearances.count()) if (i < m_appearances.count())
{ {
m_widget->appearance->setCurrentItem(i); m_widget->appearance->setCurrentItem(i);
m_widget->customAppearance->setEnabled(false);
return; return;
} }
if (m_widget->appearance->count() == (int)m_appearances.count()) else if (m_widget->appearance->count() == (int)m_appearances.count())
{ {
m_widget->appearance->insertItem(i18n("Custom")); m_widget->customAppearance->setEnabled(true);
} }
m_widget->appearance->setCurrentItem(m_appearances.count()); m_widget->appearance->setCurrentItem(m_appearances.count());
} }
void TaskbarConfig::updateCustomAppearance()
{
m_widget->kcfg_DrawButtons ->setChecked(m_settingsObject->drawButtons());
m_widget->kcfg_HaloText ->setChecked(m_settingsObject->haloText());
m_widget->kcfg_ShowButtonOnHover->setChecked(m_settingsObject->showButtonOnHover());
}
void TaskbarConfig::appearanceChanged(int selected) void TaskbarConfig::appearanceChanged(int selected)
{ {
if (selected < (int)m_appearances.count()) if (selected < m_appearances.count())
{ {
m_widget->customAppearance->setEnabled(false);
unmanagedWidgetChangeState(!m_appearances[selected].matchesSettings()); unmanagedWidgetChangeState(!m_appearances[selected].matchesSettings());
} }
else if(selected == m_appearances.count())
{
m_widget->customAppearance->setEnabled(true);
updateCustomAppearance();
}
} }
void TaskbarConfig::load() void TaskbarConfig::load()
@ -413,6 +427,8 @@ void TaskbarConfig::load()
void TaskbarConfig::save() void TaskbarConfig::save()
{ {
TDECModule::save();
m_settingsObject->setShowCurrentScreenOnly(!m_widget->showAllScreens->isChecked()); m_settingsObject->setShowCurrentScreenOnly(!m_widget->showAllScreens->isChecked());
int selectedAppearance = m_widget->appearance->currentItem(); int selectedAppearance = m_widget->appearance->currentItem();
if (selectedAppearance < (int)m_appearances.count()) if (selectedAppearance < (int)m_appearances.count())
@ -421,8 +437,6 @@ void TaskbarConfig::save()
m_settingsObject->writeConfig(); m_settingsObject->writeConfig();
} }
TDECModule::save();
TQByteArray data; TQByteArray data;
kapp->dcopClient()->emitDCOPSignal("kdeTaskBarConfigChanged()", data); kapp->dcopClient()->emitDCOPSignal("kdeTaskBarConfigChanged()", data);
} }

@ -78,6 +78,7 @@ private slots:
private: private:
TaskbarAppearance::List m_appearances; TaskbarAppearance::List m_appearances;
void updateAppearanceCombo(); void updateAppearanceCombo();
void updateCustomAppearance();
static const TQStringList& actionList(); static const TQStringList& actionList();
static TQStringList i18nActionList(); static TQStringList i18nActionList();
static const TQStringList& groupModeList(); static const TQStringList& groupModeList();

File diff suppressed because it is too large Load Diff

@ -91,9 +91,10 @@
</entry> </entry>
<entry key="MaximumButtonWidth" type="Int" > <entry key="MaximumButtonWidth" type="Int" >
<default>200</default> <default>200</default>
<min>0</min> <min>50</min>
<label></label> <max>500</max>
<whatsthis></whatsthis> <label>Maximum button width</label>
<whatsthis>The maximum width to which a taskbar item can expand.</whatsthis>
</entry> </entry>
<entry key="MinimumButtonHeight" type="Int" > <entry key="MinimumButtonHeight" type="Int" >
<default>18</default> <default>18</default>

Loading…
Cancel
Save