[gnome-terminal] profile: editor: Use new show-editor property on GtkColorButton
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] profile: editor: Use new show-editor property on GtkColorButton
- Date: Wed, 27 Jan 2016 16:59:43 +0000 (UTC)
commit 096e324bd4f3eeb09fbcb7e330246551be23a991
Author: Christian Persch <chpe gnome org>
Date: Wed Jan 27 17:59:25 2016 +0100
profile: editor: Use new show-editor property on GtkColorButton
On gtk+ >= 3.19, use the new GtkColorButton:show-editor property
instead of working around the previous lack of this property.
https://bugzilla.gnome.org/show_bug.cgi?id=756192
src/profile-editor.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/profile-editor.c b/src/profile-editor.c
index a96145f..4739c1c 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -755,6 +755,8 @@ bool_to_scrollbar_policy (const GValue *value,
return g_variant_new_string (g_value_get_boolean (value) ? "always" : "never");
}
+#if !GTK_CHECK_VERSION (3, 19, 6)
+
/* ATTENTION: HACK HACK HACK!
* GtkColorButton usability is broken. It always pops up the
* GtkColorChooserDialog with show-editor=FALSE, which brings
@@ -791,7 +793,8 @@ fixup_color_chooser_button (void)
done = TRUE;
}
}
-/* END HACK */
+
+#endif /* GTK+ < 3.19.6 HACK */
/**
* terminal_profile_edit:
@@ -826,7 +829,9 @@ terminal_profile_edit (GSettings *profile,
return;
}
+#if !GTK_CHECK_VERSION (3, 19, 6)
fixup_color_chooser_button ();
+#endif
profiles_list = terminal_app_get_profiles_list (terminal_app_get ());
@@ -879,6 +884,10 @@ terminal_profile_edit (GSettings *profile,
g_snprintf (name, sizeof (name), "palette-colorpicker-%u", i + 1);
w = (GtkWidget *) gtk_builder_get_object (builder, name);
+#if GTK_CHECK_VERSION (3, 19, 6)
+ g_object_set (w, "show-editor", TRUE, NULL);
+#endif
+
g_object_set_data (G_OBJECT (w), "palette-entry-index", GUINT_TO_POINTER (i));
text = g_strdup_printf (_("Choose Palette Color %u"), i + 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]