inspector: Add a rendering mode control

This commit is contained in:
Matthias Clasen 2014-11-10 15:07:52 -05:00
parent 5536d9bcde
commit 5c5c8bdd81
3 changed files with 68 additions and 0 deletions

View File

@ -49,6 +49,7 @@ struct _GtkInspectorVisualPrivate
GtkAdjustment *scale_adjustment;
GtkWidget *debug_box;
GtkWidget *rendering_mode_combo;
GtkWidget *updates_switch;
GtkWidget *baselines_switch;
GtkWidget *pixelcache_switch;
@ -522,6 +523,25 @@ init_gl (GtkInspectorVisual *vis)
}
}
static void
init_rendering_mode (GtkInspectorVisual *vis)
{
GdkRenderingMode mode;
mode = GDK_PRIVATE_CALL (gdk_display_get_rendering_mode) (gdk_display_get_default ());
gtk_combo_box_set_active (GTK_COMBO_BOX (vis->priv->rendering_mode_combo), mode);
}
static void
rendering_mode_changed (GtkComboBox *c,
GtkInspectorVisual *vis)
{
GdkRenderingMode mode;
mode = gtk_combo_box_get_active (c);
GDK_PRIVATE_CALL (gdk_display_set_rendering_mode) (gdk_display_get_default (), mode);
}
static void
update_gl_flag (GtkSwitch *sw,
GdkGLFlags flag)
@ -567,6 +587,7 @@ gtk_inspector_visual_init (GtkInspectorVisual *vis)
init_icons (vis);
init_font (vis);
init_scale (vis);
init_rendering_mode (vis);
init_animation (vis);
init_touchscreen (vis);
init_gl (vis);
@ -597,6 +618,7 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
object_class->constructed = gtk_inspector_visual_constructed;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/visual.ui");
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, rendering_mode_combo);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, updates_switch);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, direction_combo);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, baselines_switch);
@ -619,6 +641,7 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
gtk_widget_class_bind_template_callback (widget_class, updates_activate);
gtk_widget_class_bind_template_callback (widget_class, direction_changed);
gtk_widget_class_bind_template_callback (widget_class, rendering_mode_changed);
gtk_widget_class_bind_template_callback (widget_class, baselines_activate);
gtk_widget_class_bind_template_callback (widget_class, pixelcache_activate);
gtk_widget_class_bind_template_callback (widget_class, theme_changed);

View File

@ -278,6 +278,45 @@
<object class="GtkListBox" id="debug_box">
<property name="visible">True</property>
<property name="selection-mode">none</property>
<child>
<object class="GtkListBoxRow">
<property name="visible">True</property>
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<property name="margin">10</property>
<property name="spacing">40</property>
<child>
<object class="GtkLabel" id="rendering_mode_label">
<property name="visible">True</property>
<property name="label" translatable="yes">Rendering Mode</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkComboBoxText" id="rendering_mode_combo">
<property name="visible">True</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
<signal name="changed" handler="rendering_mode_changed"/>
<items>
<item translatable="yes" id="similar">Similar</item>
<item translatable="yes" id="image">Image</item>
<item translatable="yes" id="recording">Recording</item>
</items>
</object>
<packing>
<property name="expand">True</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="visible">True</property>
@ -582,6 +621,7 @@
<widget name="direction_label"/>
<widget name="hidpi_label"/>
<widget name="animation_label"/>
<widget name="rendering_mode_label"/>
<widget name="updates_label"/>
<widget name="baselines_label"/>
<widget name="pixelcache_label"/>
@ -599,6 +639,7 @@
<widget name="icon_combo"/>
<widget name="font_button"/>
<widget name="direction_combo"/>
<widget name="rendering_mode_combo"/>
<widget name="gl_combo"/>
</widgets>
</object>

View File

@ -7,6 +7,10 @@ N_("Left-to-Right");
N_("Right-to-Left");
N_("Window scaling");
N_("Animations");
N_("Rendering Mode");
N_("Similar");
N_("Image");
N_("Recording");
N_("Show Graphic Updates");
N_("Show Baselines");
N_("Show Pixel Cache");