[gnome-builder/wip/gtk4-port] 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] plugins/debuggerui: setup style-scheme for disassembly view
- Date: Wed, 27 Apr 2022 19:36:31 +0000 (UTC)
commit 374b8103f174271eba108c3732e7ad75d4a8f80c
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]