[gnome-builder/wip/gtk4-port: 765/1774] plugins/debuggerui: setup style-scheme for disassembly view
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 765/1774] plugins/debuggerui: setup style-scheme for disassembly view
- Date: Mon, 11 Jul 2022 22:31:23 +0000 (UTC)
commit 87792c4ea1f78fe538a318ce8500e1a9e43a2944
Author: Christian Hergert <chergert redhat com>
Date: Wed Apr 27 12:36:26 2022 -0700
plugins/debuggerui: setup style-scheme for disassembly view
.../debuggerui/ide-debugger-disassembly-view.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/src/plugins/debuggerui/ide-debugger-disassembly-view.c
b/src/plugins/debuggerui/ide-debugger-disassembly-view.c
index 80239aca0..9711a52da 100644
--- a/src/plugins/debuggerui/ide-debugger-disassembly-view.c
+++ b/src/plugins/debuggerui/ide-debugger-disassembly-view.c
@@ -43,6 +43,20 @@ struct _IdeDebuggerDisassemblyView
G_DEFINE_FINAL_TYPE (IdeDebuggerDisassemblyView, ide_debugger_disassembly_view, IDE_TYPE_PAGE)
+static gboolean
+style_scheme_name_to_object (GBinding *binding,
+ const GValue *from_value,
+ GValue *to_value,
+ gpointer user_data)
+{
+ GtkSourceStyleSchemeManager *manager = gtk_source_style_scheme_manager_get_default ();
+ GtkSourceStyleScheme *scheme = gtk_source_style_scheme_manager_get_scheme (manager, g_value_get_string
(from_value));
+
+ g_value_set_object (to_value, scheme);
+
+ return TRUE;
+}
+
static void
ide_debugger_disassembly_view_dispose (GObject *object)
{
@@ -70,6 +84,12 @@ static void
ide_debugger_disassembly_view_init (IdeDebuggerDisassemblyView *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
+
+ g_object_bind_property_full (IDE_APPLICATION_DEFAULT, "style-scheme",
+ self->source_buffer, "style-scheme",
+ G_BINDING_SYNC_CREATE,
+ style_scheme_name_to_object,
+ NULL, NULL, NULL);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]