* adjust default dialog sizes to make it work better on OSX
This commit is contained in:
parent
7756019568
commit
960b1bd9f8
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package net.sourceforge.filebot.ui;
|
package net.sourceforge.filebot.ui;
|
||||||
|
|
||||||
|
|
||||||
import static java.awt.event.InputEvent.*;
|
import static java.awt.event.InputEvent.*;
|
||||||
import static java.awt.event.KeyEvent.*;
|
import static java.awt.event.KeyEvent.*;
|
||||||
import static javax.swing.KeyStroke.*;
|
import static javax.swing.KeyStroke.*;
|
||||||
|
@ -50,7 +48,6 @@ import net.sourceforge.tuned.ui.DefaultFancyListCellRenderer;
|
||||||
import net.sourceforge.tuned.ui.ShadowBorder;
|
import net.sourceforge.tuned.ui.ShadowBorder;
|
||||||
import net.sourceforge.tuned.ui.TunedUtilities;
|
import net.sourceforge.tuned.ui.TunedUtilities;
|
||||||
|
|
||||||
|
|
||||||
public class MainFrame extends JFrame {
|
public class MainFrame extends JFrame {
|
||||||
|
|
||||||
private JList selectionList = new PanelSelectionList(createPanelBuilders());
|
private JList selectionList = new PanelSelectionList(createPanelBuilders());
|
||||||
|
@ -59,7 +56,6 @@ public class MainFrame extends JFrame {
|
||||||
|
|
||||||
private static final PreferencesEntry<String> persistentSelectedPanel = Settings.forPackage(MainFrame.class).entry("panel.selected").defaultValue("1");
|
private static final PreferencesEntry<String> persistentSelectedPanel = Settings.forPackage(MainFrame.class).entry("panel.selected").defaultValue("1");
|
||||||
|
|
||||||
|
|
||||||
public MainFrame() {
|
public MainFrame() {
|
||||||
super(Settings.getApplicationName());
|
super(Settings.getApplicationName());
|
||||||
|
|
||||||
|
@ -104,7 +100,7 @@ public class MainFrame extends JFrame {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setSize(860, 630);
|
setSize(980, 630);
|
||||||
|
|
||||||
// KEYBOARD SHORTCUTS
|
// KEYBOARD SHORTCUTS
|
||||||
TunedUtilities.installAction(this.getRootPane(), getKeyStroke(VK_DELETE, CTRL_MASK | SHIFT_MASK), new AbstractAction("Clear Cache") {
|
TunedUtilities.installAction(this.getRootPane(), getKeyStroke(VK_DELETE, CTRL_MASK | SHIFT_MASK), new AbstractAction("Clear Cache") {
|
||||||
|
@ -117,12 +113,10 @@ public class MainFrame extends JFrame {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static PanelBuilder[] createPanelBuilders() {
|
public static PanelBuilder[] createPanelBuilders() {
|
||||||
return new PanelBuilder[] { new ListPanelBuilder(), new RenamePanelBuilder(), new AnalyzePanelBuilder(), new EpisodeListPanelBuilder(), new SubtitlePanelBuilder(), new SfvPanelBuilder() };
|
return new PanelBuilder[] { new ListPanelBuilder(), new RenamePanelBuilder(), new AnalyzePanelBuilder(), new EpisodeListPanelBuilder(), new SubtitlePanelBuilder(), new SfvPanelBuilder() };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void showPanel(PanelBuilder selectedBuilder) {
|
protected void showPanel(PanelBuilder selectedBuilder) {
|
||||||
final JComponent contentPane = (JComponent) getContentPane();
|
final JComponent contentPane = (JComponent) getContentPane();
|
||||||
|
|
||||||
|
@ -157,12 +151,10 @@ public class MainFrame extends JFrame {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static class PanelSelectionList extends JList {
|
private static class PanelSelectionList extends JList {
|
||||||
|
|
||||||
private static final int SELECTDELAY_ON_DRAG_OVER = 300;
|
private static final int SELECTDELAY_ON_DRAG_OVER = 300;
|
||||||
|
|
||||||
|
|
||||||
public PanelSelectionList(PanelBuilder[] builders) {
|
public PanelSelectionList(PanelBuilder[] builders) {
|
||||||
super(builders);
|
super(builders);
|
||||||
|
|
||||||
|
@ -175,14 +167,12 @@ public class MainFrame extends JFrame {
|
||||||
new DropTarget(this, new DragDropListener());
|
new DropTarget(this, new DragDropListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private class DragDropListener extends DropTargetAdapter {
|
private class DragDropListener extends DropTargetAdapter {
|
||||||
|
|
||||||
private boolean selectEnabled = false;
|
private boolean selectEnabled = false;
|
||||||
|
|
||||||
private Timer dragEnterTimer;
|
private Timer dragEnterTimer;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dragOver(DropTargetDragEvent dtde) {
|
public void dragOver(DropTargetDragEvent dtde) {
|
||||||
if (selectEnabled) {
|
if (selectEnabled) {
|
||||||
|
@ -191,7 +181,6 @@ public class MainFrame extends JFrame {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dragEnter(final DropTargetDragEvent dtde) {
|
public void dragEnter(final DropTargetDragEvent dtde) {
|
||||||
dragEnterTimer = TunedUtilities.invokeLater(SELECTDELAY_ON_DRAG_OVER, new Runnable() {
|
dragEnterTimer = TunedUtilities.invokeLater(SELECTDELAY_ON_DRAG_OVER, new Runnable() {
|
||||||
|
@ -206,7 +195,6 @@ public class MainFrame extends JFrame {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dragExit(DropTargetEvent dte) {
|
public void dragExit(DropTargetEvent dte) {
|
||||||
selectEnabled = false;
|
selectEnabled = false;
|
||||||
|
@ -216,7 +204,6 @@ public class MainFrame extends JFrame {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drop(DropTargetDropEvent dtde) {
|
public void drop(DropTargetDropEvent dtde) {
|
||||||
|
|
||||||
|
@ -226,7 +213,6 @@ public class MainFrame extends JFrame {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static class PanelCellRenderer extends DefaultFancyListCellRenderer {
|
private static class PanelCellRenderer extends DefaultFancyListCellRenderer {
|
||||||
|
|
||||||
public PanelCellRenderer() {
|
public PanelCellRenderer() {
|
||||||
|
@ -241,7 +227,6 @@ public class MainFrame extends JFrame {
|
||||||
setHorizontalTextPosition(SwingConstants.CENTER);
|
setHorizontalTextPosition(SwingConstants.CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void configureListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
public void configureListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||||
super.configureListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
super.configureListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||||
|
|
|
@ -225,7 +225,7 @@ public class FormatDialog extends JDialog {
|
||||||
|
|
||||||
// initialize window properties
|
// initialize window properties
|
||||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||||
setSize(610, 430);
|
setSize(620, 445);
|
||||||
|
|
||||||
// initialize data
|
// initialize data
|
||||||
setState(initMode, lockOnBinding != null ? lockOnBinding : restoreSample(initMode), lockOnBinding != null);
|
setState(initMode, lockOnBinding != null ? lockOnBinding : restoreSample(initMode), lockOnBinding != null);
|
||||||
|
|
Loading…
Reference in New Issue