Skip to content

Commit

Permalink
add trackpad panel stub
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunlebron committed Dec 1, 2022
1 parent 2e08c96 commit 5757319
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/dashboard/java/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class Example implements Consumer<Event> {
public PanelRendering panelRendering;
public PanelEvents panelEvents;
public PanelTheme panelTheme;
public PanelTrackpad panelTrackpad;
public boolean initialized = false;

public Window window;
Expand All @@ -50,6 +51,7 @@ public Example() {
panelRendering = new PanelRendering(window);
panelEvents = new PanelEvents(window);
panelTheme = new PanelTheme(window);
panelTrackpad = new PanelTrackpad(window);

var scale = window.getScreen().getScale();
int count = App._windows.size() - 1;
Expand Down Expand Up @@ -107,12 +109,13 @@ public void paint(Canvas canvas, int width, int height) {
panelMouse.paint (canvas, PADDING + (panelWidth + PADDING) * 0, PADDING + (panelHeight + PADDING) * 0, panelWidth, panelHeight, scale);
panelTextInput.paint (canvas, PADDING + (panelWidth + PADDING) * 1, PADDING + (panelHeight + PADDING) * 0, panelWidth, panelHeight, scale);
panelMouseCursors.paint (canvas, PADDING + (panelWidth + PADDING) * 2, PADDING + (panelHeight + PADDING) * 0, panelWidth, panelHeight, scale);
panelLegend.paint (canvas, PADDING + (panelWidth + PADDING) * 3, PADDING + (panelHeight + PADDING) * 0, panelWidth, panelHeight * 3 + PADDING * 2, scale);
panelTrackpad.paint (canvas, PADDING + (panelWidth + PADDING) * 3, PADDING + (panelHeight + PADDING) * 0, panelWidth, panelHeight, scale);

// Second row
panelScreens.paint (canvas, PADDING + (panelWidth + PADDING) * 0, PADDING + (panelHeight + PADDING) * 1, panelWidth, panelHeight, scale);
panelAnimation.paint (canvas, PADDING + (panelWidth + PADDING) * 1, PADDING + (panelHeight + PADDING) * 1, panelWidth, panelHeight, scale);
panelRendering.paint (canvas, PADDING + (panelWidth + PADDING) * 2, PADDING + (panelHeight + PADDING) * 1, panelWidth, panelHeight, scale);
panelLegend.paint (canvas, PADDING + (panelWidth + PADDING) * 3, PADDING + (panelHeight + PADDING) * 1, panelWidth, panelHeight * 2 + PADDING, scale);

// Third row
panelEvents.paint (canvas, PADDING + (panelWidth + PADDING) * 0, PADDING + (panelHeight + PADDING) * 2, panelWidth * 2 + PADDING, panelHeight, scale);
Expand Down Expand Up @@ -167,6 +170,7 @@ public void accept(Event e) {
panelRendering.accept(e);
panelEvents.accept(e);
panelTheme.accept(e);
panelTrackpad.accept(e);

float scale = window.getScreen().getScale();
if (e instanceof EventKey eventKey) {
Expand Down
23 changes: 23 additions & 0 deletions examples/dashboard/java/PanelTrackpad.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.github.humbleui.jwm.examples;

import java.util.*;
import java.util.function.*;
import java.util.stream.*;

import io.github.humbleui.jwm.*;
import io.github.humbleui.skija.*;
import io.github.humbleui.types.*;

public class PanelTrackpad extends Panel {
public PanelTrackpad(Window window) {
super(window);
}

@Override
public void accept(Event e) {
}

@Override
public void paintImpl(Canvas canvas, int width, int height, float scale) {
}
}

0 comments on commit 5757319

Please sign in to comment.