-
Notifications
You must be signed in to change notification settings - Fork 188
[dependencies] Add support for ftxui 6.0.0. #2095
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
base: master
Are you sure you want to change the base?
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.
clang-tidy made some suggestions
Some context about why Context I had to split this function in two:
See |
@ArthurSonzogni I did just what you explained, however, it leads to a different behavior and the app is broken for ftxui 6.0.0. I can no longer select elements from the list in the given application. ecal/app/mon/mon_tui/src/tui/view/component/scroller.hpp Lines 44 to 65 in 5859ba6
Is this allowed? |
@@ -108,7 +108,11 @@ class CommandLineView : public View | |||
return true; | |||
} | |||
|
|||
#if FTXUI_VERSION_MAJOR >= 6 |
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.
What about introducing some helper macro?
// Usage:
// FTXUI_RENDER() override {
// using namespace ftxui;
// return text("Hello, world!") | border;
// }
#if FTXUI_VERSION_MAJOR >= 6
#define FTXUI_RENDER() ftxui::Element OnRender()
#else
#define FTXUI_RENDER() ftxui::Element Render()
#endif
Element Render() final | ||
#endif | ||
{ | ||
auto focused = Focused() ? focus : ftxui::select; |
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.
Note that with ftxui 6.0.0, focus
and select
are now alias of each others. You don't need to make it conditional on Focused()
anymore and it should work select the focused element of the active component automatically.
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.
That being said, you can keep it if you want to keep 5.0.0 compatibility.
Element Render() final | ||
#endif | ||
{ | ||
auto focused = Focused() ? focus : ftxui::select; | ||
auto style = Focused() ? inverted : nothing; |
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.
Element background = ComponentBase::Render();
must be:
Element background = ComponentBase::OnRender();
Or else the background
won't be focused when active.
Todo: It seems that 6.0.0 breaks the ability to select an item from the list of topics. This needs to be investigated.
Seems it's still not working.
5859ba6
to
6a209b4
Compare
@ArthurSonzogni I had made the changes that you suggested, however, the problem I described on top remains. Since I haven't authored the code, I have a hard time locating the source of the issue. Maybe the element of choice is no longer selected correctly (regarding the "focused" issue?) Anything I can pay attention to in particular? |
I would be happy to debug this. The problem is that the last time I tried, there was too many obstacle to build the project. If you can provide some instructions for me to try, I will figure this out. |
So in general, it should not be too difficult to build. You don't need to build everything, i'd recommend samples & console apps (no gui), so you will have mon_tui and some samples (ecal_sample_person_send, ecal_sample_blob_send) to test with. However, since I just tried a complete clean rebuild with which I though were good options for you, and failed, this might have to wait a little longer :/ I will let you know! And thanks so much for offering to help. |
I found the issue. This is due to how the In order to support color alpha and "blend" the bgcolor of the top layer on top of the layers below, we blend its bgcolor. Outside of those, we replace everything including the modifier like In your case the "scroller" is implemented by adding an What you can do:
test-2025-05-01_17.02.29.mp4
|
ftxui has released a new major version.
This branch tries to ensure compatibility with the new release and all older releases.
Todo: It seems that 6.0.0 breaks the ability to select an item from the list of topics. This needs to be investigated.

(background ftxui 6.0.0, foreground ftxui 5.0.0 - the elements are no longer selectable).
(This PR does not update the submodule, so the current build is still using 5.0.0)
@brakmic-aleksandar There is no chance that you might quickly look into this? I am not quite sure where to start.