X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosuilib%2FAltosUIFrame.java;h=689ea7f312676cc46c451918bfe5b6e69b3a20cd;hb=5871225a0c442cf5afa41a444ff8bfb8f4002721;hp=ce86ad83fbab32aa4e0aac012cff79d807ef3f5d;hpb=f0216d721ed13f4d3dc608bb6ad8f83732b27c0a;p=fw%2Faltos diff --git a/altosuilib/AltosUIFrame.java b/altosuilib/AltosUIFrame.java index ce86ad83..689ea7f3 100644 --- a/altosuilib/AltosUIFrame.java +++ b/altosuilib/AltosUIFrame.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_2; +package org.altusmetrum.altosuilib_3; import java.awt.*; import java.awt.event.*; @@ -73,6 +73,9 @@ public class AltosUIFrame extends JFrame implements AltosUIListener, AltosPositi super.setLocationByPlatform(lbp); } + public void scan_device_selected(AltosDevice device) { + } + public void setSize() { /* Smash sizes around so that the window comes up in the right shape */ Insets i = getInsets(); @@ -154,11 +157,28 @@ public class AltosUIFrame extends JFrame implements AltosUIListener, AltosPositi } } + static boolean global_settings_done; + + public String getName() { + return "Altus Metrum"; + } + void init() { AltosUIPreferences.register_ui_listener(this); AltosUIPreferences.register_position_listener(this); position = AltosUIPreferences.position(); addWindowListener(new AltosUIFrameListener()); + + /* Try to make menus live in the menu bar like regular Mac apps */ + if (!global_settings_done) { + try { + global_settings_done = true; + System.setProperty("com.apple.mrj.application.apple.menu.about.name", getName()); + System.setProperty("com.apple.macos.useScreenMenuBar", "true"); + System.setProperty( "apple.laf.useScreenMenuBar", "true" ); // for older versions of Java + } catch (Exception e) { + } + } set_icon(); }