Skip to content

Improve layout interaction, cursor-anchored zoom, and embedded GUI tools - #555

Open
rudra290 wants to merge 3 commits into
RTimothyEdwards:masterfrom
rudra290:zoom
Open

Improve layout interaction, cursor-anchored zoom, and embedded GUI tools#555
rudra290 wants to merge 3 commits into
RTimothyEdwards:masterfrom
rudra290:zoom

Conversation

@rudra290

Copy link
Copy Markdown

Pull Request Request

Title

Improve layout interaction, cursor-anchored zoom, and embedded GUI tools

Summary

This contribution improves the Tcl/Tk GUI interaction experience in Magic while preserving the existing command-based workflow.

Changes included

Cursor-anchored zoom

  • Zooming now keeps the point under the cursor fixed on screen.
  • Updated:
    • windows/windView.c
    • windows/windClient.c
    • windows/windCmdSZ.c
    • windows/windows.h
  • Updated the zoom documentation in:
    • doc/html/zoom.html

Left-side tool toolbar

Added clickable GUI tool buttons for:

  • Cursor
  • Wire
  • Net
  • Pick
  • Ruler

The active tool is visually highlighted.

The toolbar also:

  • Cancels unfinished Wire or Pick operations before switching tools.
  • Restores focus to the Magic layout window after a toolbar click.
  • Keeps keyboard shortcuts such as g for grid, z/Z for zoom, and other Magic shortcuts working.

Improved box interaction

  • Added left-button drag box creation in the Cursor tool.
  • Dragging works in all four directions:
    • Top-left
    • Top-right
    • Bottom-left
    • Bottom-right
  • Box coordinates are normalized automatically.
  • Existing right-button box resizing behavior remains available.

Improved layout information display

The top-right status area now reports more useful information, including:

  • Cursor coordinates
  • Box lower-left coordinate
  • Box upper-right coordinate
  • Box width and height
  • Cursor offset from the box origin
  • Box center
  • Box area

Embedded console

  • Exposed the existing in-application Tcl console through the Options menu.
  • Renamed the menu option to Embedded Console.
  • The console can be opened and hidden per layout window.
  • It supports command history and displays Magic output and errors.

Documentation

Updated:

doc/html/zoom.html
doc/html/box.html
doc/html/maketoolbar.html

Commits

f7a08fbe Keep zoom position fixed under cursor
47e1d8c1 Improve layout editing tools
c4ae5a14 Restore keyboard focus after tool selection

Validation

  • git diff --check passed.
  • The working tree is clean.
  • The project was built successfully in the user’s environment.
  • The local build attempt was blocked by the environment’s read-only ccache configuration, not by a source compilation error.

Request for review

These changes were implemented by ChatGPT Luna in response to the requested UI improvements. Please review the implementation carefully, especially the Tcl/Tk event bindings and interactions with Magic’s existing mouse-button and keyboard macro system, and consider whether the changes fit the project’s established behavior and contribution standards.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant