Compare commits

...

3 Commits

Author SHA1 Message Date
Přemysl Eric Janouch de291ffddb
Reset view position on opening a file 2021-11-02 11:28:48 +01:00
Přemysl Eric Janouch baaca4c58f
Add all opened files to the recent list
The GTK+ file open/save dialog has already been adding them,
but opening files from the command line would circumvent that path.
2021-11-02 11:24:40 +01:00
Přemysl Eric Janouch 7499f92811
Close symbol paths where appropriate
Removes some ugliness in PDF exports, stemming from line thickness.
2021-11-02 10:36:17 +01:00
5 changed files with 16 additions and 6 deletions

View File

@ -23,6 +23,7 @@ local render = function (cr)
cr:curve_to (3, 0, 2, 2, 0, 2)
cr:line_to (-2, 2)
cr:curve_to (-1, 1, -1, -1, -2, -2)
cr:close_path ()
cr:stroke ()
-- The terminals

View File

@ -21,8 +21,7 @@ local render = function (cr)
cr:line_to (-1, 0)
-- The terminals
cr:move_to (-2, 0)
cr:line_to (-1, 0)
cr:line_to (-2, 0)
cr:move_to (1, 0)
cr:line_to (2, 0)

View File

@ -48,7 +48,7 @@ local render = function (cr)
cr:move_to (-1, -1)
cr:line_to (1, 0)
cr:line_to (-1, 1)
cr:line_to (-1, -1)
cr:close_path ()
-- The vertical line
cr:move_to (1, 1)

View File

@ -42,7 +42,7 @@ local render = function (cr)
cr:line_to (1.5, -0.5)
cr:line_to (1.5, 0.5)
cr:line_to (-1.5, 0.5)
cr:line_to (-1.5, -0.5)
cr:close_path ()
-- The terminals
cr:move_to (-2, 0)

View File

@ -712,9 +712,10 @@ diagram_save (LdWindowMain *self, GtkWindow *dialog_parent,
static gboolean
diagram_open (LdWindowMain *self, const gchar *filename)
{
GError *error;
GError *error = NULL;
GFile *file;
gchar *uri;
error = NULL;
ld_diagram_load_from_file (self->priv->diagram, filename, &error);
if (error)
{
@ -748,8 +749,17 @@ diagram_open (LdWindowMain *self, const gchar *filename)
return FALSE;
}
file = g_file_new_for_path (filename);
uri = g_file_get_uri (file);
g_object_unref (file);
gtk_recent_manager_add_item (gtk_recent_manager_get_default (), uri);
g_free (uri);
ld_diagram_set_modified (self->priv->diagram, FALSE);
diagram_set_filename (self, g_strdup (filename));
ld_diagram_view_set_x (self->priv->view, 0);
ld_diagram_view_set_y (self->priv->view, 0);
return TRUE;
}