Example #1
0
static GtkWidget *
ide_editor_perspective_create_edge (DzlDockBin      *dock_bin,
                                    GtkPositionType  edge)
{
  g_assert (DZL_IS_DOCK_BIN (dock_bin));
  g_assert (edge >= GTK_POS_LEFT);
  g_assert (edge <= GTK_POS_BOTTOM);

  if (edge == GTK_POS_LEFT)
    return g_object_new (IDE_TYPE_EDITOR_SIDEBAR,
                         "edge", edge,
                         "reveal-child", FALSE,
                         "visible", TRUE,
                         NULL);

  if (edge == GTK_POS_RIGHT)
    return g_object_new (IDE_TYPE_LAYOUT_TRANSIENT_SIDEBAR,
                         "edge", edge,
                         "reveal-child", FALSE,
                         "visible", FALSE,
                         NULL);

  if (edge == GTK_POS_BOTTOM)
    return g_object_new (IDE_TYPE_EDITOR_UTILITIES,
                         "edge", edge,
                         "reveal-child", FALSE,
                         "visible", TRUE,
                         NULL);

  return DZL_DOCK_BIN_CLASS (ide_editor_perspective_parent_class)->create_edge (dock_bin, edge);
}
Example #2
0
static void
ide_layout_class_init (IdeLayoutClass *klass)
{
  DzlDockBinClass *dock_bin_class = DZL_DOCK_BIN_CLASS (klass);

  dock_bin_class->create_edge = ide_layout_create_edge;
}
Example #3
0
static void
ide_editor_perspective_class_init (IdeEditorPerspectiveClass *klass)
{
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
  GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
  DzlDockBinClass *dock_bin_class = DZL_DOCK_BIN_CLASS (klass);

  widget_class->destroy = ide_editor_perspective_destroy;
  widget_class->hierarchy_changed = ide_editor_perspective_hierarchy_changed;
  widget_class->grab_focus = ide_editor_perspective_grab_focus;

  container_class->add = ide_editor_perspective_add;

  dock_bin_class->create_edge = ide_editor_perspective_create_edge;

  gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/builder/ui/ide-editor-perspective.ui");
  gtk_widget_class_bind_template_child (widget_class, IdeEditorPerspective, grid);
  gtk_widget_class_bind_template_child (widget_class, IdeEditorPerspective, overlay);
  gtk_widget_class_bind_template_child (widget_class, IdeEditorPerspective, properties);

  g_type_ensure (IDE_TYPE_EDITOR_PROPERTIES);
  g_type_ensure (IDE_TYPE_EDITOR_SIDEBAR);
  g_type_ensure (IDE_TYPE_LAYOUT_GRID);
}