diff --git a/src/main/java/tihwin/MainAppUi.java b/src/main/java/tihwin/MainAppUi.java index e91a71f..6499c5b 100644 --- a/src/main/java/tihwin/MainAppUi.java +++ b/src/main/java/tihwin/MainAppUi.java @@ -30,6 +30,7 @@ import tihwin.ul.UlMaker; import javax.swing.*; import javax.swing.border.Border; +import javax.swing.border.LineBorder; import javax.swing.text.AbstractDocument; import java.awt.*; import java.awt.event.WindowEvent; @@ -87,12 +88,16 @@ public class MainAppUi extends JFrame { recentRomLocation = Settings.INSTANCE.getRomLocation(); destinationDirectoryLbl.setText(FilesHelper.getRealFolder(Settings.INSTANCE.getDestination())); addWindowListener(getWindowListener()); + Border fitMoreTextOnButtonBorder = BorderFactory.createCompoundBorder( - BorderFactory.createLineBorder(Color.lightGray), + BorderFactory.createLineBorder(Color.gray), BorderFactory.createEmptyBorder(5, 5, 5, 5)); diskImageSelectBtn.setBorder(fitMoreTextOnButtonBorder); destinationSelectBtn.setBorder(fitMoreTextOnButtonBorder); + diskImageSelectBtn.addMouseListener(new TwButtonsActionListener()); + destinationSelectBtn.addMouseListener(new TwButtonsActionListener()); + titleField.setBorder(new LineBorder(Color.lightGray)); } private WindowListener getWindowListener() { diff --git a/src/main/java/tihwin/ui/LanguageComboBox.java b/src/main/java/tihwin/ui/LanguageComboBox.java index cc47bb3..2726ba5 100644 --- a/src/main/java/tihwin/ui/LanguageComboBox.java +++ b/src/main/java/tihwin/ui/LanguageComboBox.java @@ -24,7 +24,6 @@ import tihwin.ui.model.LocaleHolder; import tihwin.ui.model.SettingsLanguagesSetup; import javax.swing.*; -import javax.swing.plaf.basic.BasicArrowButton; import javax.swing.plaf.basic.BasicComboBoxUI; import java.awt.*; import java.util.List; @@ -41,9 +40,8 @@ public class LanguageComboBox extends JComboBox { setUI(new BasicComboBoxUI(){ @Override protected JButton createArrowButton() { - BasicArrowButton button = new BasicArrowButton(BasicArrowButton.SOUTH, - COLOR_SKY_BLUE, COLOR_SKY_BLUE, Color.white, COLOR_SKY_BLUE); - + JButton button = new JButton(); + button.setBackground(COLOR_SKY_BLUE); button.setBorder(BorderFactory.createEmptyBorder()); button.setVisible(false); return button; diff --git a/src/main/java/tihwin/ui/TwButtonsActionListener.java b/src/main/java/tihwin/ui/TwButtonsActionListener.java new file mode 100644 index 0000000..758334d --- /dev/null +++ b/src/main/java/tihwin/ui/TwButtonsActionListener.java @@ -0,0 +1,57 @@ +/* + Copyright 2022 Dmitry Isaenko + + This file is part of Tihwin. + + Tihwin is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Tihwin is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Tihwin. If not, see . + */ +package tihwin.ui; + +import javax.swing.*; +import javax.swing.border.Border; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +public class TwButtonsActionListener implements MouseListener { + private final Border normalBorder = BorderFactory.createCompoundBorder( + BorderFactory.createLineBorder(Color.gray), + BorderFactory.createEmptyBorder(5, 5, 5, 5)); + + private final Border boldBorder = BorderFactory.createCompoundBorder( + BorderFactory.createLineBorder(Color.gray), + BorderFactory.createCompoundBorder( + BorderFactory.createLineBorder(new Color(164, 181, 255)), + BorderFactory.createEmptyBorder(4, 4, 4, 4) + ) + ); + + @Override + public void mouseEntered(MouseEvent mouseEvent) { + ((JButton) mouseEvent.getSource()).setBorder(boldBorder); + } + + @Override + public void mouseExited(MouseEvent mouseEvent) { + ((JButton) mouseEvent.getSource()).setBorder(normalBorder); + } + + @Override + public void mouseClicked(MouseEvent mouseEvent) {} + @Override + public void mousePressed(MouseEvent mouseEvent) {} + @Override + public void mouseReleased(MouseEvent mouseEvent) {} + +} diff --git a/src/main/resources/locale_ru_RU.properties b/src/main/resources/locale_ru_RU.properties index 3fa85af..77ac1ff 100644 --- a/src/main/resources/locale_ru_RU.properties +++ b/src/main/resources/locale_ru_RU.properties @@ -8,7 +8,7 @@ InterruptedAndFilesDeletedText=\u0417\u0430\u0434\u0430\u0447\u0430 \u043F\u0440 InterruptedAndFilesNotDeletedText=\u0417\u0430\u0434\u0430\u0447\u0430 \u043F\u0440\u0435\u0440\u0432\u0430\u043D\u0430 \u0438 \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442\u044B \u0444\u0430\u0439\u043B\u0430 \u041D\u0415 \u0443\u0434\u0430\u043B\u0435\u043D\u044B InterruptedText=\u041F\u0440\u0435\u0440\u0432\u0430\u043D\u043E isoFilesText=\u0424\u0430\u0439\u043B\u044B ISO -WelcomeText=\u041F\u0440\u0438\u0432\u0435\u0442! \u042D\u0442\u043E Tihwin - ul-\u0443\u0442\u0438\u043B\u0438\u0442\u0430 \u0434\u043B\u044F \u0432\u0430\u0448\u0435\u0439 PS2! GPLv3+, 2022, \u0414\u043C\u0438\u0442\u0440\u0438\u0439 \u0418\u0441\u0430\u0435\u043D\u043A\u043E +WelcomeText=\u041F\u0440\u0438\u0432\u0435\u0442! \u042D\u0442\u043E Tihwin \u2212 ul-\u0443\u0442\u0438\u043B\u0438\u0442\u0430 \u0434\u043B\u044F \u0432\u0430\u0448\u0435\u0439 PS2! GPLv3+, 2022, \u0414\u043C\u0438\u0442\u0440\u0438\u0439 \u0418\u0441\u0430\u0435\u043D\u043A\u043E SelectBtn=\u0412\u044B\u0431\u0440\u0430\u0442\u044C SelectDiskImageText=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0431\u0440\u0430\u0437 \u0434\u0438\u0441\u043A\u0430 SetDestinationDirectoryText=\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u0430\u043F\u043A\u0443 \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F