Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syscalls help is opened scrolled to the bottom #86

Closed
cypok opened this issue Aug 21, 2020 · 1 comment
Closed

Syscalls help is opened scrolled to the bottom #86

cypok opened this issue Aug 21, 2020 · 1 comment

Comments

@cypok
Copy link
Contributor

cypok commented Aug 21, 2020

Syscall tab at Help window is already scrolled to the bottom when it is opened. It looks weird and is inconvenient to always scroll it back:
image

It is reproducible on version 1.5 on macOS and Windows (JDK 11).

Other tabs are opened at their beginning:
image

@TheThirdOne
Copy link
Owner

I am aware of this issue; it hasn't been high on my list of priorities though. I would guess it is pretty easy to fix. Thanks for making the issue for this; it deserves attention.

Some of the relevant code is:

private JScrollPane createSyscallsHelpPane() {
ArrayList<AbstractSyscall> list = SyscallLoader.getSyscallList();
String[] columnNames = {"Name", "Number", "Description", "Inputs", "Ouputs"};
String[][] data = new String[list.size()][5];
Collections.sort(list);
int i = 0;
for (AbstractSyscall syscall : list) {
data[i][0] = syscall.getName();
data[i][1] = Integer.toString(syscall.getNumber());
data[i][2] = syscall.getDescription();
data[i][3] = syscall.getInputs();
data[i][4] = syscall.getOutputs();
i++;
}
JEditorPane html = new JEditorPane("text/html",
loadFiletoStringBuilder(Globals.helpPath + "SyscallHelpPrelude.html") +
convertToHTMLTable(data, columnNames).toString() + loadFiletoStringBuilder(Globals.helpPath + "SyscallHelpConclusion.html"));
html.setEditable(false);
return new JScrollPane(html, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}

Fixing this should just come down to using a method on JScrollPane to scroll to the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants