Disable switching when font info is edited

This commit is contained in:
Jindra Petřík
2022-12-04 10:05:16 +01:00
parent 486898b162
commit 179065f885
2 changed files with 7 additions and 1 deletions

View File

@@ -81,6 +81,7 @@ public class FontPanel extends JPanel {
public FontPanel(MainPanel mainPanel) {
this.mainPanel = mainPanel;
initComponents();
setEditable(false);
}
public FontTag getFontTag() {
@@ -109,6 +110,10 @@ public class FontPanel extends JPanel {
return new DefaultComboBoxModel<>(new Vector<>(faceSet));
}
public boolean isEditing() {
return buttonSave.isVisible() && buttonSave.isEnabled();
}
private void setEditable(boolean editable) {
if (editable) {
buttonEdit.setVisible(false);