ui: don't offer to delete/cut root element and don't offer to paste non-Rule at the top level
This commit is contained in:
parent
8be0e21ac7
commit
daafe5ebca
|
@ -393,7 +393,7 @@ class DiversionDialog:
|
|||
parent_c = m[parent_it][0].component if wrapped.level > 0 else None
|
||||
menu = Gtk.Menu()
|
||||
can_wrap = wrapped.editable and wrapped.component is not None and wrapped.level >= 2
|
||||
can_delete = wrapped.editable and not isinstance(parent_c, _DIV.Not) and wrapped.component is not None
|
||||
can_delete = wrapped.editable and not isinstance(parent_c, _DIV.Not) and c is not None and wrapped.level >= 1
|
||||
can_insert = wrapped.editable and not isinstance(parent_c, _DIV.Not) and wrapped.level >= 2
|
||||
can_insert_only_rule = wrapped.editable and wrapped.level == 1
|
||||
can_flatten = wrapped.editable and not isinstance(parent_c, _DIV.Not) and isinstance(
|
||||
|
@ -434,7 +434,7 @@ class DiversionDialog:
|
|||
p2 = self._menu_paste(m, it, below=True)
|
||||
p2.set_label(_('Paste rule below'))
|
||||
menu.append(p2)
|
||||
elif can_insert_root:
|
||||
elif can_insert_root and isinstance(_rule_component_clipboard, _DIV.Rule):
|
||||
p = self._menu_paste(m, m.iter_nth_child(it, 0))
|
||||
p.set_label(_('Paste rule'))
|
||||
menu.append(p)
|
||||
|
|
Loading…
Reference in New Issue