Update Gaphas to b2, now we have a tool to grab focus again
This commit is contained in:
parent
cdd8d91d6e
commit
2ec189e7bd
@ -4,7 +4,14 @@ TODO: make tools transactional.
|
||||
"""
|
||||
|
||||
from gaphas.segment import segment_tool
|
||||
from gaphas.tool import hover_tool, item_tool, rubberband_tool, scroll_tool, zoom_tool
|
||||
from gaphas.tool import (
|
||||
hover_tool,
|
||||
item_tool,
|
||||
rubberband_tool,
|
||||
scroll_tool,
|
||||
view_focus_tool,
|
||||
zoom_tool,
|
||||
)
|
||||
|
||||
from gaphor.diagram.diagramtools.dropzone import drop_zone_tool
|
||||
from gaphor.diagram.diagramtools.placement import new_item_factory, placement_tool
|
||||
@ -26,6 +33,7 @@ def apply_default_tool_set(view, modeling_language, event_manager, rubberband_st
|
||||
view.add_controller(rubberband_tool(view, rubberband_state))
|
||||
view.add_controller(scroll_tool(view))
|
||||
view.add_controller(zoom_tool(view))
|
||||
view.add_controller(view_focus_tool(view))
|
||||
view.add_controller(shortcut_tool(view, modeling_language, event_manager))
|
||||
|
||||
|
||||
@ -40,3 +48,4 @@ def apply_placement_tool_set(view, item_factory, event_manager, handle_index):
|
||||
view.add_controller(drop_zone_tool(view, item_factory.item_class))
|
||||
view.add_controller(scroll_tool(view))
|
||||
view.add_controller(zoom_tool(view))
|
||||
view.add_controller(view_focus_tool(view))
|
||||
|
@ -21,10 +21,8 @@ def on_delete(ctrl, keyval, keycode, state, event_manager):
|
||||
otherwise this key will confuse the text edit stuff.
|
||||
"""
|
||||
view: GtkView = ctrl.get_widget()
|
||||
if (
|
||||
view.is_focus()
|
||||
and keyval in (Gdk.KEY_Delete, Gdk.KEY_BackSpace)
|
||||
and (state == 0 or state & Gdk.ModifierType.MOD2_MASK)
|
||||
if keyval in (Gdk.KEY_Delete, Gdk.KEY_BackSpace) and (
|
||||
state == 0 or state & Gdk.ModifierType.MOD2_MASK
|
||||
):
|
||||
delete_selected_items(view, event_manager)
|
||||
return True
|
||||
|
527
poetry.lock
generated
527
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user