mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
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.
This commit is contained in:
parent
9b83378c08
commit
15928112ce
1 changed files with 1 additions and 9 deletions
|
@ -272,8 +272,8 @@ void DolphinViewActionHandler::createActions()
|
||||||
connect(showInGroups, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleGroupedSorting);
|
connect(showInGroups, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleGroupedSorting);
|
||||||
|
|
||||||
KToggleAction* showHiddenFiles = m_actionCollection->add<KToggleAction>(QStringLiteral("show_hidden_files"));
|
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->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 "
|
showHiddenFiles->setWhatsThis(xi18nc("@info:whatsthis", "<para>When "
|
||||||
"this is enabled <emphasis>hidden</emphasis> files and folders "
|
"this is enabled <emphasis>hidden</emphasis> files and folders "
|
||||||
"are visible. They will be displayed semi-transparent.</para>"
|
"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"));
|
QAction* showHiddenFilesAction = m_actionCollection->action(QStringLiteral("show_hidden_files"));
|
||||||
showHiddenFilesAction->setChecked(shown);
|
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)
|
void DolphinViewActionHandler::slotWriteStateChanged(bool isFolderWritable)
|
||||||
|
|
Loading…
Reference in a new issue