Mouse is supported for " widget (#14599)

This commit is contained in:
Vanellope 2019-07-20 19:50:07 +09:00 committed by radare
parent a970be3c9d
commit a1c844d6eb

View File

@ -5256,13 +5256,28 @@ void __create_almighty(RCore *core, RPanel *panel, Sdb *menu_db) {
const int y = (core->panels->can->h - h) / 2;
RModal *modal = __init_modal ();
__set_geometry (&modal->pos, x, y, w, h);
int okey, key;
int okey, key, cx, cy;
char *word = NULL;
__update_modal (core, menu_db, modal);
while (modal) {
okey = r_cons_readchar ();
key = r_cons_arrow_to_hjkl (okey);
if (key == 0 || key == INT8_MAX) {
key = 'q';
word = NULL;
if (r_cons_get_click (&cx, &cy)) {
if ((key == 0 || key == INT8_MAX) &&
((cx < x || x + w < cx) ||
((cy < y || y + h < cy)))) {
key = 'q';
} else {
word = get_word_from_canvas_for_menu (core, core->panels, cx, cy);
if (word) {
void *cb = sdb_ptr_get (menu_db, word, 0);
if (cb) {
((RPanelAlmightyCallback)cb) (core, panel, NONE, word);
break;
}
}
}
}
switch (key) {
case 'j':