Use better-named visible and hidden icons

This commit is contained in:
Nate Graham 2019-09-04 09:04:13 -06:00
parent d23fba320f
commit ac14383e95
3 changed files with 8 additions and 8 deletions

View file

@ -1658,7 +1658,7 @@ void DolphinMainWindow::setupDockWidgets()
this, &DolphinMainWindow::slotStorageTearDownExternallyRequested);
m_tabWidget->slotPlacesPanelVisibilityChanged(m_placesPanel->isVisible());
auto actionShowAllPlaces = new QAction(QIcon::fromTheme(QStringLiteral("hint")), i18nc("@item:inmenu", "Show Hidden Places"), this);
auto actionShowAllPlaces = new QAction(QIcon::fromTheme(QStringLiteral("view-hidden")), i18nc("@item:inmenu", "Show Hidden Places"), this);
actionShowAllPlaces->setCheckable(true);
actionShowAllPlaces->setDisabled(true);
actionShowAllPlaces->setWhatsThis(i18nc("@info:whatsthis", "This displays "
@ -1666,13 +1666,13 @@ void DolphinMainWindow::setupDockWidgets()
"appear semi-transparent unless you uncheck their hide property."));
connect(actionShowAllPlaces, &QAction::triggered, this, [actionShowAllPlaces, this](bool checked){
actionShowAllPlaces->setIcon(QIcon::fromTheme(checked ? QStringLiteral("visibility") : QStringLiteral("hint")));
actionShowAllPlaces->setIcon(QIcon::fromTheme(checked ? QStringLiteral("view-visible") : QStringLiteral("view-hidden")));
m_placesPanel->showHiddenEntries(checked);
});
connect(m_placesPanel, &PlacesPanel::showHiddenEntriesChanged, this, [actionShowAllPlaces] (bool checked){
actionShowAllPlaces->setChecked(checked);
actionShowAllPlaces->setIcon(QIcon::fromTheme(checked ? QStringLiteral("visibility") : QStringLiteral("hint")));
actionShowAllPlaces->setIcon(QIcon::fromTheme(checked ? QStringLiteral("view-visible") : QStringLiteral("view-hidden")));
});
actionCollection()->action(QStringLiteral("show_places_panel"))

View file

@ -232,7 +232,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
removeAction = menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("@item:inmenu", "Remove"));
}
QAction* hideAction = menu.addAction(QIcon::fromTheme(QStringLiteral("hint")), i18nc("@item:inmenu", "Hide"));
QAction* hideAction = menu.addAction(QIcon::fromTheme(QStringLiteral("view-hidden")), i18nc("@item:inmenu", "Hide"));
hideAction->setCheckable(true);
hideAction->setChecked(item->isHidden());
@ -293,7 +293,7 @@ void PlacesPanel::slotViewContextMenuRequested(const QPointF& pos)
QAction* showAllAction = menu.addAction(i18nc("@item:inmenu", "Show Hidden Places"));
showAllAction->setCheckable(true);
showAllAction->setChecked(m_model->hiddenItemsShown());
showAllAction->setIcon(QIcon::fromTheme(m_model->hiddenItemsShown() ? QStringLiteral("visibility") : QStringLiteral("hint")));
showAllAction->setIcon(QIcon::fromTheme(m_model->hiddenItemsShown() ? QStringLiteral("view-visible") : QStringLiteral("view-hidden")));
showAllAction->setEnabled(m_model->hiddenCount());
buildGroupContextMenu(&menu, m_controller->indexCloseToMousePressedPosition());
@ -358,7 +358,7 @@ QAction *PlacesPanel::buildGroupContextMenu(QMenu *menu, int index)
}
KFilePlacesModel::GroupType groupType = m_model->groupType(index);
QAction *hideGroupAction = menu->addAction(QIcon::fromTheme(QStringLiteral("hint")), i18nc("@item:inmenu", "Hide Section '%1'", m_model->item(index)->group()));
QAction *hideGroupAction = menu->addAction(QIcon::fromTheme(QStringLiteral("view-hidden")), i18nc("@item:inmenu", "Hide Section '%1'", m_model->item(index)->group()));
hideGroupAction->setCheckable(true);
hideGroupAction->setChecked(m_model->isGroupHidden(groupType));

View file

@ -535,11 +535,11 @@ void DolphinViewActionHandler::slotHiddenFilesShownChanged(bool shown)
// #374508: don't overwrite custom icons.
const QString iconName = showHiddenFilesAction->icon().name();
if (!iconName.isEmpty() && iconName != QLatin1String("visibility") && iconName != QLatin1String("hint")) {
if (!iconName.isEmpty() && iconName != QLatin1String("view-visible") && iconName != QLatin1String("view-hidden")) {
return;
}
showHiddenFilesAction->setIcon(QIcon::fromTheme(shown ? QStringLiteral("visibility") : QStringLiteral("hint")));
showHiddenFilesAction->setIcon(QIcon::fromTheme(shown ? QStringLiteral("view-visible") : QStringLiteral("view-hidden")));
}
void DolphinViewActionHandler::slotWriteStateChanged(bool isFolderWritable)