better wheel scrolling
This commit is contained in:
parent
c99f4b6782
commit
819dd242e3
@ -102,18 +102,6 @@ public class AppConfig {
|
||||
properties.setProperty("active.panel", panel);
|
||||
}
|
||||
|
||||
public int getBriefMouseWheelSteps() {
|
||||
try {
|
||||
return Integer.parseInt(properties.getProperty("brief.mousewheel.steps", "10"));
|
||||
} catch (NumberFormatException e) {
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
|
||||
public void setBriefMouseWheelSteps(int steps) {
|
||||
properties.setProperty("brief.mousewheel.steps", String.valueOf(steps));
|
||||
}
|
||||
|
||||
public String getLeftPanelPath() {
|
||||
return properties.getProperty("leftPanel.path", System.getProperty("user.home"));
|
||||
}
|
||||
|
||||
@ -543,11 +543,8 @@ public class FilePanelTab extends JPanel {
|
||||
if (viewMode == ViewMode.BRIEF) {
|
||||
int rotation = e.getWheelRotation();
|
||||
if (rotation != 0) {
|
||||
int steps = 10;
|
||||
if (persistedConfig != null) {
|
||||
steps = persistedConfig.getBriefMouseWheelSteps();
|
||||
}
|
||||
handleBriefNavigation(rotation > 0, steps);
|
||||
// Navigate by one full column per wheel step
|
||||
handleBriefNavigation(rotation > 0, tableModel.briefRowsPerColumn);
|
||||
e.consume();
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,6 @@ public class SettingsDialog extends JDialog {
|
||||
private final Color originalSel;
|
||||
private final Color originalMark;
|
||||
private final Color originalFolder;
|
||||
private final int originalBriefMouseWheelSteps;
|
||||
private final Font originalGlobalFont;
|
||||
private final Font originalEditorFont;
|
||||
private final String originalExternalEditorPath;
|
||||
@ -56,7 +55,6 @@ public class SettingsDialog extends JDialog {
|
||||
this.originalSel = config.getSelectionColor();
|
||||
this.originalMark = config.getMarkedColor();
|
||||
this.originalFolder = config.getFolderColor();
|
||||
this.originalBriefMouseWheelSteps = config.getBriefMouseWheelSteps();
|
||||
this.originalGlobalFont = config.getGlobalFont();
|
||||
this.originalEditorFont = config.getEditorFont();
|
||||
this.originalExternalEditorPath = config.getExternalEditorPath();
|
||||
@ -207,8 +205,6 @@ public class SettingsDialog extends JDialog {
|
||||
JPanel behaviorHolder = (JPanel) panels.get("Behavior");
|
||||
if (behaviorHolder != null) {
|
||||
try {
|
||||
JSpinner mws = (JSpinner) behaviorHolder.getClientProperty("mouseWheelSteps");
|
||||
if (mws != null) config.setBriefMouseWheelSteps((Integer) mws.getValue());
|
||||
JSpinner ari = (JSpinner) behaviorHolder.getClientProperty("autoRefreshInterval");
|
||||
if (ari != null) config.setAutoRefreshInterval((Integer) ari.getValue());
|
||||
} catch (Exception ignore) {}
|
||||
@ -226,7 +222,6 @@ public class SettingsDialog extends JDialog {
|
||||
config.setSelectionColor(originalSel);
|
||||
config.setMarkedColor(originalMark);
|
||||
config.setFolderColor(originalFolder);
|
||||
config.setBriefMouseWheelSteps(originalBriefMouseWheelSteps);
|
||||
config.setGlobalFont(originalGlobalFont);
|
||||
config.setEditorFont(originalEditorFont);
|
||||
config.setExternalEditorPath(originalExternalEditorPath);
|
||||
@ -430,14 +425,6 @@ public class SettingsDialog extends JDialog {
|
||||
|
||||
int row = 0;
|
||||
|
||||
// Mouse wheel steps in brief mode
|
||||
gbc.gridx = 0; gbc.gridy = row; gbc.weightx = 0.0;
|
||||
grid.add(new JLabel("Mouse wheel steps (Brief mode):"), gbc);
|
||||
|
||||
JSpinner mwSteps = new JSpinner(new SpinnerNumberModel(config.getBriefMouseWheelSteps(), 1, 100, 1));
|
||||
gbc.gridx = 1; gbc.gridy = row++; gbc.weightx = 1.0;
|
||||
grid.add(mwSteps, gbc);
|
||||
|
||||
// Auto-refresh interval
|
||||
gbc.gridx = 0; gbc.gridy = row; gbc.weightx = 0.0;
|
||||
grid.add(new JLabel("Auto-refresh interval (ms):"), gbc);
|
||||
@ -447,7 +434,6 @@ public class SettingsDialog extends JDialog {
|
||||
grid.add(refreshInt, gbc);
|
||||
|
||||
p.add(grid, BorderLayout.NORTH);
|
||||
p.putClientProperty("mouseWheelSteps", mwSteps);
|
||||
p.putClientProperty("autoRefreshInterval", refreshInt);
|
||||
panels.put("Behavior", p);
|
||||
return p;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user