diff --git a/source/net/filebot/ui/AbstractSearchPanel.java b/source/net/filebot/ui/AbstractSearchPanel.java index 1a833f61..c2acadd4 100644 --- a/source/net/filebot/ui/AbstractSearchPanel.java +++ b/source/net/filebot/ui/AbstractSearchPanel.java @@ -65,8 +65,8 @@ public abstract class AbstractSearchPanel extends JComponent { tabbedPaneGroup.add(tabbedPane, "grow, wrap"); setLayout(new MigLayout("nogrid, novisualpadding, fill, insets 10px 10px 15px 10px", "align 45%", "[pref!]10px[fill]")); - add(searchTextField); - add(new JButton(searchAction), "gap 16px, h 2+pref!, id search, sgy button"); + add(searchTextField, "gap 0px:push"); + add(new JButton(searchAction), "gap 16px, gap after 0px:push, h 2+pref!, id search, sgy button"); add(tabbedPaneGroup, "newline, grow"); searchTextField.getEditor().setAction(searchAction); diff --git a/source/net/filebot/ui/subtitle/SubtitleDropTarget.java b/source/net/filebot/ui/subtitle/SubtitleDropTarget.java index 1c3f91e2..e2fefeb8 100644 --- a/source/net/filebot/ui/subtitle/SubtitleDropTarget.java +++ b/source/net/filebot/ui/subtitle/SubtitleDropTarget.java @@ -10,6 +10,10 @@ import static net.filebot.util.ui.SwingUI.*; import java.awt.Color; import java.awt.Cursor; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.Shape; import java.awt.dnd.DnDConstants; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetAdapter; @@ -18,6 +22,7 @@ import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.geom.Ellipse2D; import java.io.File; import java.util.Collection; import java.util.LinkedHashMap; @@ -37,6 +42,7 @@ import net.filebot.ResourceManager; import net.filebot.platform.mac.MacAppUtilities; import net.filebot.ui.subtitle.upload.SubtitleUploadDialog; import net.filebot.util.FileUtilities; +import net.filebot.util.FileUtilities.ExtensionFileFilter; import net.filebot.util.FileUtilities.ParentFilter; import net.filebot.web.OpenSubtitlesClient; import net.filebot.web.SubtitleProvider; @@ -52,12 +58,10 @@ abstract class SubtitleDropTarget extends JButton { setHorizontalAlignment(CENTER); setHideActionText(true); - setBorderPainted(false); setContentAreaFilled(false); setFocusPainted(false); - + setBorderPainted(false); setBackground(Color.white); - setOpaque(false); // initialize with default mode setDropAction(DropAction.Accept); @@ -70,6 +74,28 @@ abstract class SubtitleDropTarget extends JButton { new DropTarget(this, dropHandler); } + private Color lineColor = new Color(0xD7D7D7); + + @Override + protected void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + + float w = getWidth(); + float h = getHeight(); + float d = Math.min(w, h) - 1f; + + Shape shape = new Ellipse2D.Float((w - d) / 2, (h - d) / 2, d - 1, d - 1); + + g2d.setColor(getBackground()); + g2d.fill(shape); + + g2d.setColor(lineColor); + g2d.draw(shape); + + super.paintComponent(g2d); + } + protected void setDropAction(DropAction dropAction) { setIcon(getIcon(dropAction)); } diff --git a/source/net/filebot/ui/subtitle/SubtitlePanel.java b/source/net/filebot/ui/subtitle/SubtitlePanel.java index 14029eb5..a7a73907 100644 --- a/source/net/filebot/ui/subtitle/SubtitlePanel.java +++ b/source/net/filebot/ui/subtitle/SubtitlePanel.java @@ -6,15 +6,10 @@ import static net.filebot.ui.LanguageComboBoxModel.*; import static net.filebot.util.FileUtilities.*; import static net.filebot.util.ui.SwingUI.*; -import java.awt.Color; import java.awt.Cursor; import java.awt.Dialog.ModalityType; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.RenderingHints; import java.awt.datatransfer.Transferable; import java.awt.event.ActionEvent; -import java.awt.geom.Path2D; import java.io.File; import java.net.URI; import java.util.ArrayList; @@ -76,8 +71,8 @@ public class SubtitlePanel extends AbstractSearchPanel