-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
demos/Context Menu/main.blp
Outdated
|
||
Adw.StatusPage demo { | ||
title: _("Context Menu"); | ||
description: _("Display context menu"); |
There was a problem hiding this comment.
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.
description: _("Display context menu"); | |
description: _("Offer contextual actions"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
demos/Context Menu/main.json
Outdated
@@ -0,0 +1,6 @@ | |||
{ | |||
"category": "controls", | |||
"description": "Display context menus", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Display context menus", | |
"description": "Offer contextual actions", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
demos/Context Menu/main.js
Outdated
const position = new Gdk.Rectangle(); | ||
position.x = x; | ||
position.y = y; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const position = new Gdk.Rectangle(); | |
position.x = x; | |
position.y = y; | |
const position = new Gdk.Rectangle({ x, y }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
demos/Context Menu/main.blp
Outdated
item { | ||
label: _("Happy"); | ||
action: "mood.happy"; | ||
} | ||
|
||
item { | ||
label: _("Start Struck"); | ||
action: "mood.start-struck"; | ||
} | ||
|
||
item { | ||
label: _("Partying"); | ||
action: "mood.partying"; | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
demos/Context Menu/main.js
Outdated
const gesture_click = workbench.builder.get_object("gesture_click"); | ||
const popover_menu = workbench.builder.get_object("popover_menu"); | ||
|
||
gesture_click.connect("pressed", (_, __, x, y) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gesture_click.connect("pressed", (_, __, x, y) => { | |
gesture_click.connect("pressed", (_self, _n_press, x, y) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
I think I addressed all comments. |
You shouldn't have to worry about this. https://github.com/workbenchdev/demos/blob/main/CONTRIBUTING.md#setup |
While adding the copy menu to the console I noticed that we don't have a demo for generic context menu.