-
Notifications
You must be signed in to change notification settings - Fork 247
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 Dialog the capability to be focusable #616
base: main
Are you sure you want to change the base?
Conversation
@gyscos 😁 |
Hi! Yes yes, will take a look soon. A bit busy these days :( In any case, thanks for the work! |
I'm wondering if it could be maybe a better fit for panels? The more recent Do you think it would work for your use-case? In particular, panels don't have the same convenient integrated row of buttons (you would have to add the buttons in a LinearLayout or something). |
/// ``` | ||
pub fn print_box<T: Into<Vec2>, S: Into<Vec2>>( | ||
&self, | ||
start: T, | ||
size: S, | ||
invert: bool, | ||
highlight: bool, |
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 think at this point it may be better to use some parameter-struct (to have named parameters) rather than additional parameters:
use BoxStyle as BS;
printer.print_box(start, size, BS { invert: false, highlight: false });
Yes I noticed Dialog kinda grew organically... I will see to move this to panel |
Hello!
I found this feature missing: you can set a dialog to be "focusable". This means you can focus on the dialog itself, it will take the title primary color and it can take a callback function.
The callback function is optional: if you don't use the callback, pressing enter will give the focus to the content of the dialog.
If you press Tab or Shift+Tab it will start focusing the buttons instead.
This is similar to the "interactive" feature of the component Card of Blueprint.js
I will use it to make a new CLI for my library gptman.
Show case: