[gnome-builder/wip/gtk4-port] libide/editor: map font description to source view
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] libide/editor: map font description to source view
- Date: Wed, 6 Apr 2022 01:53:25 +0000 (UTC)
commit 53f0cbd785da921fb216d494d808e19850406190
Author: Christian Hergert <chergert redhat com>
Date: Tue Apr 5 18:52:47 2022 -0700
libide/editor: map font description to source view
src/libide/editor/ide-editor-page-settings.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
---
diff --git a/src/libide/editor/ide-editor-page-settings.c b/src/libide/editor/ide-editor-page-settings.c
index 5f89827de..dccd230df 100644
--- a/src/libide/editor/ide-editor-page-settings.c
+++ b/src/libide/editor/ide-editor-page-settings.c
@@ -77,6 +77,21 @@ show_map_to_vscrollbar_policy (GValue *value,
return TRUE;
}
+static gboolean
+font_name_to_font_desc (GValue *value,
+ GVariant *variant,
+ gpointer user_data)
+{
+ const char *str;
+
+ if ((str = g_variant_get_string (variant, NULL)))
+ g_value_take_boxed (value, pango_font_description_from_string (str));
+ else
+ g_value_set_boxed (value, NULL);
+
+ return TRUE;
+}
+
void
_ide_editor_page_settings_init (IdeEditorPage *self)
{
@@ -133,6 +148,12 @@ _ide_editor_page_settings_init (IdeEditorPage *self)
show_map_to_vscrollbar_policy,
NULL, NULL, NULL);
+ g_settings_bind_with_mapping (editor_settings, "font-name",
+ self->view, "font-desc",
+ G_SETTINGS_BIND_GET,
+ font_name_to_font_desc,
+ NULL, NULL, NULL);
+
#if 0
ide_binding_group_bind (self->view_file_settings,
"insert-matching-brace", self->view, "insert-matching-brace",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]