From 5efe3fa91026e99b86026a3e46f133e07cf2683f Mon Sep 17 00:00:00 2001 From: Trevor Williams Date: Sat, 7 Dec 2024 01:53:10 -0600 Subject: [PATCH] Fixing more issues. --- src/DrawArea.vala | 27 ++++++++++++--------------- src/NodeInspector.vala | 4 ++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/DrawArea.vala b/src/DrawArea.vala index 4dbef7c2..d92353a0 100644 --- a/src/DrawArea.vala +++ b/src/DrawArea.vala @@ -1276,21 +1276,18 @@ public class DrawArea : Gtk.DrawingArea { item and redraws the canvas. */ public void add_current_image() { - var nodes = _selected.nodes(); - if( nodes.length == 1 ) { - var current = nodes.index( 0 ); - if( current.image == null ) { - image_manager.choose_image( win, (id) => { - stdout.printf( "Setting current: %s\n", (current == null) ? "NA" : current.name.text.text ); - current.set_image( image_manager, new NodeImage( image_manager, id, current.style.node_width ) ); - if( current.image != null ) { - undo_buffer.add_item( new UndoNodeImage( current, null ) ); - queue_draw(); - current_changed( this ); - auto_save(); - } - }); - } + var current = _selected.current_node(); + if( (current != null) && (current.image == null) ) { + image_manager.choose_image( win, (id) => { + var curr = _selected.current_node(); + curr.set_image( image_manager, new NodeImage( image_manager, id, curr.style.node_width ) ); + if( curr.image != null ) { + undo_buffer.add_item( new UndoNodeImage( curr, null ) ); + queue_draw(); + current_changed( this ); + auto_save(); + } + }); } } diff --git a/src/NodeInspector.vala b/src/NodeInspector.vala index e78ca437..a67f1536 100644 --- a/src/NodeInspector.vala +++ b/src/NodeInspector.vala @@ -350,11 +350,13 @@ public class NodeInspector : Box { var lbl = new Label( Utils.make_title( _( "Image" ) ) ) { halign = Align.START, + hexpand = true, xalign = (float)0, use_markup = true }; var btn_edit = new Button.from_icon_name( "document-edit-symbolic" ) { + halign = Align.END, tooltip_text = _( "Edit Image" ) }; btn_edit.clicked.connect(() => { @@ -362,6 +364,7 @@ public class NodeInspector : Box { }); var btn_del = new Button.from_icon_name( "edit-delete-symbolic" ) { + halign = Align.END, tooltip_text = _( "Remove Image" ) }; btn_del.clicked.connect(() => { @@ -369,6 +372,7 @@ public class NodeInspector : Box { }); _resize = new ToggleButton() { + halign = Align.END, icon_name = "view-fullscreen-symbolic", tooltip_text = _( "Resizable" ) };