* 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;
|
||||
|
||||
|
||||
import static java.awt.event.InputEvent.*;
|
||||
import static java.awt.event.KeyEvent.*;
|
||||
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.TunedUtilities;
|
||||
|
||||
|
||||
public class MainFrame extends JFrame {
|
||||
|
||||
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");
|
||||
|
||||
|
||||
public MainFrame() {
|
||||
super(Settings.getApplicationName());
|
||||
|
||||
|
@ -104,7 +100,7 @@ public class MainFrame extends JFrame {
|
|||
}
|
||||
});
|
||||
|
||||
setSize(860, 630);
|
||||
setSize(980, 630);
|
||||
|
||||
// KEYBOARD SHORTCUTS
|
||||
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() {
|
||||
return new PanelBuilder[] { new ListPanelBuilder(), new RenamePanelBuilder(), new AnalyzePanelBuilder(), new EpisodeListPanelBuilder(), new SubtitlePanelBuilder(), new SfvPanelBuilder() };
|
||||
}
|
||||
|
||||
|
||||
protected void showPanel(PanelBuilder selectedBuilder) {
|
||||
final JComponent contentPane = (JComponent) getContentPane();
|
||||
|
||||
|
@ -157,12 +151,10 @@ public class MainFrame extends JFrame {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private static class PanelSelectionList extends JList {
|
||||
|
||||
private static final int SELECTDELAY_ON_DRAG_OVER = 300;
|
||||
|
||||
|
||||
public PanelSelectionList(PanelBuilder[] builders) {
|
||||
super(builders);
|
||||
|
||||
|
@ -175,14 +167,12 @@ public class MainFrame extends JFrame {
|
|||
new DropTarget(this, new DragDropListener());
|
||||
}
|
||||
|
||||
|
||||
private class DragDropListener extends DropTargetAdapter {
|
||||
|
||||
private boolean selectEnabled = false;
|
||||
|
||||
private Timer dragEnterTimer;
|
||||
|
||||
|
||||
@Override
|
||||
public void dragOver(DropTargetDragEvent dtde) {
|
||||
if (selectEnabled) {
|
||||
|
@ -191,7 +181,6 @@ public class MainFrame extends JFrame {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dragEnter(final DropTargetDragEvent dtde) {
|
||||
dragEnterTimer = TunedUtilities.invokeLater(SELECTDELAY_ON_DRAG_OVER, new Runnable() {
|
||||
|
@ -206,7 +195,6 @@ public class MainFrame extends JFrame {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dragExit(DropTargetEvent dte) {
|
||||
selectEnabled = false;
|
||||
|
@ -216,7 +204,6 @@ public class MainFrame extends JFrame {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void drop(DropTargetDropEvent dtde) {
|
||||
|
||||
|
@ -226,7 +213,6 @@ public class MainFrame extends JFrame {
|
|||
|
||||
}
|
||||
|
||||
|
||||
private static class PanelCellRenderer extends DefaultFancyListCellRenderer {
|
||||
|
||||
public PanelCellRenderer() {
|
||||
|
@ -241,7 +227,6 @@ public class MainFrame extends JFrame {
|
|||
setHorizontalTextPosition(SwingConstants.CENTER);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void configureListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||
super.configureListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||
|
|
|
@ -225,7 +225,7 @@ public class FormatDialog extends JDialog {
|
|||
|
||||
// initialize window properties
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
setSize(610, 430);
|
||||
setSize(620, 445);
|
||||
|
||||
// initialize data
|
||||
setState(initMode, lockOnBinding != null ? lockOnBinding : restoreSample(initMode), lockOnBinding != null);
|
||||
|
|
Loading…
Reference in New Issue