Inspector: Use the new monospace support
This commit is contained in:
@ -206,20 +206,6 @@ save_clicked (GtkToolButton *button,
|
|||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
apply_system_font (GtkInspectorCssEditor *ce)
|
|
||||||
{
|
|
||||||
GSettings *s = g_settings_new ("org.gnome.desktop.interface");
|
|
||||||
gchar *font_name = g_settings_get_string (s, "monospace-font-name");
|
|
||||||
PangoFontDescription *font_desc = pango_font_description_from_string (font_name);
|
|
||||||
|
|
||||||
gtk_widget_override_font (ce->priv->view, font_desc);
|
|
||||||
|
|
||||||
pango_font_description_free (font_desc);
|
|
||||||
g_free (font_name);
|
|
||||||
g_object_unref (s);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_style (GtkInspectorCssEditor *ce)
|
update_style (GtkInspectorCssEditor *ce)
|
||||||
{
|
{
|
||||||
@ -373,7 +359,6 @@ constructed (GObject *object)
|
|||||||
GtkInspectorCssEditor *ce = GTK_INSPECTOR_CSS_EDITOR (object);
|
GtkInspectorCssEditor *ce = GTK_INSPECTOR_CSS_EDITOR (object);
|
||||||
|
|
||||||
create_provider (ce);
|
create_provider (ce);
|
||||||
apply_system_font (ce);
|
|
||||||
set_initial_text (ce);
|
set_initial_text (ce);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="buffer">text</property>
|
<property name="buffer">text</property>
|
||||||
<property name="wrap-mode">word</property>
|
<property name="wrap-mode">word</property>
|
||||||
|
<property name="monospace">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
@ -75,7 +75,6 @@ gtk_inspector_python_shell_init (GtkInspectorPythonShell *python_shell)
|
|||||||
GtkWidget *swin;
|
GtkWidget *swin;
|
||||||
GtkTextBuffer *buffer;
|
GtkTextBuffer *buffer;
|
||||||
GtkTextIter iter;
|
GtkTextIter iter;
|
||||||
PangoFontDescription *font_desc;
|
|
||||||
|
|
||||||
python_shell->priv = gtk_inspector_python_shell_get_instance_private (python_shell);
|
python_shell->priv = gtk_inspector_python_shell_get_instance_private (python_shell);
|
||||||
|
|
||||||
@ -92,6 +91,7 @@ gtk_inspector_python_shell_init (GtkInspectorPythonShell *python_shell)
|
|||||||
GTK_SHADOW_IN);
|
GTK_SHADOW_IN);
|
||||||
|
|
||||||
python_shell->priv->textview = gtk_text_view_new();
|
python_shell->priv->textview = gtk_text_view_new();
|
||||||
|
gtk_text_view_set_monospace (GTK_TEXT_VIEW (python_shell->priv->textview), TRUE);
|
||||||
gtk_widget_show(python_shell->priv->textview);
|
gtk_widget_show(python_shell->priv->textview);
|
||||||
gtk_container_add(GTK_CONTAINER(swin), python_shell->priv->textview);
|
gtk_container_add(GTK_CONTAINER(swin), python_shell->priv->textview);
|
||||||
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(python_shell->priv->textview), TRUE);
|
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(python_shell->priv->textview), TRUE);
|
||||||
@ -103,12 +103,6 @@ gtk_inspector_python_shell_init (GtkInspectorPythonShell *python_shell)
|
|||||||
G_CALLBACK(gtk_inspector_python_shell_key_press_cb),
|
G_CALLBACK(gtk_inspector_python_shell_key_press_cb),
|
||||||
python_shell);
|
python_shell);
|
||||||
|
|
||||||
/* Make the textview monospaced */
|
|
||||||
font_desc = pango_font_description_from_string("monospace");
|
|
||||||
pango_font_description_set_size(font_desc, 8 * PANGO_SCALE);
|
|
||||||
gtk_widget_override_font(python_shell->priv->textview, font_desc);
|
|
||||||
pango_font_description_free(font_desc);
|
|
||||||
|
|
||||||
/* Create the end-of-buffer mark */
|
/* Create the end-of-buffer mark */
|
||||||
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(python_shell->priv->textview));
|
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(python_shell->priv->textview));
|
||||||
gtk_text_buffer_get_end_iter(buffer, &iter);
|
gtk_text_buffer_get_end_iter(buffer, &iter);
|
||||||
|
|||||||
Reference in New Issue
Block a user