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

Please add an example for a context menu button/icon #12

Open
elnicko opened this issue Mar 1, 2020 · 0 comments
Open

Please add an example for a context menu button/icon #12

elnicko opened this issue Mar 1, 2020 · 0 comments

Comments

@elnicko
Copy link

elnicko commented Mar 1, 2020

As per gitter chat room, it would be nice if next to the drop down buttons we had the option to actually trigger a DropDownMenu from a normal button or icon. This allows for more styling options.

The following code compiles and works as expected for a "Kebap-Menu":

element.appendChild(Icons.ALL.dots_vertical_mdi()
                .clickable()
                .apply(self -> {
                    DropDownMenu dropDownMenu = DropDownMenu.create(self);
                    dropDownMenu.appendChild(DropdownAction.create("value 1")
                            .addClickListener(evt -> {})
                    );
                    dropDownMenu.appendChild(DropdownAction.create("value 2")
                            .addClickListener(evt -> {})
                    );

                    self.addClickListener(evt -> {
                        dropDownMenu.open();
                        evt.stopPropagation();
                    });

                }).element());

Please add this to the demo application

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

No branches or pull requests

1 participant