From 74466041a674faaaf22f586968f275e2606e08fe Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Fri, 15 Apr 2022 19:26:19 +0300 Subject: Taskbar: small/panel icon size selection. By default the 16x16 value was hardcoded into the taskbar, which is not correct. With this commit the default value is TDEIcon::Small (can be defined in TCC->LookNFeel->Icons) to retain the "classic" style. This commit adds a "Small icons" checkbox which can be unchecked to set the icon size to TDEIcon::Panel (for consistency with other panel icons). Combined with "Icons only", this produces a Plasma/Windows-like big icon taskbar. This commit also ensures that in "Icons only" mode the icons are centered in their button, for better looking result. Finally, this commit fixes a typo in some macros (TABSKAR -> TASKBAR). Signed-off-by: Mavridis Philippe --- kcontrol/taskbar/kcmtaskbar.cpp | 20 ++++++++++- kcontrol/taskbar/kcmtaskbarui.ui | 78 +++++++++++++++++++--------------------- 2 files changed, 55 insertions(+), 43 deletions(-) (limited to 'kcontrol/taskbar') diff --git a/kcontrol/taskbar/kcmtaskbar.cpp b/kcontrol/taskbar/kcmtaskbar.cpp index f2997a331..bb7a7a8b9 100644 --- a/kcontrol/taskbar/kcmtaskbar.cpp +++ b/kcontrol/taskbar/kcmtaskbar.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #define protected public #include "kcmtaskbarui.h" @@ -262,6 +263,7 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL m_widget->showAllScreens->show(); } connect( m_widget->showAllScreens, TQT_SIGNAL( stateChanged( int )), TQT_SLOT( changed())); + connect( m_widget->smallIcons, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()) ); TDEAboutData *about = new TDEAboutData(I18N_NOOP("kcmtaskbar"), I18N_NOOP("TDE Taskbar Control Module"), @@ -423,20 +425,36 @@ void TaskbarConfig::load() slotUpdateComboBox(); updateAppearanceCombo(); m_widget->showAllScreens->setChecked(!m_settingsObject->showCurrentScreenOnly()); + + int iconSize = m_settingsObject->iconSize(); + if(kapp->iconLoader()->currentSize(TDEIcon::Small) != iconSize) + { + m_widget->smallIcons->setChecked(false); + } } void TaskbarConfig::save() { TDECModule::save(); + if(m_widget->smallIcons->isChecked()) + { + m_settingsObject->setIconSize(kapp->iconLoader()->currentSize(TDEIcon::Small)); + } + else + { + m_settingsObject->setIconSize(kapp->iconLoader()->currentSize(TDEIcon::Panel)); + } + m_settingsObject->setShowCurrentScreenOnly(!m_widget->showAllScreens->isChecked()); int selectedAppearance = m_widget->appearance->currentItem(); if (selectedAppearance < (int)m_appearances.count()) { m_appearances[selectedAppearance].alterSettings(); - m_settingsObject->writeConfig(); } + m_settingsObject->writeConfig(); + TQByteArray data; kapp->dcopClient()->emitDCOPSignal("kdeTaskBarConfigChanged()", data); } diff --git a/kcontrol/taskbar/kcmtaskbarui.ui b/kcontrol/taskbar/kcmtaskbarui.ui index 5723c76d7..ae4f4531d 100644 --- a/kcontrol/taskbar/kcmtaskbarui.ui +++ b/kcontrol/taskbar/kcmtaskbarui.ui @@ -667,48 +667,6 @@ By default the taskbar groups windows when it is full. Choose taskbar display mode among <strong>Icons and text</strong>, <strong>Text only</strong> and <strong>Icons only</strong>. - - - kcfg_ShowThumbnails - - - Show thumbnails on hover - - - - - spacer2_2_2_3 - - - Horizontal - - - Fixed - - - - 20 - 20 - - - - - - spacer2_2_2_3_2 - - - Vertical - - - Fixed - - - - 20 - 16 - - - displayIconsNTextLabel @@ -734,6 +692,14 @@ By default the taskbar groups windows when it is full. kcfg_DisplayIconsNText + + + kcfg_ShowThumbnails + + + Show thumbnails on hover + + kcfg_ThumbnailMaxDimension @@ -754,6 +720,23 @@ By default the taskbar groups windows when it is full. 100 + + + spacer2_2_2_3 + + + Horizontal + + + Fixed + + + + 20 + 20 + + + thumbMaxDimensionLabel @@ -765,6 +748,17 @@ By default the taskbar groups windows when it is full. Maximum dimension: + + + smallIcons + + + Small icons + + + true + + -- cgit v1.2.1