[dia] diagram-properties: move ui to gtkbuilder, present modes as radios
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] diagram-properties: move ui to gtkbuilder, present modes as radios
- Date: Thu, 3 Oct 2019 14:25:14 +0000 (UTC)
commit 5fb72fb8cbb64e654ed3445f21e1ff24b6894d74
Author: Zander Brown <zbrown gnome org>
Date: Wed Oct 2 18:13:46 2019 +0100
diagram-properties: move ui to gtkbuilder, present modes as radios
app/dia-props.c | 645 +++++++++++++++++++++------------------
app/dia-props.h | 23 +-
app/display.c | 5 +-
app/menus.h | 1 +
app/sheet-editor/sheets_dialog.c | 21 +-
app/toolbox.c | 10 +-
app/undo.c | 2 +-
data/ui/properties-dialog.ui | 436 ++++++++++++++++++++++++++
objects/Misc/pixmaps/n_gon.xpm | 2 +-
9 files changed, 822 insertions(+), 323 deletions(-)
---
diff --git a/app/dia-props.c b/app/dia-props.c
index aab2bfc6..d363417e 100644
--- a/app/dia-props.c
+++ b/app/dia-props.c
@@ -30,344 +30,405 @@
#include "widgets.h"
#include "display.h"
#include "undo.h"
+#include "menus.h"
-static GtkWidget *dialog = NULL;
-static GtkWidget *dynamic_check;
-static GtkWidget *width_x_entry, *width_y_entry;
-static GtkWidget *visible_x_entry, *visible_y_entry;
-static GtkWidget *bg_colour, *grid_colour, *pagebreak_colour;
-static GtkWidget *hex_check, *hex_size_entry;
-static void diagram_properties_respond(GtkWidget *widget,
- gint response_id,
- gpointer user_data);
+typedef struct _DiaDiagramPropertiesDialogPrivate DiaDiagramPropertiesDialogPrivate;
+struct _DiaDiagramPropertiesDialogPrivate {
+ Diagram *diagram;
+
+ /* Grid */
+ GtkWidget *dynamic;
+ GtkWidget *manual;
+ GtkWidget *manual_props;
+ GtkWidget *hex;
+ GtkWidget *hex_props;
+
+ GtkAdjustment *spacing_x;
+ GtkAdjustment *spacing_y;
+ GtkAdjustment *vis_spacing_x;
+ GtkAdjustment *vis_spacing_y;
+ GtkAdjustment *hex_size;
+
+ /* Colours */
+ GtkWidget *background;
+ GtkWidget *grid_lines;
+ GtkWidget *page_lines;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (DiaDiagramPropertiesDialog, dia_diagram_properties_dialog, GTK_TYPE_DIALOG)
+
+enum {
+ PROP_0,
+ PROP_DIAGRAM,
+ LAST_PROP
+};
+
+static GParamSpec *pspecs[LAST_PROP] = { NULL, };
+
+
+static void
+dia_diagram_properties_dialog_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ DiaDiagramPropertiesDialog *self = DIA_DIAGRAM_PROPERTIES_DIALOG (object);
+
+ switch (property_id) {
+ case PROP_DIAGRAM:
+ dia_diagram_properties_dialog_set_diagram (self, g_value_get_object (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void
+dia_diagram_properties_dialog_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ DiaDiagramPropertiesDialog *self = DIA_DIAGRAM_PROPERTIES_DIALOG (object);
+
+ switch (property_id) {
+ case PROP_DIAGRAM:
+ g_value_set_object (value, dia_diagram_properties_dialog_get_diagram (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void
+diagram_died (gpointer data, GObject *dead)
+{
+ DiaDiagramPropertiesDialog *self = DIA_DIAGRAM_PROPERTIES_DIALOG (data);
+ DiaDiagramPropertiesDialogPrivate *priv = dia_diagram_properties_dialog_get_instance_private (self);
+
+ g_return_if_fail (DIA_IS_DIAGRAM_PROPERTIES_DIALOG (data));
+
+ priv->diagram = NULL;
+
+ dia_diagram_properties_dialog_set_diagram (self, NULL);
+}
+
+
+static void
+dia_diagram_properties_dialog_finalize (GObject *object)
+{
+ DiaDiagramPropertiesDialog *self = DIA_DIAGRAM_PROPERTIES_DIALOG (object);
+ DiaDiagramPropertiesDialogPrivate *priv = dia_diagram_properties_dialog_get_instance_private (self);
+
+ if (priv->diagram) {
+ g_object_weak_unref (G_OBJECT (priv->diagram), diagram_died, object);
+ }
+
+ G_OBJECT_CLASS (dia_diagram_properties_dialog_parent_class)->finalize (object);
+}
+
+
+static gboolean
+dia_diagram_properties_dialog_delete_event (GtkWidget *widget, GdkEventAny *event)
+{
+ gtk_widget_hide (widget);
+
+ /* We're caching, so don't destroy */
+ return TRUE;
+}
+
+
+static void
+dia_diagram_properties_dialog_response (GtkDialog *dialog,
+ gint response_id)
+{
+ DiaDiagramPropertiesDialog *self = DIA_DIAGRAM_PROPERTIES_DIALOG (dialog);
+ DiaDiagramPropertiesDialogPrivate *priv = dia_diagram_properties_dialog_get_instance_private (self);
+
+ if (response_id == GTK_RESPONSE_OK ||
+ response_id == GTK_RESPONSE_APPLY) {
+ if (priv->diagram) {
+ /* we do not bother for the actual change, just record the
+ * whole possible change */
+ dia_mem_swap_change_new (priv->diagram,
+ &priv->diagram->grid,
+ sizeof(priv->diagram->grid));
+ dia_mem_swap_change_new (priv->diagram,
+ &priv->diagram->data->bg_color,
+ sizeof(priv->diagram->data->bg_color));
+ dia_mem_swap_change_new (priv->diagram,
+ &priv->diagram->pagebreak_color,
+ sizeof(priv->diagram->pagebreak_color));
+ undo_set_transactionpoint (priv->diagram->undo);
+
+ priv->diagram->grid.dynamic =
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->dynamic));
+ priv->diagram->grid.width_x = gtk_adjustment_get_value (priv->spacing_x);
+ priv->diagram->grid.width_y = gtk_adjustment_get_value (priv->spacing_y);
+ priv->diagram->grid.visible_x = gtk_adjustment_get_value (priv->vis_spacing_x);
+ priv->diagram->grid.visible_y = gtk_adjustment_get_value (priv->vis_spacing_y);
+ priv->diagram->grid.hex =
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->hex));
+ priv->diagram->grid.hex_size = gtk_adjustment_get_value (priv->hex_size);
+ dia_color_selector_get_color (priv->background,
+ &priv->diagram->data->bg_color);
+ dia_color_selector_get_color (priv->grid_lines,
+ &priv->diagram->grid.colour);
+ dia_color_selector_get_color (priv->page_lines,
+ &priv->diagram->pagebreak_color);
+ diagram_add_update_all (priv->diagram);
+ diagram_flush (priv->diagram);
+ diagram_set_modified (priv->diagram, TRUE);
+ }
+ }
+
+ if (response_id != GTK_RESPONSE_APPLY) {
+ gtk_widget_hide (GTK_WIDGET (dialog));
+ }
+}
+
static void
-diagram_properties_update_sensitivity(GtkToggleButton *widget,
- gpointer userdata)
+dia_diagram_properties_dialog_class_init (DiaDiagramPropertiesDialogClass *klass)
{
- Diagram *dia = ddisplay_active_diagram();
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (klass);
+
+ object_class->set_property = dia_diagram_properties_dialog_set_property;
+ object_class->get_property = dia_diagram_properties_dialog_get_property;
+ object_class->finalize = dia_diagram_properties_dialog_finalize;
+
+ widget_class->delete_event = dia_diagram_properties_dialog_delete_event;
+
+ dialog_class->response = dia_diagram_properties_dialog_response;
+
+ /**
+ * DiaDiagramPropertiesDialog:diagram:
+ *
+ * Since: 0.98
+ */
+ pspecs[PROP_DIAGRAM] =
+ g_param_spec_object ("diagram",
+ "Diagram",
+ "The current diagram",
+ DIA_TYPE_DIAGRAM,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
+
+ g_object_class_install_properties (object_class, LAST_PROP, pspecs);
+}
+
+
+static void
+update_sensitivity (GtkToggleButton *widget,
+ gpointer userdata)
+{
+ DiaDiagramPropertiesDialog *self = DIA_DIAGRAM_PROPERTIES_DIALOG (userdata);
+ DiaDiagramPropertiesDialogPrivate *priv = dia_diagram_properties_dialog_get_instance_private (self);
gboolean dyn_grid, square_grid, hex_grid;
- if (!dia)
+ if (!priv->diagram)
return; /* safety first */
- dia->grid.dynamic =
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dynamic_check));
- dyn_grid = dia->grid.dynamic;
- if (!dyn_grid)
- dia->grid.hex =
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hex_check));
+ priv->diagram->grid.dynamic =
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->dynamic));
+ dyn_grid = priv->diagram->grid.dynamic;
+ if (!dyn_grid) {
+ priv->diagram->grid.hex =
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->hex));
+ }
- square_grid = !dyn_grid && !dia->grid.hex;
- hex_grid = !dyn_grid && dia->grid.hex;
+ square_grid = !dyn_grid && !priv->diagram->grid.hex;
+ hex_grid = !dyn_grid && priv->diagram->grid.hex;
- gtk_widget_set_sensitive(width_x_entry, square_grid);
- gtk_widget_set_sensitive(width_y_entry, square_grid);
- gtk_widget_set_sensitive(visible_x_entry, square_grid);
- gtk_widget_set_sensitive(visible_y_entry, square_grid);
- gtk_widget_set_sensitive(hex_check, !dyn_grid);
- gtk_widget_set_sensitive(hex_size_entry, hex_grid);
+ gtk_widget_set_sensitive (priv->manual_props, square_grid);
+ gtk_widget_set_sensitive (priv->hex_props, hex_grid);
}
+
static void
-create_diagram_properties_dialog(Diagram *dia)
+dia_diagram_properties_dialog_init (DiaDiagramPropertiesDialog *self)
{
+ DiaDiagramPropertiesDialogPrivate *priv = dia_diagram_properties_dialog_get_instance_private (self);
GtkWidget *dialog_vbox;
GtkWidget *notebook;
- GtkWidget *table;
- GtkWidget *label;
- GtkAdjustment *adj;
-
- dialog = gtk_dialog_new_with_buttons(
- _("Diagram Properties"),
- GTK_WINDOW(ddisplay_active()->shell),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL,
- GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK);
-
- dialog_vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
-
- gtk_window_set_role(GTK_WINDOW(dialog), "diagram_properties");
-
- g_signal_connect(G_OBJECT(dialog), "response",
- G_CALLBACK(diagram_properties_respond),
- NULL);
- g_signal_connect(G_OBJECT(dialog), "delete_event",
- G_CALLBACK(gtk_widget_hide), NULL);
- g_signal_connect(G_OBJECT(dialog), "destroy",
- G_CALLBACK(gtk_widget_destroyed), &dialog);
-
- notebook = gtk_notebook_new();
- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
- gtk_box_pack_start(GTK_BOX(dialog_vbox), notebook, TRUE, TRUE, 0);
- gtk_container_set_border_width(GTK_CONTAINER(notebook), 2);
- gtk_widget_show(notebook);
-
- /* the grid page */
- table = gtk_table_new(3,3,FALSE);
- gtk_container_set_border_width(GTK_CONTAINER(table), 2);
- gtk_table_set_row_spacings(GTK_TABLE(table), 1);
- gtk_table_set_col_spacings(GTK_TABLE(table), 2);
-
- dynamic_check = gtk_check_button_new_with_label(_("Dynamic grid"));
- gtk_table_attach(GTK_TABLE(table), dynamic_check, 1,2, 0,1,
- GTK_FILL, GTK_FILL, 0, 0);
- g_signal_connect(G_OBJECT(dynamic_check), "toggled",
- G_CALLBACK(diagram_properties_update_sensitivity), NULL);
-
- gtk_widget_show(dynamic_check);
-
- label = gtk_label_new(_("x"));
- gtk_table_attach(GTK_TABLE(table), label, 1,2, 1,2,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show(label);
- label = gtk_label_new(_("y"));
- gtk_table_attach(GTK_TABLE(table), label, 2,3, 1,2,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show(label);
-
- label = gtk_label_new(_("Spacing"));
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_table_attach(GTK_TABLE(table), label, 0,1, 2,3,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show(label);
-
- adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 10.0, 0.1, 10.0, 0));
- width_x_entry = gtk_spin_button_new(adj, 1.0, 3);
- gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(width_x_entry), TRUE);
- gtk_table_attach(GTK_TABLE(table), width_x_entry, 1,2, 2,3,
- GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show(width_x_entry);
-
- adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 10.0, 0.1, 10.0, 0));
- width_y_entry = gtk_spin_button_new(adj, 1.0, 3);
- gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(width_y_entry), TRUE);
- gtk_table_attach(GTK_TABLE(table), width_y_entry, 2,3, 2,3,
- GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show(width_y_entry);
-
- label = gtk_label_new(_("Visible spacing"));
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_table_attach(GTK_TABLE(table), label, 0,1, 3,4,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show(label);
-
- adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 100.0, 1.0, 10.0, 0));
- visible_x_entry = gtk_spin_button_new(adj, 1.0, 0);
- gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(visible_x_entry), TRUE);
- gtk_table_attach(GTK_TABLE(table), visible_x_entry, 1,2, 3,4,
- GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show(visible_x_entry);
-
- adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 100.0, 1.0, 10.0, 0));
- visible_y_entry = gtk_spin_button_new(adj, 1.0, 0);
- gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(visible_y_entry), TRUE);
- gtk_table_attach(GTK_TABLE(table), visible_y_entry, 2,3, 3,4,
- GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show(visible_y_entry);
-
- /* Hexes! */
- hex_check = gtk_check_button_new_with_label(_("Hex grid"));
- gtk_table_attach(GTK_TABLE(table), hex_check, 1,2, 4,5,
- GTK_FILL, GTK_FILL, 0, 0);
- g_signal_connect(G_OBJECT(hex_check), "toggled",
- G_CALLBACK(diagram_properties_update_sensitivity), NULL);
-
- gtk_widget_show(hex_check);
-
- label = gtk_label_new(_("Hex grid size"));
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_table_attach(GTK_TABLE(table), label, 0,1, 5,6,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show(label);
-
- adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 100.0, 1.0, 10.0, 0));
- hex_size_entry = gtk_spin_button_new(adj, 1.0, 0);
- gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(hex_size_entry), TRUE);
- gtk_table_attach(GTK_TABLE(table), hex_size_entry, 1,2, 5,6,
- GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show(hex_size_entry);
-
- label = gtk_label_new(_("Grid"));
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
- gtk_widget_show(table);
- gtk_widget_show(label);
+ GError *error = NULL;
+ gchar *uifile;
+ GtkBuilder *builder;
+
+ gtk_dialog_add_buttons (GTK_DIALOG (self),
+ _("_Close"), GTK_RESPONSE_CANCEL,
+ _("_Apply"), GTK_RESPONSE_APPLY,
+ _("_OK"), GTK_RESPONSE_OK,
+ NULL);
+ gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_OK);
+
+ dialog_vbox = gtk_dialog_get_content_area (GTK_DIALOG (self));
+
+ gtk_window_set_role (GTK_WINDOW (self), "diagram_properties");
+
+ g_signal_connect (G_OBJECT (self), "destroy",
+ G_CALLBACK (gtk_widget_destroyed), &self);
+
+ /* Load UI */
+ builder = gtk_builder_new ();
+ uifile = build_ui_filename ("ui/properties-dialog.ui");
+ if (!gtk_builder_add_from_file (builder, uifile, &error)) {
+ g_warning ("Couldn't load builder file: %s", error->message);
+ g_error_free (error);
+ }
+ g_free (uifile);
+
+ notebook = GTK_WIDGET (gtk_builder_get_object (builder, "notebook"));
+ gtk_box_pack_start (GTK_BOX (dialog_vbox), notebook, TRUE, TRUE, 0);
+
+ /* Grid Page */
+ priv->dynamic = GTK_WIDGET (gtk_builder_get_object (builder, "dynamic"));
+ g_signal_connect (G_OBJECT (priv->dynamic),
+ "toggled",
+ G_CALLBACK (update_sensitivity),
+ self);
+ priv->manual = GTK_WIDGET (gtk_builder_get_object (builder, "manual"));
+ g_signal_connect (G_OBJECT (priv->manual),
+ "toggled",
+ G_CALLBACK (update_sensitivity),
+ self);
+ priv->manual_props = GTK_WIDGET (gtk_builder_get_object (builder, "manual_props"));
+ priv->hex = GTK_WIDGET (gtk_builder_get_object (builder, "hex"));
+ g_signal_connect (G_OBJECT (priv->hex),
+ "toggled",
+ G_CALLBACK (update_sensitivity),
+ self);
+ priv->hex_props = GTK_WIDGET (gtk_builder_get_object (builder, "hex_props"));
+
+ priv->spacing_x = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "spacing_x"));
+ priv->spacing_y = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "spacing_y"));
+ priv->vis_spacing_x = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "vis_spacing_x"));
+ priv->vis_spacing_y = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "vis_spacing_y"));
+ priv->hex_size = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "hex_size"));
/* The background page */
- table = gtk_table_new(1,2, FALSE);
- gtk_container_set_border_width(GTK_CONTAINER(table), 2);
- gtk_table_set_row_spacings(GTK_TABLE(table), 1);
- gtk_table_set_col_spacings(GTK_TABLE(table), 2);
-
- label = gtk_label_new(_("Background"));
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_table_attach(GTK_TABLE(table), label, 0,1, 0,1,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show(label);
-
- bg_colour = dia_color_selector_new();
- gtk_table_attach(GTK_TABLE(table), bg_colour, 1,2, 0,1,
- GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show(bg_colour);
-
- label = gtk_label_new(_("Grid Lines"));
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_table_attach(GTK_TABLE(table), label, 0,1, 1,2,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show(label);
-
- grid_colour = dia_color_selector_new();
- gtk_table_attach(GTK_TABLE(table), grid_colour, 1,2, 1,2,
- GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show(grid_colour);
-
- label = gtk_label_new(_("Page Breaks"));
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_table_attach(GTK_TABLE(table), label, 0,1, 2,3,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show(label);
-
- pagebreak_colour = dia_color_selector_new();
- gtk_table_attach(GTK_TABLE(table), pagebreak_colour, 1,2, 2,3,
- GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show(pagebreak_colour);
-
- label = gtk_label_new(_("Colors"));
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
- gtk_widget_show(table);
- gtk_widget_show(label);
+
+ priv->background = GTK_WIDGET (gtk_builder_get_object (builder, "background"));
+ priv->grid_lines = GTK_WIDGET (gtk_builder_get_object (builder, "grid_lines"));
+ priv->page_lines = GTK_WIDGET (gtk_builder_get_object (builder, "page_lines"));
+
+ g_clear_object (&builder);
}
+
/* diagram_properties_retrieve
* Retrieves properties of a diagram *dia and sets the values in the
* diagram properties dialog.
*/
-static void
-diagram_properties_retrieve(Diagram *dia)
+void
+dia_diagram_properties_dialog_set_diagram (DiaDiagramPropertiesDialog *self,
+ Diagram *diagram)
{
+ DiaDiagramPropertiesDialogPrivate *priv;
gchar *title;
- gchar *name = dia ? diagram_get_name(dia) : "?";
+ gchar *name;
+
+ g_return_if_fail (DIA_IS_DIAGRAM_PROPERTIES_DIALOG (self));
+
+ priv = dia_diagram_properties_dialog_get_instance_private (self);
+
+ if (priv->diagram) {
+ g_object_weak_unref (G_OBJECT (priv->diagram), diagram_died, self);
+ priv->diagram = NULL;
+ }
+
+ if (diagram == NULL) {
+ gtk_window_set_title (GTK_WINDOW (self), _("Diagram Properties"));
+
+ gtk_widget_set_sensitive (GTK_WIDGET (self), FALSE);
- g_return_if_fail(dia != NULL);
- if (!dialog)
return;
+ }
+
+ gtk_widget_set_sensitive (GTK_WIDGET (self), TRUE);
+
+ g_object_weak_ref (G_OBJECT (diagram), diagram_died, self);
+ priv->diagram = diagram;
+
+ name = diagram ? diagram_get_name (diagram) : NULL;
/* Can we be sure that the filename is the 'proper title'? */
- title = g_strdup_printf(_("Diagram Properties: %s"), name ? name : "??");
- gtk_window_set_title(GTK_WINDOW(dialog), title);
- g_free(name);
- g_free(title);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dynamic_check),
- dia->grid.dynamic);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(width_x_entry),
- dia->grid.width_x);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(width_y_entry),
- dia->grid.width_y);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(visible_x_entry),
- dia->grid.visible_x);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(visible_y_entry),
- dia->grid.visible_y);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hex_check),
- dia->grid.hex);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(hex_size_entry),
- dia->grid.hex_size);
-
- dia_color_selector_set_color(bg_colour,
- &dia->data->bg_color);
- dia_color_selector_set_color(grid_colour,
- &dia->grid.colour);
- dia_color_selector_set_color(pagebreak_colour,
- &dia->pagebreak_color);
-
- diagram_properties_update_sensitivity(GTK_TOGGLE_BUTTON(dynamic_check), dia);
+ title = g_strdup_printf ("%s", name ? name : _("Diagram Properties"));
+ gtk_window_set_title (GTK_WINDOW (self), title);
+ g_clear_pointer (&name, g_free);
+ g_clear_pointer (&title, g_free);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->dynamic),
+ diagram->grid.dynamic);
+
+ gtk_adjustment_set_value (priv->spacing_x, diagram->grid.width_x);
+ gtk_adjustment_set_value (priv->spacing_y, diagram->grid.width_y);
+ gtk_adjustment_set_value (priv->vis_spacing_x, diagram->grid.visible_x);
+ gtk_adjustment_set_value (priv->vis_spacing_y, diagram->grid.visible_y);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->hex),
+ diagram->grid.hex);
+
+ gtk_adjustment_set_value (priv->hex_size, diagram->grid.hex_size);
+
+ dia_color_selector_set_color (priv->background,
+ &diagram->data->bg_color);
+ dia_color_selector_set_color (priv->grid_lines,
+ &diagram->grid.colour);
+ dia_color_selector_set_color (priv->page_lines,
+ &diagram->pagebreak_color);
+
+ update_sensitivity (GTK_TOGGLE_BUTTON (priv->dynamic), self);
+
+ g_object_notify_by_pspec (G_OBJECT (self), pspecs[PROP_DIAGRAM]);
}
-void
-diagram_properties_show(Diagram *dia)
+
+Diagram *
+dia_diagram_properties_dialog_get_diagram (DiaDiagramPropertiesDialog *self)
{
- if (dialog) {
- /* This makes the dialog a child of the newer diagram */
- gtk_widget_destroy(dialog);
- dialog = NULL;
- }
+ DiaDiagramPropertiesDialogPrivate *priv;
- create_diagram_properties_dialog(dia);
+ g_return_val_if_fail (DIA_IS_DIAGRAM_PROPERTIES_DIALOG (self), NULL);
- diagram_properties_retrieve(dia);
+ priv = dia_diagram_properties_dialog_get_instance_private (self);
- gtk_window_set_transient_for(GTK_WINDOW(dialog),
- GTK_WINDOW (ddisplay_active()->shell));
- gtk_widget_show(dialog);
+ return priv->diagram;
}
-static void
-diagram_properties_respond(GtkWidget *widget,
- gint response_id,
- gpointer user_data)
+
+DiaDiagramPropertiesDialog *
+dia_diagram_properties_dialog_get_default (void)
{
- Diagram *active_diagram = ddisplay_active_diagram();
+ static DiaDiagramPropertiesDialog *instance;
- if (response_id == GTK_RESPONSE_OK ||
- response_id == GTK_RESPONSE_APPLY) {
- if (active_diagram) {
- /* we do not bother for the actual change, just record the
- * whole possible change */
- dia_mem_swap_change_new (active_diagram,
- &active_diagram->grid,
- sizeof(active_diagram->grid));
- dia_mem_swap_change_new (active_diagram,
- &active_diagram->data->bg_color,
- sizeof(active_diagram->data->bg_color));
- dia_mem_swap_change_new (active_diagram,
- &active_diagram->pagebreak_color,
- sizeof(active_diagram->pagebreak_color));
- undo_set_transactionpoint(active_diagram->undo);
-
- active_diagram->grid.dynamic =
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dynamic_check));
- active_diagram->grid.width_x =
- gtk_spin_button_get_value(GTK_SPIN_BUTTON(width_x_entry));
- active_diagram->grid.width_y =
- gtk_spin_button_get_value(GTK_SPIN_BUTTON(width_y_entry));
- active_diagram->grid.visible_x =
- gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(visible_x_entry));
- active_diagram->grid.visible_y =
- gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(visible_y_entry));
- active_diagram->grid.hex =
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hex_check));
- active_diagram->grid.hex_size =
- gtk_spin_button_get_value(GTK_SPIN_BUTTON(hex_size_entry));
- dia_color_selector_get_color(bg_colour,
- &active_diagram->data->bg_color);
- dia_color_selector_get_color(grid_colour,
- &active_diagram->grid.colour);
- dia_color_selector_get_color(pagebreak_colour,
- &active_diagram->pagebreak_color);
- diagram_add_update_all(active_diagram);
- diagram_flush(active_diagram);
- diagram_set_modified(active_diagram, TRUE);
- }
+ if (instance == NULL) {
+ instance = g_object_new (DIA_TYPE_DIAGRAM_PROPERTIES_DIALOG,
+ "title", _("Diagram Properties"),
+ NULL);
+ g_object_add_weak_pointer (G_OBJECT (instance), (gpointer *) &instance);
}
- if (response_id != GTK_RESPONSE_APPLY)
- gtk_widget_hide(dialog);
+
+ return instance;
}
-/* diagram_properties_set_diagram
- * Called when the active diagram is changed. It updates the contents
- * of the diagram properties dialog
- */
+
void
-diagram_properties_set_diagram(Diagram *dia)
+diagram_properties_show(Diagram *dia)
{
- if (dialog && dia != NULL)
- {
- diagram_properties_retrieve(dia);
- }
+ DiaDiagramPropertiesDialog *dialog = dia_diagram_properties_dialog_get_default ();
+
+ dia_diagram_properties_dialog_set_diagram (dialog, dia);
+
+ gtk_window_set_transient_for (GTK_WINDOW (dialog),
+ GTK_WINDOW (ddisplay_active()->shell));
+ gtk_widget_show (GTK_WIDGET (dialog));
}
diff --git a/app/dia-props.h b/app/dia-props.h
index 68f61811..fa3fcb27 100644
--- a/app/dia-props.h
+++ b/app/dia-props.h
@@ -19,11 +19,24 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifndef _DIA_PROPS_H_
-#define _DIA_PROPS_H_
+#pragma once
+
#include "diagram.h"
-void diagram_properties_show(Diagram *dia);
-void diagram_properties_set_diagram(Diagram *dia);
+#include <gtk/gtk.h>
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GtkDialog, g_object_unref)
+
+#define DIA_TYPE_DIAGRAM_PROPERTIES_DIALOG dia_diagram_properties_dialog_get_type ()
+G_DECLARE_DERIVABLE_TYPE (DiaDiagramPropertiesDialog, dia_diagram_properties_dialog, DIA,
DIAGRAM_PROPERTIES_DIALOG, GtkDialog)
-#endif
+struct _DiaDiagramPropertiesDialogClass {
+ GtkDialogClass parent;
+};
+
+void dia_diagram_properties_dialog_set_diagram (DiaDiagramPropertiesDialog *self,
+ Diagram *diagram);
+Diagram *dia_diagram_properties_dialog_get_diagram (DiaDiagramPropertiesDialog *self);
+DiaDiagramPropertiesDialog *dia_diagram_properties_dialog_get_default (void);
+
+void diagram_properties_show(Diagram *dia);
diff --git a/app/display.c b/app/display.c
index 8f1eb140..add265e9 100644
--- a/app/display.c
+++ b/app/display.c
@@ -1381,8 +1381,9 @@ display_set_active(DDisplay *ddisp)
active_display = ddisp;
/* perform notification here (such as switch layers dialog) */
- layer_dialog_set_diagram(ddisp ? ddisp->diagram : NULL);
- diagram_properties_set_diagram(ddisp ? ddisp->diagram : NULL);
+ layer_dialog_set_diagram (ddisp ? ddisp->diagram : NULL);
+ dia_diagram_properties_dialog_set_diagram (dia_diagram_properties_dialog_get_default (),
+ ddisp ? ddisp->diagram : NULL);
if (ddisp) {
if (ddisp->is_standalone_window)
diff --git a/app/menus.h b/app/menus.h
index d8fed263..b8856043 100644
--- a/app/menus.h
+++ b/app/menus.h
@@ -58,6 +58,7 @@ void menus_clear_recent (void);
#define VIEW_LAYERS_ACTION "ViewLayers"
GtkBuilder *builder_new_from_file (const char *filename);
+gchar *build_ui_filename (const gchar* name);
#endif /* MENUS_H */
diff --git a/app/sheet-editor/sheets_dialog.c b/app/sheet-editor/sheets_dialog.c
index 2b8e6d12..cfbf4c4f 100644
--- a/app/sheet-editor/sheets_dialog.c
+++ b/app/sheet-editor/sheets_dialog.c
@@ -39,6 +39,7 @@
#include "intl.h"
#include "persistence.h"
+#include "menus.h"
static void
sheets_dialog_destroyed (GtkWidget *widget, gpointer user_data)
@@ -50,26 +51,6 @@ sheets_dialog_destroyed (GtkWidget *widget, gpointer user_data)
g_object_set_data (G_OBJECT (widget), "_sheet_dialogs_builder", NULL);
}
-/* FIXME: header? */
-gchar *build_ui_filename (const gchar* name);
-
-static GtkBuilder *
-builder_new_from_file (const char *filename)
-{
- GError *error = NULL;
- gchar *uifile;
- GtkBuilder *builder;
-
- builder = gtk_builder_new ();
- uifile = build_ui_filename (filename);
- if (!gtk_builder_add_from_file (builder, uifile, &error)) {
- g_warning ("Couldn't load builder file: %s", error->message);
- g_error_free (error);
- }
- g_free (uifile);
- return builder;
-}
-
GtkWidget*
create_sheets_main_dialog (void)
{
diff --git a/app/toolbox.c b/app/toolbox.c
index bd0c5d32..a4356edc 100644
--- a/app/toolbox.c
+++ b/app/toolbox.c
@@ -272,6 +272,13 @@ fill_sheet_wbox(Sheet *sheet)
pixbuf = pixbuf_from_resource ((const char *) sheet_obj->pixmap + 4);
} else {
pixbuf = gdk_pixbuf_new_from_xpm_data (sheet_obj->pixmap);
+ if (pixbuf == NULL) {
+ g_warning ("Problem with: %s", (const char *) sheet_obj->pixmap);
+ pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
+ "image-missing",
+ 22,
+ 0, NULL);
+ }
}
} else if (sheet_obj->pixmap_file != NULL) {
GError* gerror = NULL;
@@ -300,10 +307,9 @@ fill_sheet_wbox(Sheet *sheet)
type = object_get_type(sheet_obj->object_type);
pixbuf = gdk_pixbuf_new_from_xpm_data (type->pixmap);
}
+
if (pixbuf) {
image = gtk_image_new_from_pixbuf (pixbuf);
- } else {
- image = gtk_image_new ();
}
button = gtk_radio_button_new (tool_group);
diff --git a/app/undo.c b/app/undo.c
index aceeb96c..bdc01958 100644
--- a/app/undo.c
+++ b/app/undo.c
@@ -97,7 +97,7 @@ void
undo_destroy(UndoStack *stack)
{
undo_clear(stack);
- g_free(stack->current_change); /* Free first transaction point. */
+
g_free(stack);
}
diff --git a/data/ui/properties-dialog.ui b/data/ui/properties-dialog.ui
new file mode 100644
index 00000000..ebc8b5a8
--- /dev/null
+++ b/data/ui/properties-dialog.ui
@@ -0,0 +1,436 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <requires lib="gtk+" version="2.24"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkAdjustment" id="hex_size">
+ <property name="upper">100</property>
+ <property name="value">1</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="spacing_x">
+ <property name="upper">10</property>
+ <property name="value">1</property>
+ <property name="step_increment">0.10000000000000001</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="spacing_y">
+ <property name="upper">10</property>
+ <property name="value">1</property>
+ <property name="step_increment">0.10000000000000001</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="vis_spacing_x">
+ <property name="upper">100</property>
+ <property name="value">1</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="vis_spacing_y">
+ <property name="upper">100</property>
+ <property name="value">1</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkNotebook" id="notebook">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_border">False</property>
+ <child>
+ <object class="GtkTable" id="table3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">5</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <property name="border_width">6</property>
+ <child>
+ <object class="GtkRadioButton" id="dynamic">
+ <property name="label" translatable="yes">_Dynamic Grid</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">manual</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="manual">
+ <property name="label" translatable="yes">_Manual Grid</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Spacing</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Visible Spacing</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="manual_props">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Column</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Row</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinbutton1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="width_chars">3</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">spacing_x</property>
+ <property name="digits">1</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinbutton2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="width_chars">3</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">spacing_y</property>
+ <property name="digits">1</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinbutton3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="width_chars">3</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">vis_spacing_x</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinbutton4">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="width_chars">3</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">vis_spacing_y</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="hex">
+ <property name="label" translatable="yes">_Hex Grid</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">manual</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="hex_props">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="width_chars">3</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">hex_size</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Hex Grid Size</property>
+ </object>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Grid</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="table2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Background</property>
+ </object>
+ <packing>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Grid Lines</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Page Breaks</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="DiaColorSelector" id="background">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="DiaColorSelector" id="grid_lines">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="DiaColorSelector" id="page_lines">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Colors</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ </object>
+ <object class="GtkSizeGroup" id="sizegroup1">
+ <property name="mode">vertical</property>
+ <widgets>
+ <widget name="spinbutton1"/>
+ <widget name="spinbutton3"/>
+ <widget name="label5"/>
+ <widget name="label6"/>
+ </widgets>
+ </object>
+</interface>
diff --git a/objects/Misc/pixmaps/n_gon.xpm b/objects/Misc/pixmaps/n_gon.xpm
index dc073993..5276e5a2 100644
--- a/objects/Misc/pixmaps/n_gon.xpm
+++ b/objects/Misc/pixmaps/n_gon.xpm
@@ -1,6 +1,6 @@
/* XPM */
static const char * n_gon_xpm[] = {
-"22 22 60 1",
+"22 22 59 1",
" c None",
"+ c #000000",
"@ c #6B6B6B",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]