This commit is contained in:
parent
2d30683436
commit
31800fb2da
4 changed files with 66 additions and 6 deletions
|
@ -30,6 +30,7 @@ import tihwin.ul.UlMaker;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.Border;
|
import javax.swing.border.Border;
|
||||||
|
import javax.swing.border.LineBorder;
|
||||||
import javax.swing.text.AbstractDocument;
|
import javax.swing.text.AbstractDocument;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
|
@ -87,12 +88,16 @@ public class MainAppUi extends JFrame {
|
||||||
recentRomLocation = Settings.INSTANCE.getRomLocation();
|
recentRomLocation = Settings.INSTANCE.getRomLocation();
|
||||||
destinationDirectoryLbl.setText(FilesHelper.getRealFolder(Settings.INSTANCE.getDestination()));
|
destinationDirectoryLbl.setText(FilesHelper.getRealFolder(Settings.INSTANCE.getDestination()));
|
||||||
addWindowListener(getWindowListener());
|
addWindowListener(getWindowListener());
|
||||||
|
|
||||||
Border fitMoreTextOnButtonBorder = BorderFactory.createCompoundBorder(
|
Border fitMoreTextOnButtonBorder = BorderFactory.createCompoundBorder(
|
||||||
BorderFactory.createLineBorder(Color.lightGray),
|
BorderFactory.createLineBorder(Color.gray),
|
||||||
BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||||
diskImageSelectBtn.setBorder(fitMoreTextOnButtonBorder);
|
diskImageSelectBtn.setBorder(fitMoreTextOnButtonBorder);
|
||||||
destinationSelectBtn.setBorder(fitMoreTextOnButtonBorder);
|
destinationSelectBtn.setBorder(fitMoreTextOnButtonBorder);
|
||||||
|
diskImageSelectBtn.addMouseListener(new TwButtonsActionListener());
|
||||||
|
destinationSelectBtn.addMouseListener(new TwButtonsActionListener());
|
||||||
|
|
||||||
|
titleField.setBorder(new LineBorder(Color.lightGray));
|
||||||
}
|
}
|
||||||
|
|
||||||
private WindowListener getWindowListener() {
|
private WindowListener getWindowListener() {
|
||||||
|
|
|
@ -24,7 +24,6 @@ import tihwin.ui.model.LocaleHolder;
|
||||||
import tihwin.ui.model.SettingsLanguagesSetup;
|
import tihwin.ui.model.SettingsLanguagesSetup;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.plaf.basic.BasicArrowButton;
|
|
||||||
import javax.swing.plaf.basic.BasicComboBoxUI;
|
import javax.swing.plaf.basic.BasicComboBoxUI;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -41,9 +40,8 @@ public class LanguageComboBox extends JComboBox<LocaleHolder> {
|
||||||
setUI(new BasicComboBoxUI(){
|
setUI(new BasicComboBoxUI(){
|
||||||
@Override
|
@Override
|
||||||
protected JButton createArrowButton() {
|
protected JButton createArrowButton() {
|
||||||
BasicArrowButton button = new BasicArrowButton(BasicArrowButton.SOUTH,
|
JButton button = new JButton();
|
||||||
COLOR_SKY_BLUE, COLOR_SKY_BLUE, Color.white, COLOR_SKY_BLUE);
|
button.setBackground(COLOR_SKY_BLUE);
|
||||||
|
|
||||||
button.setBorder(BorderFactory.createEmptyBorder());
|
button.setBorder(BorderFactory.createEmptyBorder());
|
||||||
button.setVisible(false);
|
button.setVisible(false);
|
||||||
return button;
|
return button;
|
||||||
|
|
57
src/main/java/tihwin/ui/TwButtonsActionListener.java
Normal file
57
src/main/java/tihwin/ui/TwButtonsActionListener.java
Normal file
|
@ -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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
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) {}
|
||||||
|
|
||||||
|
}
|
|
@ -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
|
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
|
InterruptedText=\u041F\u0440\u0435\u0440\u0432\u0430\u043D\u043E
|
||||||
isoFilesText=\u0424\u0430\u0439\u043B\u044B ISO
|
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
|
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
|
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
|
SetDestinationDirectoryText=\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u0430\u043F\u043A\u0443 \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F
|
||||||
|
|
Loading…
Reference in a new issue