Skip to content

Commit

Permalink
Edit on double click
Browse files Browse the repository at this point in the history
  • Loading branch information
amolenaar committed Jun 2, 2023
1 parent af6e3fd commit 8c26631
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions gaphor/UML/actions/activitypropertypage.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ def text_key_pressed(ctrl, keyval, keycode, state):
key_ctrl.connect("key-pressed", text_key_pressed)
text.add_controller(key_ctrl)

def double_click(ctrl, n_press, x, y):
if n_press == 2:
stack.activate_action("parameter.rename")

click_ctrl = Gtk.GestureClick.new()
click_ctrl.connect("pressed", double_click)
builder.get_object("label").add_controller(click_ctrl)

def start_editing(stack, pspec):
if stack.get_visible_child_name() == "editing":
text.grab_focus()
Expand Down
2 changes: 1 addition & 1 deletion gaphor/UML/actions/parameter.ui
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<object class="GtkStackPage">
<property name="name">readonly</property>
<property name="child">
<object class="GtkLabel">
<object class="GtkLabel" id="label">
<property name="xalign">0</property>
<binding name="label">
<lookup name="parameter" type="ActivityParameterNodeView">
Expand Down

0 comments on commit 8c26631

Please sign in to comment.