[UI/UX Feature Update]: Bottom statusbar now displays all the different drawing modes (wire, line, arc, ploygon, rect etc.) in a green box - that only showed the wire-drawing mode before this update.

This commit is contained in:
Chayan Deb 2025-03-16 15:07:40 +05:30
parent 56d125413f
commit 814733d5bb
1 changed files with 23 additions and 1 deletions

View File

@ -4544,9 +4544,23 @@ int infix_interface = tclgetboolvar("infix_interface");
int rstate; /* (reduced state, without ShiftMask) */
int snap_cursor = tclgetboolvar("snap_cursor");
int cadence_compat = tclgetboolvar("cadence_compat");
int persistent_command = tclgetboolvar("persistent_command");
int wire_draw_active = (xctx->ui_state & STARTWIRE) ||
((xctx->ui_state2 & MENUSTARTWIRE) && (xctx->ui_state & MENUSTART)) ||
(tclgetboolvar("persistent_command") && (xctx->last_command & STARTWIRE));
(persistent_command && (xctx->last_command & STARTWIRE));
int line_draw_active = (xctx->ui_state & STARTLINE) ||
((xctx->ui_state2 & MENUSTARTLINE) && (xctx->ui_state & MENUSTART)) ||
(persistent_command && (xctx->last_command & STARTLINE));
int poly_draw_active = (xctx->ui_state & STARTPOLYGON) ||
((xctx->ui_state2 & MENUSTARTPOLYGON) && (xctx->ui_state & MENUSTART)) ||
(persistent_command && (xctx->last_command & STARTPOLYGON));
int arc_draw_active = (xctx->ui_state & STARTARC) ||
((xctx->ui_state2 & MENUSTARTARC) && (xctx->ui_state & MENUSTART)) ||
(persistent_command && (xctx->last_command & STARTARC));
int rect_draw_active = (xctx->ui_state & STARTRECT) ||
((xctx->ui_state2 & MENUSTARTRECT) && (xctx->ui_state & MENUSTART)) ||
(persistent_command && (xctx->last_command & STARTRECT));
/* this fix uses an alternative method for getting mouse coordinates on KeyPress/KeyRelease
* events. Some remote connection softwares do not generate the correct coordinates
@ -4582,6 +4596,14 @@ int wire_draw_active = (xctx->ui_state & STARTWIRE) ||
if(wire_draw_active) {
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW WIRE! }", NULL);
} else if(line_draw_active) {
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW LINE! }", NULL);
} else if(poly_draw_active) {
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW POLYGON! }", NULL);
} else if(arc_draw_active) {
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW ARC! }", NULL);
} else if(rect_draw_active) {
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW RECTANGLE! }", NULL);
} else {
tclvareval(xctx->top_path, ".statusbar.10 configure -state normal -text { }", NULL);
}