Exemplo n.º 1
0
/**
 * ide_editor_perspective_get_sidebar:
 * @self: a #IdeEditorPerspective
 *
 * Gets the #IdeEditorSidebar for the editor perspective.
 *
 * Returns: (transfer none): an #IdeEditorSidebar
 *
 * Since: 3.26
 */
IdeEditorSidebar *
ide_editor_perspective_get_sidebar (IdeEditorPerspective *self)
{
  g_return_val_if_fail (IDE_IS_EDITOR_PERSPECTIVE (self), NULL);

  return IDE_EDITOR_SIDEBAR (dzl_dock_bin_get_left_edge (DZL_DOCK_BIN (self)));
}
Exemplo n.º 2
0
static void
ide_editor_perspective_save_panel_state (IdeEditorPerspective *self)
{
  g_autoptr(GSettings) settings = NULL;
  GtkWidget *pane;
  gboolean reveal;
  guint position;

  g_assert (IDE_IS_EDITOR_PERSPECTIVE (self));

  /* TODO: possibly belongs in editor settings */
  settings = g_settings_new ("org.gnome.builder.workbench");

  pane = dzl_dock_bin_get_left_edge (DZL_DOCK_BIN (self));
  position = dzl_dock_revealer_get_position (DZL_DOCK_REVEALER (pane));
  reveal = dzl_dock_revealer_get_reveal_child (DZL_DOCK_REVEALER (pane));
  g_settings_set_boolean (settings, "left-visible", reveal);
  g_settings_set_int (settings, "left-position", position);

  pane = dzl_dock_bin_get_right_edge (DZL_DOCK_BIN (self));
  position = dzl_dock_revealer_get_position (DZL_DOCK_REVEALER (pane));
  reveal = dzl_dock_revealer_get_reveal_child (DZL_DOCK_REVEALER (pane));
  g_settings_set_boolean (settings, "right-visible", reveal);
  g_settings_set_int (settings, "right-position", position);

  pane = dzl_dock_bin_get_bottom_edge (DZL_DOCK_BIN (self));
  position = dzl_dock_revealer_get_position (DZL_DOCK_REVEALER (pane));
  reveal = dzl_dock_revealer_get_reveal_child (DZL_DOCK_REVEALER (pane));
  g_settings_set_boolean (settings, "bottom-visible", reveal);
  g_settings_set_int (settings, "bottom-position", position);
}
Exemplo n.º 3
0
static void
gy_window_settings__window_realize (GtkWindow *window)
{
  GdkRectangle geom      = { 0 };
  gboolean     maximized = FALSE;

  g_assert (GTK_IS_WINDOW (window));
  g_assert (G_IS_SETTINGS (settings));

  g_settings_get (settings, "window-position", "(ii)", &geom.x, &geom.y);
  g_settings_get (settings, "window-size", "(ii)", &geom.width, &geom.height);
  g_settings_get (settings, "window-maximized", "b", &maximized);

  gtk_window_set_default_size (window, geom.width, geom.height);

  gtk_window_move (window, geom.x, geom.y);

  if (maximized)
    gtk_window_maximize (window);

  DzlDockBin* dockbin = gy_window_get_dockbin (GY_WINDOW (window));
  GtkWidget * edge = dzl_dock_bin_get_left_edge (dockbin);

  g_settings_bind (settings, "left-panel-visible", edge, "reveal-child", G_SETTINGS_BIND_DEFAULT);
  g_settings_bind (settings, "left-panel-position", edge, "position", G_SETTINGS_BIND_DEFAULT);

  edge = dzl_dock_bin_get_right_edge (dockbin);

  g_settings_bind (settings, "right-panel-visible", edge, "reveal-child", G_SETTINGS_BIND_DEFAULT);
  g_settings_bind (settings, "right-panel-position", edge, "position", G_SETTINGS_BIND_DEFAULT);


}