From 7119c2b2688b9e7ece707a60f28028b36d1120f9 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 28 Oct 2013 11:02:52 +0100 Subject: Add option to display only icons on taskbar This resolves Bug 360 --- kcontrol/taskbar/kcmtaskbar.cpp | 28 ++++++++++++++++++++++++++++ kcontrol/taskbar/kcmtaskbar.h | 8 ++++++++ kcontrol/taskbar/kcmtaskbarui.ui | 39 +++++++++++++++++++++++++-------------- 3 files changed, 61 insertions(+), 14 deletions(-) (limited to 'kcontrol') diff --git a/kcontrol/taskbar/kcmtaskbar.cpp b/kcontrol/taskbar/kcmtaskbar.cpp index bd98ee3f9..788187ca7 100644 --- a/kcontrol/taskbar/kcmtaskbar.cpp +++ b/kcontrol/taskbar/kcmtaskbar.cpp @@ -14,6 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software + + -------------------------------------------------------------- + Additional changes: + - 2013/10/22 Michele Calgaro + * added support for display mode (Icons and Text, Text only, Icons only) + and removed "Show application icons" */ #include @@ -151,6 +157,27 @@ TQStringList TaskbarConfig::i18nShowTaskStatesList() return i18nList; } +// These are the strings that are actually stored in the config file. +const TQStringList& TaskbarConfig::displayIconsNText() +{ + static TQStringList list(TQStringList() + << I18N_NOOP("Icons and Text") + << I18N_NOOP("Text only") + << I18N_NOOP("Icons only")); + return list; +} + +// Get a translated version of the above string list. +TQStringList TaskbarConfig::i18ndisplayIconsNText() +{ + TQStringList i18nList; + for (TQStringList::ConstIterator it = displayIconsNText().begin(); it != displayIconsNText().end(); ++it) + { + i18nList << i18n((*it).latin1()); + } + return i18nList; +} + TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringList& args) : TDECModule(TaskBarFactory::instance(), parent, name), m_settingsObject(NULL) @@ -211,6 +238,7 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL m_widget->kcfg_LeftButtonAction->insertStringList(list); m_widget->kcfg_MiddleButtonAction->insertStringList(list); m_widget->kcfg_RightButtonAction->insertStringList(list); + m_widget->kcfg_DisplayIconsNText->insertStringList(i18ndisplayIconsNText()); m_widget->kcfg_GroupTasks->insertStringList(i18nGroupModeList()); m_widget->kcfg_ShowTaskStates->insertStringList(i18nShowTaskStatesList()); diff --git a/kcontrol/taskbar/kcmtaskbar.h b/kcontrol/taskbar/kcmtaskbar.h index b0fe0c7ea..f14500a68 100644 --- a/kcontrol/taskbar/kcmtaskbar.h +++ b/kcontrol/taskbar/kcmtaskbar.h @@ -14,6 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software + + -------------------------------------------------------------- + Additional changes: + - 2013/10/22 Michele Calgaro + * added support for display mode (Icons and Text, Text only, Icons only) + and removed "Show application icons" */ #ifndef __kcmtaskbar_h__ @@ -84,6 +90,8 @@ private: static TQStringList i18nGroupModeList(); static const TQStringList& showTaskStatesList(); static TQStringList i18nShowTaskStatesList(); + static const TQStringList& displayIconsNText(); + static TQStringList i18ndisplayIconsNText(); TaskbarConfigUI *m_widget; TQString m_configFileName; TaskBarSettings* m_settingsObject; diff --git a/kcontrol/taskbar/kcmtaskbarui.ui b/kcontrol/taskbar/kcmtaskbarui.ui index 4d655b2a7..d136fe50e 100644 --- a/kcontrol/taskbar/kcmtaskbarui.ui +++ b/kcontrol/taskbar/kcmtaskbarui.ui @@ -144,7 +144,7 @@ By default, this option is selected and all windows are shown. Turning this option on will allow tasks on the taskbar to be manually rearranged using drag and drop. - + kcfg_ShowWindowListBtn @@ -180,13 +180,13 @@ By default the taskbar groups windows when it is full. - groupTasksLabel + groupTasksLabel &Group similar tasks: - kcfg_ShowTaskStates + kcfg_GroupTasks @@ -202,7 +202,7 @@ By default the taskbar groups windows when it is full. - The taskbar can show and/or hide tasks based on their current process state. Select <em>Any</em> to show all tasks regardless of current state. + The taskbar can show and/or hide tasks based on their current process state. Select <em>Any</em> to show all tasks regardless of current state. @@ -210,7 +210,7 @@ By default the taskbar groups windows when it is full. showTaskStatesLabel - &Show tasks with state: + &Show tasks with state: kcfg_ShowTaskStates @@ -229,20 +229,31 @@ By default the taskbar groups windows when it is full. By default, this option is not selected and the taskbar will show all windows. - + - kcfg_ShowIcon + displayIconsNText - Sho&w application icons + Dis&play: - - true + + kcfg_DisplayIconsNText + + + + + kcfg_DisplayIconsNText + + + + 7 + 0 + 0 + 0 + - Select this option if you want window icons to appear along with their titles in the taskbar. - -By default this option is selected. + Choose taskbar display mode among <strong>Icons and text</strong>, <strong>Text only</strong> and <strong>Icons only</strong>. @@ -568,8 +579,8 @@ By default, this option is selected and all windows are shown. showAllScreens kcfg_SortByApp kcfg_ShowOnlyIconified - kcfg_ShowIcon kcfg_ShowWindowListBtn + kcfg_DisplayIconsNText kcfg_GroupTasks kcfg_ShowTaskStates appearance -- cgit v1.2.1