Curved ratsnest UI issues.

Bug #1826446 reported by Michael Kavanagh
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Medium
Michael Kavanagh

Bug Description

Following from: https://bugs.launchpad.net/kicad/+bug/1766597 "fixed" in commit e7d32c54b90297554c0193e71c620f5ee78e5164.

* The icon in the toolbar should be in the group with the other (Show/Hide Ratsnest) button.
* We shouldn't use the term `airwire`, rather `ratsnest` like we do everywhere else.
* There should be a checkable menu item in the View menubar menu, in the same group as "Show Ratsnest".
* Maybe this should also go in the Preferences dialog? I'm torn on this one...

A lot of effort has been put in recently to make the UI more coherent across the suite, it would be a great shame to see this slide downhill again.

IMO, all the options like this should not be on a toolbar (by default at least, there will be too many in the future). Moving forward I think we should group options like these into tabbed, dockable panels. I'll try to put together a proposal and post it to the dev mailing list, but I'm aware of the limitations to wxAUI at the moment.

Tags: pcbnew ui
Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :
Revision history for this message
jean-pierre charras (jp-charras) wrote :

@Michael,

I just committed your patch. Thanks.

Changed in kicad:
status: Triaged → Fix Committed
Revision history for this message
John Beard (john-j-beard) wrote :

WRT to tabbed panels and so on, I did a little research, as far as I know:

* wxAUI doesn't supports vertical ribbon bars
* If you use dropdown tools (the ones with a little arrow on the right) you can't have them also "checkable" (with a boolean state).
* Dropdown tools don't work on Mac
* You can't have a right click handler on a "normal" wxToolbar's tool
* It doesn't say you *can't* have a right click handler on a wxAuiToolbar's tool (this is what we have right now).

At least on Linux, you can fairly easily pop a menu on right click (see attachment).

A common affordance for this is a small triangle or dot in the bottom right of the icon to indicate there's a secondary menu.

Code is something like this (this is obviously just a demo and doesn't actually hook into anything),
so it's relatively tractable. E.g. PCB_EDIT_FRAME::PCB_EDIT_FRAME():

    m_optionsToolBar->Bind(wxEVT_AUITOOLBAR_RIGHT_CLICK, [=](wxAuiToolBarEvent& aEvt) {
        wxLogDebug("rclick id %d", aEvt.GetId() );
        auto* menu = new wxMenu();

        wxMenuItem* item = new wxMenuItem( menu, wxID_ANY, "Item 1" );
        item->SetBitmap( KiScaledBitmap( curved_ratsnest_xpm, this ) );

        menu->Append( item );

        item = new wxMenuItem( menu, wxID_ANY, "Item 2", wxEmptyString, wxITEM_CHECK );
        menu->Append( item );

        m_optionsToolBar->PopupMenu(menu, aEvt.GetClickPoint().x, aEvt.GetClickPoint().y);
    }, wxID_ANY);

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.