Skip to content

Context menu - initial test#237

Open
meowcer wants to merge 3 commits intosystem2k:masterfrom
meowcer:contextmenu_test2
Open

Context menu - initial test#237
meowcer wants to merge 3 commits intosystem2k:masterfrom
meowcer:contextmenu_test2

Conversation

@meowcer
Copy link
Copy Markdown
Contributor

@meowcer meowcer commented Mar 15, 2026

Adds a custom context menu that's opened by right-clicking the canvas or canvas links (opens the same menu). Uses a new class that has similar functions to the top right menu.
Recommended next steps: Move it to inside the screen when resizing, improve option variable names

@meowcer
Copy link
Copy Markdown
Contributor Author

meowcer commented Mar 15, 2026

code change: fixed indentation (tab vs spaces?) for context_menu.js, this was initially an userscript;
i'll leave the backend part to fp if he's willing to do that
(warning: some frontend things aren't updated yet)

var buttonDisabledColor = int_to_hexcode(rgb_to_int(buttonDisabledRgb[0], buttonDisabledRgb[1], buttonDisabledRgb[2]));
var outlineColor = int_to_hexcode(rgb_to_int(outlineRgb[0], outlineRgb[1], outlineRgb[2]));

ctxMenuStyle.innerHTML = ".custom_ctx {" +
Copy link
Copy Markdown
Owner

@system2k system2k Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may want to use tick marks for this, ex:

ctxMenuStyle.innerHTML = `
  .custom_ctx {
    background-color: ${color};
  }
`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fp you dont even use tickmarks yourself sometimes when necessary (i peeked at the code and you used STRING ADDITION omfg) -gimmickCellar

Math.max(0, rgb[2] + outlineDelta)
];

var buttonColor = int_to_hexcode(rgb_to_int(buttonRgb[0], buttonRgb[1], buttonRgb[2]));
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to use the spread operator, ex:
rgb_to_int(...buttonRgb)

@meowcer
Copy link
Copy Markdown
Contributor Author

meowcer commented Mar 18, 2026

i was trying to follow the already implied style, but i'll do the better formatting instead then, thanks

idk exactly what you did but i dont think you changed the code so i'll do that

@meowcer
Copy link
Copy Markdown
Contributor Author

meowcer commented Mar 18, 2026

i'll leave it to your choice and to another commit if you wanna do the same for the original menu_color function

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants