[gimp/alxsa-softproof-toggle-button] display: UI updates for soft-proof button
- From: Alx Sa <sawyeralex src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/alxsa-softproof-toggle-button] display: UI updates for soft-proof button
- Date: Mon, 1 Aug 2022 15:53:06 +0000 (UTC)
commit d0fcb8a271c4357acad590d6d81228f78b094640
Author: Alx Sa <cmyk student gmail com>
Date: Mon Aug 1 15:53:05 2022 +0000
display: UI updates for soft-proof button
app/display/gimpstatusbar.c | 33 +++++++++++++++++++++------------
app/display/gimpstatusbar.h | 1 -
2 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index 491c4de361..2c09f7f0c4 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -399,24 +399,28 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
statusbar);
/* soft proofing button */
- statusbar->soft_proof_button = gtk_button_new ();
+ statusbar->soft_proof_button = gtk_toggle_button_new();
gtk_widget_set_can_focus (statusbar->soft_proof_button, FALSE);
gtk_button_set_relief (GTK_BUTTON (statusbar->soft_proof_button),
GTK_RELIEF_NONE);
- gtk_button_set_image (GTK_BUTTON (statusbar->soft_proof_button),
- gtk_image_new_from_icon_name (GIMP_ICON_DISPLAY_FILTER_PROOF,
- GTK_ICON_SIZE_MENU));
+ image = gtk_image_new_from_icon_name (GIMP_ICON_DISPLAY_FILTER_PROOF,
+ GTK_ICON_SIZE_MENU);
+ gtk_container_add (GTK_CONTAINER (statusbar->soft_proof_button), image);
+ gtk_widget_show (image);
gimp_help_set_help_data (statusbar->soft_proof_button,
- _("Toggle soft-proofing view"),
+ _("Toggle soft-proofing view when\n"
+ "a soft-proofing profile is set"),
NULL);
gimp_statusbar_add_size_widget (statusbar, statusbar->soft_proof_button);
gtk_box_pack_end (GTK_BOX (hbox), statusbar->soft_proof_button,
FALSE, FALSE, 0);
+ gtk_widget_show (statusbar->soft_proof_button);
g_signal_connect (statusbar->soft_proof_button, "clicked",
G_CALLBACK (gimp_statusbar_soft_proof_button_toggled),
statusbar);
- statusbar->soft_proof_status = FALSE;
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (statusbar->soft_proof_button),
+ FALSE);
gimp_statusbar_update_size (statusbar);
}
@@ -748,12 +752,14 @@ gimp_statusbar_soft_proof_button_toggled (GtkWidget *button,
{
GimpColorConfig *color_config;
GimpColorManagementMode mode;
+ gboolean active;
color_config = gimp_display_shell_get_color_config (statusbar->shell);
mode = gimp_color_config_get_mode (color_config);
- statusbar->soft_proof_status = ! statusbar->soft_proof_status;
+ active =
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (statusbar->soft_proof_button));
- if (statusbar->soft_proof_status)
+ if (active)
{
mode = GIMP_COLOR_MANAGEMENT_SOFTPROOF;
}
@@ -950,6 +956,7 @@ gimp_statusbar_fill (GimpStatusbar *statusbar)
gtk_widget_show (statusbar->unit_combo);
gtk_widget_show (statusbar->scale_combo);
gtk_widget_show (statusbar->rotate_widget);
+ gtk_widget_show (statusbar->soft_proof_button);
gimp_statusbar_shell_image_changed (statusbar);
gimp_statusbar_shell_rotated (statusbar->shell, statusbar);
}
@@ -1604,13 +1611,15 @@ gimp_statusbar_shell_color_config_notify (GObject *config,
if (mode == GIMP_COLOR_MANAGEMENT_SOFTPROOF)
{
- statusbar->soft_proof_status = TRUE;
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (statusbar->soft_proof_button),
+ TRUE);
gtk_button_set_relief (GTK_BUTTON (statusbar->soft_proof_button),
GTK_RELIEF_NORMAL);
}
else
{
- statusbar->soft_proof_status = FALSE;
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (statusbar->soft_proof_button),
+ FALSE);
gtk_button_set_relief (GTK_BUTTON (statusbar->soft_proof_button),
GTK_RELIEF_NONE);
}
@@ -1673,9 +1682,9 @@ gimp_statusbar_shell_image_simulation_profile_changed (GimpImage *image,
view_profile = gimp_image_get_simulation_profile (image);
if (view_profile)
- gtk_widget_show (statusbar->soft_proof_button);
+ gtk_widget_set_sensitive (statusbar->soft_proof_button, TRUE);
else
- gtk_widget_hide (statusbar->soft_proof_button);
+ gtk_widget_set_sensitive (statusbar->soft_proof_button, FALSE);
}
static gboolean
diff --git a/app/display/gimpstatusbar.h b/app/display/gimpstatusbar.h
index 618422e632..5c532947e5 100644
--- a/app/display/gimpstatusbar.h
+++ b/app/display/gimpstatusbar.h
@@ -81,7 +81,6 @@ struct _GimpStatusbar
guint64 progress_last_update_time;
GtkWidget *soft_proof_button;
- gboolean soft_proof_status;
GSList *size_widgets;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]