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

Small usability fixes for tiny screens #3992

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/src/processing/app/ui/EditorState.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ void defaultLocation(List<Editor> editors) {
int defaultWidth = Preferences.getInteger("editor.window.width.default");
int defaultHeight = Preferences.getInteger("editor.window.height.default");

// go even smaller for tiny screens
defaultWidth = Math.min(defaultWidth, deviceBounds.width);
defaultHeight = Math.min(defaultHeight, deviceBounds.height);

if (editors.size() == 0) {
// If no current active editor, use default placement.
// Center the window on ths screen, taking into account that the
Expand Down
2 changes: 2 additions & 0 deletions build/shared/lib/defaults.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ editor.window.height.min = 500
editor.window.height.min.macosx = 450
# tested to be 515 on Windows XP, this leaves some room
editor.window.height.min.windows = 530
# tested with Raspberry Pi display
editor.window.height.min.linux = 480

# font size for editor
#editor.font = Monospaced,plain,12
Expand Down
4 changes: 2 additions & 2 deletions core/src/processing/awt/PSurfaceAWT.java
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,8 @@ public void placeWindow(int[] location, int[] editorLocation) {
// if it fits inside the editor window,
// offset slightly from upper lefthand corner
// so that it's plunked inside the text area
locationX = editorLocation[0] + 66;
locationY = editorLocation[1] + 66;
locationX = editorLocation[0] + 100;
locationY = editorLocation[1] + 100;

if ((locationX + window.width > sketch.displayWidth - 33) ||
(locationY + window.height > sketch.displayHeight - 33)) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/processing/javafx/PSurfaceFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ public void placeWindow(int[] location, int[] editorLocation) {
// if it fits inside the editor window,
// offset slightly from upper lefthand corner
// so that it's plunked inside the text area
locationX = editorLocation[0] + 66;
locationY = editorLocation[1] + 66;
locationX = editorLocation[0] + 100;
locationY = editorLocation[1] + 100;

if ((locationX + stage.getWidth() > sketch.displayWidth - 33) ||
(locationY + stage.getHeight() > sketch.displayHeight - 33)) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/processing/opengl/PSurfaceJOGL.java
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ public void placeWindow(int[] location, int[] editorLocation) {
// if it fits inside the editor window,
// offset slightly from upper lefthand corner
// so that it's plunked inside the text area
locationX = editorLocation[0] + 66;
locationY = editorLocation[1] + 66;
locationX = editorLocation[0] + 100;
locationY = editorLocation[1] + 100;

if ((locationX + w > sketch.displayWidth - 33) ||
(locationY + h > sketch.displayHeight - 33)) {
Expand Down