diff --git a/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java index 194de9ee3..2a3d1f864 100644 --- a/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -184,7 +184,15 @@ public class Configuration { public static final ConfigurationItem saveAsExeScaleMode = null; @ConfigurationDefaultInt(1024 * 100/*100KB*/) public static final ConfigurationItem syntaxHighlightLimit = null; - public static final ConfigurationItem fontPreviewSampleText = null; + public static final ConfigurationItem guiFontPreviewSampleText = null; + @ConfigurationName("gui.fontPreviewWindow.width") + public static final ConfigurationItem guiFontPreviewWidth = null; + @ConfigurationName("gui.fontPreviewWindow.height") + public static final ConfigurationItem guiFontPreviewHeight = null; + @ConfigurationName("gui.fontPreviewWindow.posX") + public static final ConfigurationItem guiFontPreviewPosX = null; + @ConfigurationName("gui.fontPreviewWindow.posY") + public static final ConfigurationItem guiFontPreviewPosY = null; private enum OSId { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/FontPreviewDialog.form b/trunk/src/com/jpexs/decompiler/flash/gui/FontPreviewDialog.form index 0426ab50e..a9dca8ca0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/FontPreviewDialog.form +++ b/trunk/src/com/jpexs/decompiler/flash/gui/FontPreviewDialog.form @@ -3,11 +3,18 @@
+ + + + + + + diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/FontPreviewDialog.java b/trunk/src/com/jpexs/decompiler/flash/gui/FontPreviewDialog.java index 44d15e3ce..726df101b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/FontPreviewDialog.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/FontPreviewDialog.java @@ -39,7 +39,17 @@ public class FontPreviewDialog extends AppDialog { labelSample48.setFont(font.deriveFont(Font.PLAIN, 48)); labelSample60.setFont(font.deriveFont(Font.PLAIN, 60)); labelSample72.setFont(font.deriveFont(Font.PLAIN, 72)); - comboBoxSampleTexts.setSelectedIndex(Configuration.fontPreviewSampleText.get(0)); + comboBoxSampleTexts.setSelectedIndex(Configuration.guiFontPreviewSampleText.get(0)); + if (Configuration.guiFontPreviewWidth.hasValue()) { + int width = Configuration.guiFontPreviewWidth.get(); + int height = Configuration.guiFontPreviewHeight.get(); + setSize(width, height); + } + if (Configuration.guiFontPreviewPosX.hasValue()) { + int posX = Configuration.guiFontPreviewPosX.get(); + int posY = Configuration.guiFontPreviewPosY.get(); + setLocation(posX, posY); + } setText((String) comboBoxSampleTexts.getSelectedItem()); labelFontName.setText(font.getFontName()); } @@ -84,6 +94,15 @@ public class FontPreviewDialog extends AppDialog { labelFontName = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setPreferredSize(new java.awt.Dimension(1024, 512)); + addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentMoved(java.awt.event.ComponentEvent evt) { + formComponentMoved(evt); + } + public void componentResized(java.awt.event.ComponentEvent evt) { + formComponentResized(evt); + } + }); labelSample72.setFont(new java.awt.Font("Tahoma", 0, 72)); // NOI18N labelSample72.setText("---"); @@ -226,10 +245,20 @@ public class FontPreviewDialog extends AppDialog { }// //GEN-END:initComponents private void comboBoxSampleTextsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_comboBoxSampleTextsItemStateChanged - Configuration.fontPreviewSampleText.set(comboBoxSampleTexts.getSelectedIndex()); + Configuration.guiFontPreviewSampleText.set(comboBoxSampleTexts.getSelectedIndex()); setText((String) comboBoxSampleTexts.getSelectedItem()); }//GEN-LAST:event_comboBoxSampleTextsItemStateChanged + private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized + Configuration.guiFontPreviewWidth.set(getWidth()); + Configuration.guiFontPreviewHeight.set(getHeight()); + }//GEN-LAST:event_formComponentResized + + private void formComponentMoved(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentMoved + Configuration.guiFontPreviewPosX.set(getX()); + Configuration.guiFontPreviewPosY.set(getY()); + }//GEN-LAST:event_formComponentMoved + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JComboBox comboBoxSampleTexts; private javax.swing.JLabel jLabel1;