nkh / P5-App-Asciio

Plain ASCII diagram
https://nkh.github.io/P5-App-Asciio/
56 stars 4 forks source link

Make use of inline editing mode #46

Closed nkh closed 1 year ago

nkh commented 1 year ago

inline editing is less noisy than using dialogs make it more easily available

nkh commented 1 year ago

@qindapao I've made inline editing mainstream

commit: f4878ab0729d35151ea3965bff4ef9bb6867a4c1

documentation: https://github.com/nkh/P5-App-Asciio/blob/f4878ab0729d35151ea3965bff4ef9bb6867a4c1/documentation/mdbook_asciio/src/editing_elements.md

I'm going to try to work in inline mode for a while.

Please note the binding has changed Please note the added alternate mode

I haven't documented how to set it up in the configuration because GTK_POPUP_BOX_TYPE is a mouthful, I propose you change it to EDIT_TEXT_INLINE everywhere it's used and then update the documentation.

nkh commented 1 year ago

@qindapao it would be good if the inline editing mode had a cancel functionality

qindapao commented 1 year ago

'Edit inline' => ['000-i', \&App::Asciio::GTK::Asciio::switch_gtk_popup_box_type, ]

@nkh

This is switching,If you are in normal editing mode, press this to switch to inline editing mode.If you are in inline editing mode, press this to switch to normal editing mode.

qindapao commented 1 year ago

alternate editing mode can't switch successfully temporarily, can you check it?

$alternate_mode I found a strange phenomenon with this variable.

If an array is passed in, a temporary switch will occur, but if no value is passed in, the print is actually a hash.Then a temporary handover will also occur.

I can only edit with my mobile phone in the company.The company computer is isolated from the external network,If you don't understand what I said, I'll show you when I go back at night.

qindapao commented 1 year ago

I don't know where this hash came from, but obviously no variables were passed in.

nkh commented 1 year ago

It took my a moment to understand what you mean, not because you explained badly but because I was baffled too.

arguments to action-handlers are passed in the binding file

'Edit selected element inline'  => 
    [
    ['C00-2button-press-1','C00-Return'], #shortcuts
    \&App::Asciio::Actions::ElementsManipulation::edit_selected_element, # sub ref
   1, #arguments
    ... # more arguments
    ],

I passed "[1]" as an argument instead for "1" when I added the binding.

it's changed in 85acc87