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

Add context menu demo #30

Merged
merged 6 commits into from
Dec 14, 2023
Merged

Add context menu demo #30

merged 6 commits into from
Dec 14, 2023

Conversation

UrtsiSantsi
Copy link
Contributor

While adding the copy menu to the console I noticed that we don't have a demo for generic context menu.

Copy link
Contributor

@sonnyp sonnyp left a comment

Choose a reason for hiding this comment

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

Thanks!

image

The broad center row looks odd.

Can you vertically center its content and limit its width? Maybe square.


Adw.StatusPage demo {
title: _("Context Menu");
description: _("Display context menu");
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid repeating the title in the description to provide more info.

Suggested change
description: _("Display context menu");
description: _("Offer contextual actions");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -0,0 +1,6 @@
{
"category": "controls",
"description": "Display context menus",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"description": "Display context menus",
"description": "Offer contextual actions",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 10 to 12
const position = new Gdk.Rectangle();
position.x = x;
position.y = y;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const position = new Gdk.Rectangle();
position.x = x;
position.y = y;
const position = new Gdk.Rectangle({ x, y });

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 63 to 76
item {
label: _("Happy");
action: "mood.happy";
}

item {
label: _("Start Struck");
action: "mood.start-struck";
}

item {
label: _("Partying");
action: "mood.partying";
}
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use an action parameter for the emoji type?
it would make for a better example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying to keep it simple and focused, since we already have 'Menu' demo.
I added a parameter, but kept them as regular menu items, since they look better. Should I make them radio button menu items?

const gesture_click = workbench.builder.get_object("gesture_click");
const popover_menu = workbench.builder.get_object("popover_menu");

gesture_click.connect("pressed", (_, __, x, y) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
gesture_click.connect("pressed", (_, __, x, y) => {
gesture_click.connect("pressed", (_self, _n_press, x, y) => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@UrtsiSantsi
Copy link
Contributor Author

UrtsiSantsi commented Dec 14, 2023

I think I addressed all comments.
Where can I see the import order - there was a CI error because of it? Is it just natural order, if I understand Biome documentation correctly?

@sonnyp
Copy link
Contributor

sonnyp commented Dec 14, 2023

Where can I see the import order - there was a CI error because of it?

You shouldn't have to worry about this. https://github.com/workbenchdev/demos/blob/main/CONTRIBUTING.md#setup
Use toolbx if you don't want to install stuff on your host

@sonnyp sonnyp merged commit 42188ab into main Dec 14, 2023
1 check passed
@sonnyp sonnyp deleted the context_menu branch December 14, 2023 11:44
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.

2 participants