From 80592938130c5f3eb0406c98a6a0942a495c54d5 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Fri, 15 Apr 2022 17:41:19 +0300 Subject: 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 --- kcontrol/taskbar/kcmtaskbar.cpp | 34 +- kcontrol/taskbar/kcmtaskbar.h | 1 + kcontrol/taskbar/kcmtaskbarui.ui | 1507 +++++++++++++++++++++++++------------- 3 files changed, 1029 insertions(+), 513 deletions(-) (limited to 'kcontrol/taskbar') diff --git a/kcontrol/taskbar/kcmtaskbar.cpp b/kcontrol/taskbar/kcmtaskbar.cpp index 941c8b986..f2997a331 100644 --- a/kcontrol/taskbar/kcmtaskbar.cpp +++ b/kcontrol/taskbar/kcmtaskbar.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -218,6 +219,7 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL { m_widget->appearance->insertItem((*it).name()); } + m_widget->appearance->insertItem(i18n("Custom")); connect(m_widget->appearance, TQT_SIGNAL(activated(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_SortByDesktop->hide(); - m_widget->spacer2->changeSize(0, 0); + // m_widget->spacer2->changeSize(0, 0); } if (!TQApplication::desktop()->isVirtualDesktop() || @@ -306,14 +308,12 @@ void TaskbarConfig::processLockouts() m_widget->localConfigWarning->show(); m_widget->kcfg_UseGlobalSettings->show(); if (m_widget->kcfg_UseGlobalSettings->isChecked()) { - m_widget->taskbarGroup->hide(); - m_widget->actionsGroup->hide(); + m_widget->tabs->hide(); m_widget->globalConfigReload->hide(); m_widget->globalConfigEdit->show(); } else { - m_widget->taskbarGroup->show(); - m_widget->actionsGroup->show(); + m_widget->tabs->show(); // 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! //m_widget->globalConfigReload->show(); @@ -384,23 +384,37 @@ void TaskbarConfig::updateAppearanceCombo() if (i < m_appearances.count()) { m_widget->appearance->setCurrentItem(i); + m_widget->customAppearance->setEnabled(false); 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()); } +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) { - if (selected < (int)m_appearances.count()) + if (selected < m_appearances.count()) { + m_widget->customAppearance->setEnabled(false); unmanagedWidgetChangeState(!m_appearances[selected].matchesSettings()); } + else if(selected == m_appearances.count()) + { + m_widget->customAppearance->setEnabled(true); + updateCustomAppearance(); + } } void TaskbarConfig::load() @@ -413,6 +427,8 @@ void TaskbarConfig::load() void TaskbarConfig::save() { + TDECModule::save(); + m_settingsObject->setShowCurrentScreenOnly(!m_widget->showAllScreens->isChecked()); int selectedAppearance = m_widget->appearance->currentItem(); if (selectedAppearance < (int)m_appearances.count()) @@ -421,8 +437,6 @@ void TaskbarConfig::save() m_settingsObject->writeConfig(); } - TDECModule::save(); - TQByteArray data; kapp->dcopClient()->emitDCOPSignal("kdeTaskBarConfigChanged()", data); } diff --git a/kcontrol/taskbar/kcmtaskbar.h b/kcontrol/taskbar/kcmtaskbar.h index 4d644bd0f..68fb91e12 100644 --- a/kcontrol/taskbar/kcmtaskbar.h +++ b/kcontrol/taskbar/kcmtaskbar.h @@ -78,6 +78,7 @@ private slots: private: TaskbarAppearance::List m_appearances; void updateAppearanceCombo(); + void updateCustomAppearance(); static const TQStringList& actionList(); static TQStringList i18nActionList(); static const TQStringList& groupModeList(); diff --git a/kcontrol/taskbar/kcmtaskbarui.ui b/kcontrol/taskbar/kcmtaskbarui.ui index f5c36e2b2..5723c76d7 100644 --- a/kcontrol/taskbar/kcmtaskbarui.ui +++ b/kcontrol/taskbar/kcmtaskbarui.ui @@ -8,8 +8,8 @@ 0 0 - 358 - 351 + 813 + 616 @@ -22,581 +22,1082 @@ unnamed - 0 + 5 - - - GroupBox2 - - - Settings - - - - unnamed - - - - globalConfigWarning - - - <b>NOTE: Currently you are editing the global taskbar configuration.</b><br>To change the configuration of a specific taskbar (when using multiple taskbars), use the corresponding Configure Taskbar menu option, located in the taskbar handle popup menu. - - - - - localConfigWarning - - - <b>NOTE:</b> Currently you are editing the taskbar configuration for <b>only</b> this taskbar. - - - - - kcfg_UseGlobalSettings - - - Use global floating taskbar configuration - - - true - - - Selecting this option causes the taskbar to use the global taskbar configuration. - - - - - globalConfigReload - - - Overwrite current configuration with the current global floating taskbar configuration - - - - - globalConfigEdit - - - Edit global floating taskbar configuration - - - - - + - taskbarGroup + layout8 - - Taskbar - - - - - - + unnamed - + - kcfg_ShowAllWindows + localConfigWarning - &Show windows from all desktops - - - true - - - Turning this option off will cause the taskbar to display <b>only</b> the windows on the current desktop. - -By default, this option is selected and all windows are shown. + <b>NOTE:</b> Currently you are editing the taskbar configuration for <b>only</b> this taskbar. - + - kcfg_SortByDesktop + globalConfigWarning - Sort windows by desk&top - - - true - - - Selecting this option causes the taskbar to show windows in order of the desktop they appear on. - -By default this option is selected. + <b>NOTE: Currently you are editing the global taskbar configuration.</b><br>To change the configuration of a specific taskbar (when using multiple taskbars), use the corresponding Configure Taskbar menu option, located in the taskbar handle popup menu. - + - showAllScreens + kcfg_UseGlobalSettings - Show windows from all sc&reens + Use global floating taskbar configuration true - Turning this option off will cause the taskbar to display <b>only</b> windows which are on the same Xinerama screen as the taskbar. - -By default, this option is selected and all windows are shown. + Selecting this option causes the taskbar to use the global taskbar configuration. - + - kcfg_SortByApp + globalConfigReload - Sort alphabeticall&y by application name - - - true + Overwrite current configuration with the current global floating taskbar configuration - + - kcfg_AllowDragAndDropReArrange + globalConfigEdit - &Allow taskbar items to be rearranged using drag and drop - - - true - - - Turning this option on will allow tasks on the taskbar to be manually rearranged using drag and drop. + Edit global floating taskbar configuration - - - kcfg_CycleWheel - - - Cycle through windows with mouse wheel - - - true - - - + + + + + tabs + + + + 5 + 3 + 0 + 0 + + + + + tab + + + &Tasks + + - kcfg_ShowOnlyIconified - - - Show o&nly minimized windows + unnamed - - Select this option if you want the taskbar to display <b>only</b> minimized windows. + + + grpDisplay + + + Display + + + + unnamed + + + + kcfg_ShowAllWindows + + + &Show windows from all desktops + + + Alt+S + + + true + + + Turning this option off will cause the taskbar to display <b>only</b> the windows on the current desktop. + +By default, this option is selected and all windows are shown. + + + + + kcfg_ShowOnlyIconified + + + Show o&nly minimized windows + + + Alt+N + + + Select this option if you want the taskbar to display <b>only</b> minimized windows. By default, this option is not selected and the taskbar will show all windows. - - - - - kcfg_ShowWindowListBtn - - - Show window list &button - - - true - - - Selecting this option causes the taskbar to display a button that, when clicked, shows a list of all windows in a popup menu. - - - - - displayIconsNText - - - Dis&play: - - - kcfg_DisplayIconsNText - - - - - kcfg_DisplayIconsNText - - - - 7 - 0 - 0 - 0 - - - - Choose taskbar display mode among <strong>Icons and text</strong>, <strong>Text only</strong> and <strong>Icons only</strong>. - - - - - kcfg_GroupTasks - - - - 7 - 0 - 0 - 0 - - - - The taskbar can group similar windows into single buttons. When one of these window group buttons are clicked on a menu appears showing all the windows in that group. This can be especially useful with the <em>Show all windows</em> option. + + + + + kSeparator5 + + + + + showAllScreens + + + Show windows from all sc&reens + + + Alt+R + + + true + + + Turning this option off will cause the taskbar to display <b>only</b> windows which are on the same Xinerama screen as the taskbar. + +By default, this option is selected and all windows are shown. + + + + + kcfg_ShowTaskStates + + + + 7 + 0 + 0 + 0 + + + + + 250 + 0 + + + + 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. + + + + + showTaskStatesLabel + + + + 250 + 0 + + + + &Show tasks with state: + + + kcfg_ShowTaskStates + + + + + spacer23 + + + Horizontal + + + Expanding + + + + 31 + 20 + + + + + + + + grpSortGroup + + + Sorting and grouping + + + + unnamed + + + + spacer2_2 + + + Horizontal + + + Fixed + + + + 20 + 20 + + + + + + kcfg_AllowDragAndDropReArrange + + + &Allow taskbar items to be rearranged using drag and drop + + + Alt+A + + + true + + + Turning this option on will allow tasks on the taskbar to be manually rearranged using drag and drop. + + + + + kcfg_SortByApp + + + Sort alphabeticall&y by application name + + + Alt+Y + + + true + + + + + kcfg_SortByDesktop + + + Sort windows by desk&top + + + Alt+T + + + true + + + Selecting this option causes the taskbar to show windows in order of the desktop they appear on. + +By default this option is selected. + + + + + kSeparator6 + + + + + groupTasksLabel + + + + 250 + 0 + + + + &Group similar tasks: + + + kcfg_GroupTasks + + + + + kcfg_GroupTasks + + + + 7 + 0 + 0 + 0 + + + + + 300 + 0 + + + + The taskbar can group similar windows into single buttons. When one of these window group buttons are clicked on a menu appears showing all the windows in that group. This can be especially useful with the <em>Show all windows</em> option. You can set the taskbar to <strong>Never</strong> group windows, to <strong>Always</strong> group windows or to group windows only <strong>When the Taskbar is Full</strong>. By default the taskbar groups windows when it is full. - - - - - groupTasksLabel - - - &Group similar tasks: - - - kcfg_GroupTasks - - - - - kcfg_ShowTaskStates - - - - 7 - 0 - 0 - 0 - - - - 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. - - - - - showTaskStatesLabel - - - &Show tasks with state: - - - kcfg_ShowTaskStates - - - - - appearance - - - - - textLabel1 - - - A&ppearance: - - - appearance - - - - - kcfg_UseCustomColors - - - true - - - Use &custom colors - - - true - - - + + + + + spacer23_2 + + + Horizontal + + + Expanding + + + + 31 + 20 + + + + + + + + spacer16 + + + Vertical + + + Minimum + + + + 20 + 20 + + + + + + + + TabPage + + + &Appearance + + - layout9 + unnamed - + - unnamed + spacer21 - - - inactiveTaskTextColorLabel - - - Inacti&ve task text color: - - - kcfg_InactiveTaskTextColor - - - - - kcfg_InactiveTaskTextColor - - - - - - - - spacer11 - - - Horizontal - - - Expanding - - - - 191 - 20 - - - - - - activeTaskTextColorLabel - - - Active task te&xt color: - - - kcfg_ActiveTaskTextColor - - - - - kcfg_ActiveTaskTextColor - - - - - - + + Vertical + + + Minimum + + + + 20 + 20 + + + + + + grpTaskbarColors + + + + 3 + 5 + 0 + 0 + + + + Colors + + - spacer11_2 - - - Horizontal - - - Expanding - - - - 191 - 20 - + unnamed - - + + + spacer2_2_2 + + + Horizontal + + + Fixed + + + + 20 + 20 + + + + + + kcfg_UseCustomColors + + + true + + + Use &custom colors + + + Alt+C + + + true + + + + + layout19 + + + + unnamed + + + + activeTaskTextColorLabel + + + + 1 + 5 + 0 + 0 + + + + Active task te&xt color: + + + kcfg_ActiveTaskTextColor + + + + + taskBackgroundColorLabel + + + + 1 + 5 + 0 + 0 + + + + &Background color: + + + kcfg_TaskBackgroundColor + + + + + kcfg_InactiveTaskTextColor + + + + + + + + kcfg_ActiveTaskTextColor + + + + + + + + kcfg_TaskBackgroundColor + + + + + + + + inactiveTaskTextColorLabel + + + + 1 + 5 + 0 + 0 + + + + Inacti&ve task text color: + + + kcfg_InactiveTaskTextColor + + + + + + + + + grpAppearanceMisc + + + + 1 + 5 + 0 + 0 + + + + Miscellaneous + + - taskBackgroundColorLabel + unnamed - - &Background color: - - - kcfg_TaskBackgroundColor - - - + + + kcfg_ShowWindowListBtn + + + Show window list &button + + + Alt+B + + + true + + + Selecting this option causes the taskbar to display a button that, when clicked, shows a list of all windows in a popup menu. + + + + + kcfg_MaximumButtonWidth + + + px + + + 500 + + + 10 + + + 200 + + + + + maxButtonWidthLabel + + + Maximum button width: + + + + + + + grpIconsNText + + + + 7 + 5 + 0 + 0 + + + + Icons + + - kcfg_TaskBackgroundColor + unnamed - - - - - + + + kcfg_DisplayIconsNText + + + + 5 + 0 + 0 + 0 + + + + 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 + + + + 1 + 5 + 0 + 0 + + + + + 100 + 0 + + + + Dis&play: + + + kcfg_DisplayIconsNText + + + + + kcfg_ThumbnailMaxDimension + + + false + + + px + + + 500 + + + 50 + + + 100 + + + + + thumbMaxDimensionLabel + + + false + + + Maximum dimension: + + + + + + + grpTaskbarStyle + + + + 7 + 5 + 0 + 0 + + + + Button style + + - spacer12 - - - Horizontal + unnamed - - Expanding - - - - 191 - 20 - - - - - - - - spacer2 - - - Horizontal - - - Fixed - - - - 20 - 20 - - - - - - - - actionsGroup - - - Actions - - + + + textLabel1 + + + Taskbar style: + + + appearance + + + + + appearance + + + + 5 + 0 + 0 + 0 + + + + + + customAppearance + + + false + + + StyledPanel + + + Raised + + + + unnamed + + + + kcfg_HaloText + + + Draw halo around text + + + + + + true + + + + + kcfg_DrawButtons + + + Always draw items as buttons + + + + + + + + spacer2_2_2_3_3 + + + Horizontal + + + Fixed + + + + 20 + 20 + + + + + + kcfg_ShowButtonOnHover + + + Draw items as buttons on hover + + + + + + + + + + + + - unnamed + tab - - - leftButtonLabel - - - &Left button: - - - kcfg_LeftButtonAction - - - + + A&ctions + + - middleButtonLabel + unnamed - - &Middle button: - - - kcfg_MiddleButtonAction - - - - - rightButtonLabel - - - Right b&utton: - - - kcfg_RightButtonAction - - - - - kcfg_LeftButtonAction - - - - 7 - 0 - 0 - 0 - - - - - - kcfg_MiddleButtonAction - - - - 7 - 0 - 0 - 0 - - - - - - kcfg_RightButtonAction - - - - 7 - 0 - 0 - 0 - - - - + + + actionsGroup + + + + 5 + 1 + 0 + 0 + + + + Mouse Actions + + + + unnamed + + + + leftButtonLabel + + + &Left button: + + + kcfg_LeftButtonAction + + + + + kcfg_LeftButtonAction + + + + 7 + 0 + 0 + 0 + + + + + + middleButtonLabel + + + &Middle button: + + + kcfg_MiddleButtonAction + + + + + kcfg_MiddleButtonAction + + + + 7 + 0 + 0 + 0 + + + + + + kcfg_RightButtonAction + + + + 7 + 0 + 0 + 0 + + + + + + rightButtonLabel + + + Right b&utton: + + + kcfg_RightButtonAction + + + + + kcfg_CycleWheel + + + Cycle through windows with mouse wheel + + + true + + + + + spacer11 + + + Vertical + + + Fixed + + + + 20 + 21 + + + + + + + + spacer35 + + + Vertical + + + Minimum + + + + 20 + 20 + + + + + - - - Spacer1 - - - Vertical - - - Expanding - - - - 20 - 20 - - - + + kcfg_ShowThumbnails + toggled(bool) + kcfg_ThumbnailMaxDimension + setEnabled(bool) + + + kcfg_UseCustomColors + toggled(bool) + kcfg_InactiveTaskTextColor + setEnabled(bool) + + + kcfg_UseCustomColors + toggled(bool) + kcfg_ActiveTaskTextColor + setEnabled(bool) + + + kcfg_UseCustomColors + toggled(bool) + kcfg_TaskBackgroundColor + setEnabled(bool) + + + kcfg_ShowThumbnails + toggled(bool) + thumbMaxDimensionLabel + setEnabled(bool) + + + kcfg_SortByApp + toggled(bool) + kcfg_AllowDragAndDropReArrange + setDisabled(bool) + kcfg_ShowAllWindows toggled(bool) kcfg_SortByDesktop setEnabled(bool) + + kcfg_DrawButtons + toggled(bool) + kcfg_ShowButtonOnHover + setDisabled(bool) + - - kcfg_ShowAllWindows - kcfg_SortByDesktop - showAllScreens - kcfg_SortByApp - kcfg_AllowDragAndDropReArrange - kcfg_CycleWheel - kcfg_ShowOnlyIconified - kcfg_ShowWindowListBtn - kcfg_DisplayIconsNText - kcfg_GroupTasks - kcfg_ShowTaskStates - appearance - kcfg_UseCustomColors - kcfg_InactiveTaskTextColor - kcfg_ActiveTaskTextColor - kcfg_TaskBackgroundColor - kcfg_LeftButtonAction - kcfg_MiddleButtonAction - kcfg_RightButtonAction - kcolorbutton.h kdialog.h + kseparator.h + tdefontcombo.h + klineedit.h + tdefontrequester.h + tqtabwidget.h -- cgit v1.2.1