diff --git a/CHANGELOG.md b/CHANGELOG.md index 28490baa81..d8565b4981 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - **BUGFIX:** Im "Neues Abo anlegen"-Dialog werden Textfelder im Dark Mode nicht mehr weiß hinterlegt. - **FEATURE(Linux/Windows):** Das Aussehen von FlatLaf kann in `.mediathek3/flatlaf` angepasst werden. - **FEATURE:** Selektierte Einträge in `Suchhistorie bearbeiten`-Dialog können nun mittels Entfernen-Taste gelöscht werden. +- **FEATURE:** Das Blacklist Filter-Icon in der Toolbar kann mittels *Einstellungen/Allgemein* mit einem aussagefähigen Zusatztext dargestellt werden. # **14.1.0** - JDK 21 wird nun mitgeliefert. Behebt primär Darstellungsfehler von Java Apps unter Windows. diff --git a/src/main/java/mediathek/gui/dialogEinstellungen/allgemein/PanelEinstellungen.java b/src/main/java/mediathek/gui/dialogEinstellungen/allgemein/PanelEinstellungen.java index 962b718c24..3eb2028379 100644 --- a/src/main/java/mediathek/gui/dialogEinstellungen/allgemein/PanelEinstellungen.java +++ b/src/main/java/mediathek/gui/dialogEinstellungen/allgemein/PanelEinstellungen.java @@ -15,7 +15,6 @@ import org.apache.commons.configuration2.Configuration; import org.apache.commons.lang3.SystemUtils; import org.jdesktop.swingx.JXTitledPanel; -import org.jdesktop.swingx.VerticalLayout; import javax.swing.*; import javax.swing.border.TitledBorder; @@ -153,6 +152,14 @@ public PanelEinstellungen() { ApplicationConfiguration.getConfiguration().setProperty(CellRendererBaseWithStart.ICON_POSITION_RIGHT, cbDrawListIconsRight.isSelected()); MediathekGui.ui().repaint(); }); + + boolean useIconWithText = ApplicationConfiguration.getConfiguration() + .getBoolean(ApplicationConfiguration.TOOLBAR_BLACKLIST_ICON_WITH_TEXT, false); + cbShowBlacklistIconWithText.setSelected(useIconWithText); + cbShowBlacklistIconWithText.addActionListener(l -> { + var useText = cbShowBlacklistIconWithText.isSelected(); + ApplicationConfiguration.getConfiguration().setProperty(ApplicationConfiguration.TOOLBAR_BLACKLIST_ICON_WITH_TEXT, useText); + }); } private static final String NO_INFLUENCE_TEXT = "Einstellung hat unter macOS keine Auswirkung"; @@ -209,6 +216,7 @@ private void initComponents() { jpfProxyPassword = new JPasswordField(); var panel1 = new JPanel(); jCheckBoxTray = new JCheckBox(); + cbShowBlacklistIconWithText = new JCheckBox(); cbUseWikipediaSenderLogos = new JCheckBox(); cbAutomaticUpdateChecks = new JCheckBox(); cbDrawListIconsRight = new JCheckBox(); @@ -349,23 +357,39 @@ private void initComponents() { //======== panel1 ======== { - panel1.setLayout(new VerticalLayout()); + panel1.setLayout(new MigLayout( + new LC().insets("0").hideMode(3).gridGap("5", "0"), //NON-NLS + // columns + new AC() + .grow().align("left").gap() //NON-NLS + .fill(), + // rows + new AC() + .fill().gap() + .fill().gap() + .fill().gap() + .fill())); //---- jCheckBoxTray ---- jCheckBoxTray.setText("Programm ins Tray minimieren"); //NON-NLS - panel1.add(jCheckBoxTray); + panel1.add(jCheckBoxTray, new CC().cell(0, 0)); + + //---- cbShowBlacklistIconWithText ---- + cbShowBlacklistIconWithText.setText("Blacklist-Filter-Icon mit Text anzeigen"); //NON-NLS + cbShowBlacklistIconWithText.setToolTipText("Neustart erforderlich"); //NON-NLS + panel1.add(cbShowBlacklistIconWithText, new CC().cell(1, 0)); //---- cbUseWikipediaSenderLogos ---- cbUseWikipediaSenderLogos.setText("Senderlogos von Wikipedia verwenden"); //NON-NLS - panel1.add(cbUseWikipediaSenderLogos); + panel1.add(cbUseWikipediaSenderLogos, new CC().cell(0, 1)); //---- cbAutomaticUpdateChecks ---- cbAutomaticUpdateChecks.setText("Programmupdates t\u00e4glich suchen"); //NON-NLS - panel1.add(cbAutomaticUpdateChecks); + panel1.add(cbAutomaticUpdateChecks, new CC().cell(0, 2)); //---- cbDrawListIconsRight ---- cbDrawListIconsRight.setText("Info-Icons der Listen rechts darstellen"); //NON-NLS - panel1.add(cbDrawListIconsRight); + panel1.add(cbDrawListIconsRight, new CC().cell(0, 3)); } //---- modernSearchTitlePanel ---- @@ -416,6 +440,7 @@ private void initComponents() { private JTextField jtfProxyUser; private JPasswordField jpfProxyPassword; private JCheckBox jCheckBoxTray; + private JCheckBox cbShowBlacklistIconWithText; private JCheckBox cbUseWikipediaSenderLogos; private JCheckBox cbAutomaticUpdateChecks; private JCheckBox cbDrawListIconsRight; diff --git a/src/main/java/mediathek/gui/dialogEinstellungen/allgemein/PanelEinstellungen.jfd b/src/main/java/mediathek/gui/dialogEinstellungen/allgemein/PanelEinstellungen.jfd index fc48d3e4af..d01e2cc5db 100644 --- a/src/main/java/mediathek/gui/dialogEinstellungen/allgemein/PanelEinstellungen.jfd +++ b/src/main/java/mediathek/gui/dialogEinstellungen/allgemein/PanelEinstellungen.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "8.1.1.0.298" Java: "17.0.7" encoding: "UTF-8" +JFDML JFormDesigner: "8.2.4.0.393" Java: "21.0.3" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -119,7 +119,11 @@ new FormModel { name: "jpfProxyPassword" } ) } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class org.jdesktop.swingx.VerticalLayout ) ) { + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3,gap 5 0" + "$columnConstraints": "[grow,left][fill]" + "$rowConstraints": "[fill][fill][fill][fill]" + } ) { name: "panel1" auxiliary() { "JavaCodeGenerator.variableLocal": true @@ -127,18 +131,33 @@ new FormModel { add( new FormComponent( "javax.swing.JCheckBox" ) { name: "jCheckBoxTray" "text": "Programm ins Tray minimieren" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "cbShowBlacklistIconWithText" + "text": "Blacklist-Filter-Icon mit Text anzeigen" + "toolTipText": "Neustart erforderlich" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "cbUseWikipediaSenderLogos" "text": "Senderlogos von Wikipedia verwenden" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "cbAutomaticUpdateChecks" "text": "Programmupdates täglich suchen" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "cbDrawListIconsRight" "text": "Info-Icons der Listen rechts darstellen" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" } ) } ) add( new FormComponent( "org.jdesktop.swingx.JXTitledPanel" ) { diff --git a/src/main/java/mediathek/mainwindow/MediathekGui.java b/src/main/java/mediathek/mainwindow/MediathekGui.java index f38ee269e9..e185414fbe 100644 --- a/src/main/java/mediathek/mainwindow/MediathekGui.java +++ b/src/main/java/mediathek/mainwindow/MediathekGui.java @@ -362,10 +362,21 @@ protected void installToolBar() { tabbedPane.putClientProperty("JTabbedPane.tabRotation", "auto"); } + protected void createToggleBlacklistButton() { + boolean useIconWithText = ApplicationConfiguration.getConfiguration() + .getBoolean(ApplicationConfiguration.TOOLBAR_BLACKLIST_ICON_WITH_TEXT, false); + if (useIconWithText) { + commonToolBar.add(new JButton(toggleBlacklistAction)); + } + else { + commonToolBar.add(toggleBlacklistAction); + } + } + protected void createCommonToolBar() { commonToolBar.add(loadFilmListAction); commonToolBar.add(showFilmInformationAction); - commonToolBar.add(toggleBlacklistAction); + createToggleBlacklistButton(); commonToolBar.addSeparator(); commonToolBar.add(editBlacklistAction); commonToolBar.add(manageAboAction); diff --git a/src/main/java/mediathek/tool/ApplicationConfiguration.java b/src/main/java/mediathek/tool/ApplicationConfiguration.java index 78b06001f8..4a7a8b08e2 100644 --- a/src/main/java/mediathek/tool/ApplicationConfiguration.java +++ b/src/main/java/mediathek/tool/ApplicationConfiguration.java @@ -26,6 +26,8 @@ * The global application configuration class. This will contain all the config data in the future. */ public class ApplicationConfiguration { + public static final String TOOLBAR_BLACKLIST_ICON_WITH_TEXT = "toolbar.blacklist_icon.text"; + public static final String APPLICATION_DARK_MODE = "application.dark_mode"; public static final String APPLICATION_USER_AGENT = "application.user_agent"; public static final String APPLICATION_USE_MODERN_SEARCH = "application.use.modern_search";