Changeset 5970 in josm for trunk


Ignore:
Timestamp:
2013-05-28T13:46:20+02:00 (7 years ago)
Author:
Don-vip
Message:

fix broken popup menus in toggle dialog title bars (broken by r5958)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r5958 r5970  
    478478            add(lblTitle_weak, GBC.std().fill(GBC.HORIZONTAL));
    479479
    480             addMouseListener(new MouseEventHandler());
    481 
    482480            if(Main.pref.getBoolean("dialog.dynamic.buttons", true)) {
    483481                buttonsHide = new JButton(ImageProvider.get("misc", buttonHiding != ButtonHiddingType.ALWAYS_SHOWN ? "buttonhide" : "buttonshow"));
     
    590588        }
    591589       
     590        public void registerMouseListener() {
     591            addMouseListener(new MouseEventHandler());
     592        }
     593       
    592594        class MouseEventHandler extends PopupMenuLauncher {
    593595            public MouseEventHandler() {
     
    860862            buttonsHide.setVisible(false);
    861863        }
     864       
     865        // Register title bar mouse listener only after buttonActions has been initialized to have a complete popup menu
     866        titleBar.registerMouseListener();
     867       
    862868        return data;
    863869    }
Note: See TracChangeset for help on using the changeset viewer.