Closed GitMensch closed 4 years ago
Maybe I understand. Currently ncurses-st-menu doesn't share any logic with application, and implementation of check boxes or options are implemented outside like in post_menu https://github.com/okbob/pspg/blob/master/src/menu.c. It is designed to be minimalistic.
Probably it should not be too hard to implement new option ST_MENU_OPTION_MARKED_REF
and function st_menu_set_option_ref(menu, cmd_BoldLabelsToggle, ST_MENU_OPTION_MARKED_REF, int *ref);
I have little bit problem with triple state values - because for every state I have to know drawing style.
Probably it should not be too hard to implement new option
ST_MENU_OPTION_MARKED_REF
and functionst_menu_set_option_ref(menu, cmd_BoldLabelsToggle, ST_MENU_OPTION_MARKED_REF, int *ref);
Sounds very nice!
I have little bit problem with triple state values - because for every state I have to know drawing style.
For option fields the triple state would just mean to draw no option as chosen (I suggest to always allow this initially and optionally provide a way to toggle to the third state by choosing the the chosen option again).
For checkboxes: yes, you'd need to know the drawing style, the default could be [x]
for marked, [ ]
for unchecked and something like[o]
for triple state.
Thank you for considering this FR.
Currently checks or switch are printed with same style with "✔". Because it is a menu, I am not sure if some wider image is good idea. I try to keep st-menu be minimalistic with very small overhead. Used symbol like "✔" can be changed by style configuration, but I prefer one char only - it can be UNICODE wide char, but only one char.
you can look on branch https://github.com/okbob/ncurses-st-menu/tree/external_states
I changed default symbols in style file - the boxes are not well readable.
Looks nice; a little space between those options and its text would be good. I guess the options can have a shortcut, too.
I suggest to add the new control types in the demo + screenshots (ideally also for the popup).
st 26. 2. 2020 v 19:02 odesílatel Simon Sobisch notifications@github.com napsal:
Looks nice; a little space between those options and its text would be good.
this is problem - it increase a complexity of layout, and I would not to have too large this library.
I guess the options can have a shortcut, too.
you can display shortcuts - it is not any problem - but - st_menu displays shortcuts only. Nothing more
I suggest to add the new control types in the demo + screenshots (ideally also for the popup).
Maybe, but probably not now. I prefer more simpler examples than one complex.
—
You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/okbob/ncurses-st-menu/issues/6?email_source=notifications&email_token=AAEFO446YGDHPHIJIKWF6LLRE2VC3A5CNFSM4K2UVVR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENBIDZA#issuecomment-591561188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEFO44CZYTUKBYR45JIEKDRE2VC3ANCNFSM4K2UVVRQ .
a checkbox would have an additional pointer to an int/char variable (and possibly if a "triple state" is possible [would evaluate to -1], off = 0, on = 1)
for options we likely would have two set of definitions:
@okbob Is it understandable what I mean? Should those two additional control types be split to two issues?