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