1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 16:28:51 -05:00

Fix MAS review issue:

The user interface of your app is not consistent with the macOS Human Interface Guidelines. Specifically:

We found that menu items are not visible, except by right-clicking (see screenshot). See the "WYSIWYG (What You See Is What You Get)," "Give Users Alternate Ways to Accomplish Tasks," and "Designing Contextual Menus" sections of the Human Interface Guidelines.
This commit is contained in:
Reinhard Pointner 2018-04-17 17:32:22 +07:00
parent 7f09ea696c
commit eb7310f095
2 changed files with 41 additions and 33 deletions

View File

@ -1,5 +1,6 @@
package net.filebot.ui.episodelist; package net.filebot.ui.episodelist;
import static net.filebot.Settings.*;
import static net.filebot.ui.episodelist.SeasonSpinnerModel.*; import static net.filebot.ui.episodelist.SeasonSpinnerModel.*;
import static net.filebot.util.ui.SwingUI.*; import static net.filebot.util.ui.SwingUI.*;
import static net.filebot.web.EpisodeUtilities.*; import static net.filebot.web.EpisodeUtilities.*;
@ -244,28 +245,31 @@ public class EpisodeListPanel extends AbstractSearchPanel<EpisodeListProvider, E
listScrollPane.setBorder(null); listScrollPane.setBorder(null);
setBorder(null); setBorder(null);
// popup menu // XXX The user interface of your app is not consistent with the macOS Human Interface Guidelines. Specifically: We found that menu items are not visible, except by right-clicking (see screenshot). See the "WYSIWYG (What You See Is What You Get)," "Give Users
JPopupMenu popup = new JPopupMenu("Episodes"); // Alternate Ways to Accomplish Tasks," and "Designing Contextual Menus" sections of the Human Interface Guidelines.
if (!isMacSandbox()) {
JPopupMenu popup = new JPopupMenu("Episodes");
JMenu menu = new JMenu("Send to"); JMenu menu = new JMenu("Send to");
for (PanelBuilder panel : PanelBuilder.episodeHandlerSequence()) { for (PanelBuilder panel : PanelBuilder.episodeHandlerSequence()) {
menu.add(newAction(panel.getName(), panel.getIcon(), evt -> { menu.add(newAction(panel.getName(), panel.getIcon(), evt -> {
// switch to Rename panel // switch to Rename panel
SwingEventBus.getInstance().post(panel); SwingEventBus.getInstance().post(panel);
// load episode data // load episode data
invokeLater(200, () -> SwingEventBus.getInstance().post(exportHandler.export(this, false))); invokeLater(200, () -> SwingEventBus.getInstance().post(exportHandler.export(this, false)));
}));
}
popup.add(menu);
popup.addSeparator();
popup.add(newAction("Copy", ResourceManager.getIcon("rename.action.copy"), evt -> {
getTransferHandler().getClipboardHandler().exportToClipboard(this, Toolkit.getDefaultToolkit().getSystemClipboard(), TransferHandler.COPY);
})); }));
popup.add(new SaveAction(getExportHandler()));
getListComponent().setComponentPopupMenu(popup);
} }
popup.add(menu);
popup.addSeparator();
popup.add(newAction("Copy", ResourceManager.getIcon("rename.action.copy"), evt -> {
getTransferHandler().getClipboardHandler().exportToClipboard(this, Toolkit.getDefaultToolkit().getSystemClipboard(), TransferHandler.COPY);
}));
popup.add(new SaveAction(getExportHandler()));
getListComponent().setComponentPopupMenu(popup);
} }
} }

View File

@ -3,6 +3,7 @@ package net.filebot.ui.list;
import static java.awt.Font.*; import static java.awt.Font.*;
import static java.util.stream.Collectors.*; import static java.util.stream.Collectors.*;
import static javax.swing.BorderFactory.*; import static javax.swing.BorderFactory.*;
import static net.filebot.Settings.*;
import static net.filebot.util.ui.SwingUI.*; import static net.filebot.util.ui.SwingUI.*;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -77,23 +78,26 @@ public class ListPanel extends JComponent {
list.setExportHandler(exportHandler); list.setExportHandler(exportHandler);
list.getTransferHandler().setClipboardHandler(exportHandler); list.getTransferHandler().setClipboardHandler(exportHandler);
// context menu // XXX The user interface of your app is not consistent with the macOS Human Interface Guidelines. Specifically: We found that menu items are not visible, except by right-clicking (see screenshot). See the "WYSIWYG (What You See Is What You Get)," "Give Users
JPopupMenu popup = new JPopupMenu("List"); // Alternate Ways to Accomplish Tasks," and "Designing Contextual Menus" sections of the Human Interface Guidelines.
JMenu menu = new JMenu("Send to"); if (!isMacSandbox()) {
for (PanelBuilder panel : PanelBuilder.textHandlerSequence()) { JPopupMenu popup = new JPopupMenu("List");
menu.add(newAction(panel.getName(), panel.getIcon(), evt -> { JMenu menu = new JMenu("Send to");
String text = list.getExportHandler().export(); for (PanelBuilder panel : PanelBuilder.textHandlerSequence()) {
SwingEventBus.getInstance().post(panel); menu.add(newAction(panel.getName(), panel.getIcon(), evt -> {
invokeLater(200, () -> SwingEventBus.getInstance().post(new StringSelection(text))); String text = list.getExportHandler().export();
SwingEventBus.getInstance().post(panel);
invokeLater(200, () -> SwingEventBus.getInstance().post(new StringSelection(text)));
}));
}
popup.add(menu);
popup.addSeparator();
popup.add(newAction("Copy", ResourceManager.getIcon("rename.action.copy"), evt -> {
list.getTransferHandler().getClipboardHandler().exportToClipboard(this, Toolkit.getDefaultToolkit().getSystemClipboard(), TransferHandler.COPY);
})); }));
popup.add(new SaveAction(list.getExportHandler()));
list.getListComponent().setComponentPopupMenu(popup);
} }
popup.add(menu);
popup.addSeparator();
popup.add(newAction("Copy", ResourceManager.getIcon("rename.action.copy"), evt -> {
list.getTransferHandler().getClipboardHandler().exportToClipboard(this, Toolkit.getDefaultToolkit().getSystemClipboard(), TransferHandler.COPY);
}));
popup.add(new SaveAction(list.getExportHandler()));
list.getListComponent().setComponentPopupMenu(popup);
// cell renderer // cell renderer
list.getListComponent().setCellRenderer(new DefaultFancyListCellRenderer() { list.getListComponent().setCellRenderer(new DefaultFancyListCellRenderer() {