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

Update ptlaunch: Respect theme colors #1097

Merged
merged 4 commits into from Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps.json
Expand Up @@ -4858,10 +4858,10 @@
"id": "ptlaunch",
"name": "Pattern Launcher",
"shortName": "Pattern Launcher",
"version": "0.10",
"version": "0.11",
"description": "Directly launch apps from the clock screen with custom patterns.",
"icon": "app.png",
"screenshots": [{"url":"main_menu_add.png"}, {"url":"add_pattern.png"}, {"url":"select_app.png"}, {"url":"main_menu_manage.png"}, {"url":"manage_patterns.png"}],
"screenshots": [{"url":"manage_patterns_light.png"}],
"tags": "tools",
"supports": ["BANGLEJS2"],
"readme": "README.md",
Expand Down
3 changes: 2 additions & 1 deletion apps/ptlaunch/ChangeLog
@@ -1,4 +1,5 @@
0.01: Initial creation of the pattern launch app
0.02: Turn on lcd when launching an app if the lock screen was disabled in the settings
0.03: Make tap to confirm new pattern more reliable. Also allow for easier creation of single circle patterns.
0.10: Improve the management of existing patterns: Draw the linked pattern on the left hand side of the app name within a scroller, similar to the default launcher. Slighlty clean up the code to make it less horrible.
0.10: Improve the management of existing patterns: Draw the linked pattern on the left hand side of the app name within a scroller, similar to the default launcher. Slighlty clean up the code to make it less horrible.
0.11: Respect theme colors. Fix: Do not pollute global space with internal variables ans functions in boot.js
17 changes: 12 additions & 5 deletions apps/ptlaunch/README.md
Expand Up @@ -10,14 +10,21 @@ Then launch the linked apps directly from the clock screen by simply drawing the

## Add Pattern Screenshots

![](main_menu_add.png)
![](add_pattern.png)
![](select_app.png)
![](main_menu_add_light.png)
![](add_pattern_light.png)
![](select_app_light.png)

![](main_menu_add_dark.png)
![](add_pattern_dark.png)
![](select_app_dark.png)

## Manage Pattern Screenshots

![](main_menu_manage.png)
![](manage_patterns.png)
![](main_menu_manage_light.png)
![](manage_patterns_light.png)

![](main_menu_manage_dark.png)
![](manage_patterns_dark.png)

## Detailed Steps

Expand Down
Binary file removed apps/ptlaunch/add_pattern.png
Binary file not shown.
Binary file added apps/ptlaunch/add_pattern_dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/ptlaunch/add_pattern_light.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 4 additions & 8 deletions apps/ptlaunch/app.js
Expand Up @@ -119,8 +119,7 @@ var recognizeAndDrawPattern = () => {
return new Promise((resolve) => {
E.showMenu();
g.clear();
g.setColor(0, 0, 0);
CIRCLES.forEach((circle) => drawCircle(circle));
drawCirclesWithPattern([]);

var pattern = [];

Expand Down Expand Up @@ -369,7 +368,6 @@ var drawAppWithPattern = (i, r, storedPatterns) => {
offset: { x: 1, y: 3 + r.y },
});

g.setColor(0, 0, 0);
if (!storedPattern.wrappedAppName) {
storedPattern.wrappedAppName = g
.wrapString(app.name, g.getWidth() - 64)
Expand Down Expand Up @@ -490,7 +488,7 @@ var drawCircle = (circle, drawBuffer, scale) => {
log("drawing circle");
log({ x: x, y: y, r: r });

drawBuffer.fillCircle(x, y, r);
drawBuffer.drawCircle(x, y, r);
};

var cachedCirclesDrawings = {};
Expand Down Expand Up @@ -535,17 +533,15 @@ var drawCirclesWithPattern = (pattern, options) => {
{ msb: true }
);

drawBuffer.setColor(1);
CIRCLES.forEach((circle) => drawCircle(circle, drawBuffer, scale));

drawBuffer.setColor(0);
drawBuffer.setFontAlign(0, 0);
drawBuffer.setFont("6x8", 4 * scale);
drawBuffer.setFont("Vector", 40 * scale);
pattern.forEach((circleIndex, patternIndex) => {
var circle = CIRCLES[circleIndex];
drawBuffer.drawString(
patternIndex + 1,
circle.x * scale,
(circle.x + (scale === 1 ? 1 : 5)) * scale,
circle.y * scale
);
});
Expand Down