mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-12 02:54:10 +00:00
Added: Option to enter custom zoom level by clicking on zoom percentage label
This commit is contained in:
@@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file.
|
||||
- [#2370] Setting for color and snap accuracy for guides, grid
|
||||
- [#2370] Dialogs for editing grid, guides and snapping
|
||||
- [#2453] SVG export/import - use image-rendering attribute for image smoothing
|
||||
- Option to enter custom zoom level by clicking on zoom percentage label
|
||||
|
||||
### Fixed
|
||||
- [#2424] DefineEditText handling of letterSpacing, font size on incorrect values
|
||||
|
||||
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoom16.png
Normal file
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoom16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 784 B |
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoom32.png
Normal file
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoom32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoomfit32.png
Normal file
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoomfit32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoomin32.png
Normal file
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoomin32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoomnone32.png
Normal file
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoomnone32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoomout32.png
Normal file
BIN
src/com/jpexs/decompiler/flash/gui/graphics/zoomout32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -1044,4 +1044,8 @@ grid_options.show_grid = Show grid
|
||||
grid_options.edit = Edit grid...
|
||||
|
||||
move_guide = Move guide
|
||||
move_guide.position = Position:
|
||||
move_guide.position = Position:
|
||||
|
||||
zoom = Zoom
|
||||
zoom.hint = Zoom level. Click to change.
|
||||
zoom.enter = Enter zoom percentage value:
|
||||
|
||||
@@ -18,14 +18,18 @@ package com.jpexs.decompiler.flash.gui.player;
|
||||
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.configuration.ConfigurationItemChangeListener;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaNumberToString;
|
||||
import com.jpexs.decompiler.flash.gui.AppStrings;
|
||||
import com.jpexs.decompiler.flash.gui.GridDialog;
|
||||
import com.jpexs.decompiler.flash.gui.GuidesDialog;
|
||||
import com.jpexs.decompiler.flash.gui.Main;
|
||||
import com.jpexs.decompiler.flash.gui.PopupButton;
|
||||
import com.jpexs.decompiler.flash.gui.View;
|
||||
import com.jpexs.decompiler.flash.gui.ViewMessages;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Objects;
|
||||
@@ -129,6 +133,30 @@ public class ZoomPanel extends JPanel implements MediaDisplayListener {
|
||||
};
|
||||
gridButton.setToolTipText(AppStrings.translate("button.grid_options"));
|
||||
|
||||
|
||||
percentLabel.setToolTipText(AppStrings.translate("zoom.hint"));
|
||||
percentLabel.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
double currentZoom = roundZoom(getRealZoom() * 100, 3);
|
||||
String newZoomStr = ViewMessages.showInputDialog(ZoomPanel.this, AppStrings.translate("zoom.enter"), AppStrings.translate("zoom"), View.getIcon("zoom32"), EcmaNumberToString.stringFor(currentZoom));
|
||||
if (newZoomStr != null) {
|
||||
try {
|
||||
double newZoom = Double.parseDouble(newZoomStr) / 100;
|
||||
if (newZoom <= 0) {
|
||||
return;
|
||||
}
|
||||
realZoom = newZoom;
|
||||
zoomToFit = false;
|
||||
updateZoom();
|
||||
} catch (NumberFormatException nfe) {
|
||||
//ignore
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setLayout(new FlowLayout());
|
||||
add(percentLabel);
|
||||
add(zoomInButton);
|
||||
|
||||
Reference in New Issue
Block a user