diff options
| author | Nate Graham <[email protected]> | 2020-09-17 18:34:11 -0600 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2020-09-22 20:22:43 +0000 |
| commit | 15928112ce57902d1b5e0f9f6870b625d6b8056f (patch) | |
| tree | f1311d64b4a121d8332619f3ae42f8a85a97f9f3 /src | |
| parent | 9b83378c087a87cef537ba751b7713aff8bed84c (diff) | |
Make "Show hidden files" action follow HIG
The action is a toggle action, for which the HIG prescribes that the
text should describe the action's checked state, and neither the text
nor the icon should change when the action is checked. Other toggle
actions in Dolphin follow these rules, but this one does not.
This commit makes the action follow those rules.
Diffstat (limited to 'src')
| -rw-r--r-- | src/views/dolphinviewactionhandler.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index fa0d553b6..a63263bf5 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -272,8 +272,8 @@ void DolphinViewActionHandler::createActions() connect(showInGroups, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleGroupedSorting); KToggleAction* showHiddenFiles = m_actionCollection->add<KToggleAction>(QStringLiteral("show_hidden_files")); + showHiddenFiles->setIcon(QIcon::fromTheme(QStringLiteral("view-visible"))); showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files")); - showHiddenFiles->setToolTip(i18nc("@info", "Visibility of hidden files and folders")); showHiddenFiles->setWhatsThis(xi18nc("@info:whatsthis", "<para>When " "this is enabled <emphasis>hidden</emphasis> files and folders " "are visible. They will be displayed semi-transparent.</para>" @@ -552,14 +552,6 @@ void DolphinViewActionHandler::slotHiddenFilesShownChanged(bool shown) { QAction* showHiddenFilesAction = m_actionCollection->action(QStringLiteral("show_hidden_files")); showHiddenFilesAction->setChecked(shown); - - // #374508: don't overwrite custom icons. - const QString iconName = showHiddenFilesAction->icon().name(); - if (!iconName.isEmpty() && iconName != QLatin1String("view-visible") && iconName != QLatin1String("view-hidden")) { - return; - } - - showHiddenFilesAction->setIcon(QIcon::fromTheme(shown ? QStringLiteral("view-visible") : QStringLiteral("view-hidden"))); } void DolphinViewActionHandler::slotWriteStateChanged(bool isFolderWritable) |
