Changeset 3551 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2010-09-20T00:15:35+02:00 (14 years ago)
Author:
bastiK
Message:

see #5470 (patch by Christian Müller) - cosmetics for FullscreenToggleAction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java

    r3543 r3551  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.awt.Dimension;
    76import java.awt.Frame;
    87import java.awt.GraphicsDevice;
     
    8685            }
    8786        }
     87
     88        frame.dispose();
     89        frame.setUndecorated(selected);
     90
     91        if (selected) {
     92            prevBounds = frame.getBounds();
     93            System.err.println(" get "+prevBounds);
     94            frame.setBounds(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
     95        }
    8896       
    8997        // we cannot use hw-exclusive fullscreen mode in MS-Win, as long
    90         // as josm throws out modal dialogs as well :-), see here:
     98        // as josm throws out modal dialogs, see here:
    9199        // http://forums.sun.com/thread.jspa?threadID=5351882
    92100        //
     
    96104        String exclusive = Main.pref.get("draw.fullscreen.exclusive-mode", "auto");
    97105        if ("true".equals(exclusive) || ("auto".equals(exclusive) && !(Main.platform instanceof PlatformHookWindows))) {
    98             frame.dispose();
    99             frame.setUndecorated(selected);
    100106            gd.setFullScreenWindow(selected ? frame : null);
    101             for (Window wind : visibleWindows) {
    102                 wind.setVisible(true);
    103             }
    104         } else {
    105             frame.dispose();
    106             if (Main.pref.getBoolean("draw.fullscreen.set-screen-bounds", true) && selected) {
    107                 prevBounds = frame.getBounds();
    108                 Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
    109                 frame.setBounds(0, 0, dim.width, dim.height);
    110             } else if (prevBounds != null) {
    111                 frame.setBounds(prevBounds);
    112             }
    113             frame.setUndecorated(selected);
    114             for (Window wind : visibleWindows) {
    115                 wind.setVisible(true);
    116             }
     107        }
     108
     109        if (!selected && prevBounds != null) {
     110            System.err.println(" set "+prevBounds);
     111            frame.setBounds(prevBounds);
     112        }
     113
     114        for (Window wind : visibleWindows) {
     115            wind.setVisible(true);
    117116        }
    118117    }
Note: See TracChangeset for help on using the changeset viewer.