progress-info-widget: Change cancel button icon

Set correct icon and remove tooltip for cancel
button when an ongoing operation is canceled

Use cancel button icon "emblem-ok-symbolic" instead of
"object-select-symbolic" since it is more correct in the current
use case as suggested by @snwh

Use tooltip "Completed" for cancel button instead of
"Operation Finished" since it is more friendly in this context
suggested by @snwh

Set "Completed" as a translatable string credit to @coreyberla

Part of https://gitlab.gnome.org/GNOME/nautilus/-/issues/3294
This commit is contained in:
Bharat 2024-02-03 16:47:08 +05:30 committed by Khalid Abu Shawarib
parent 50a33a47da
commit 84e1d76f51
2 changed files with 16 additions and 4 deletions

View file

@ -48,6 +48,7 @@ src/nautilus-places-view.c
src/nautilus-preferences-window.c
src/nautilus-program-choosing.c
src/nautilus-progress-info.c
src/nautilus-progress-info-widget.c
src/nautilus-progress-persistence-handler.c
src/nautilus-properties-window.c
src/nautilus-query.c

View file

@ -22,6 +22,7 @@
*/
#include <config.h>
#include <glib/gi18n.h>
#include "nautilus-progress-info-widget.h"
struct _NautilusProgressInfoWidgetPrivate
@ -48,14 +49,20 @@ G_DEFINE_TYPE_WITH_PRIVATE (NautilusProgressInfoWidget, nautilus_progress_info_w
static void
info_finished (NautilusProgressInfoWidget *self)
{
gtk_button_set_icon_name (GTK_BUTTON (self->priv->button), "object-select-symbolic");
gtk_widget_set_sensitive (self->priv->button, FALSE);
if (!nautilus_progress_info_get_is_cancelled (self->priv->info))
{
gtk_button_set_icon_name (GTK_BUTTON (self->priv->button), "emblem-ok-symbolic");
gtk_widget_set_tooltip_text (GTK_WIDGET (self->priv->button), _("Completed"));
}
}
static void
info_cancelled (NautilusProgressInfoWidget *self)
{
gtk_widget_set_sensitive (self->priv->button, FALSE);
gtk_button_set_icon_name (GTK_BUTTON (self->priv->button), "cross-filled-symbolic");
gtk_widget_set_has_tooltip (GTK_WIDGET (self->priv->button), FALSE);
}
static void
@ -124,10 +131,14 @@ nautilus_progress_info_widget_constructed (GObject *obj)
G_OBJECT_CLASS (nautilus_progress_info_widget_parent_class)->constructed (obj);
if (nautilus_progress_info_get_is_finished (self->priv->info))
if (nautilus_progress_info_get_is_finished (self->priv->info) &&
!nautilus_progress_info_get_is_cancelled (self->priv->info))
{
gtk_button_set_icon_name (GTK_BUTTON (self->priv->button), "object-select-symbolic");
gtk_widget_set_tooltip_text (GTK_WIDGET (self->priv->button), "Operation Finished");
info_finished (self);
}
else if (nautilus_progress_info_get_is_cancelled (self->priv->info))
{
info_cancelled (self);
}
gtk_widget_set_sensitive (self->priv->button,