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

Properly changing window title text color #940

Open
ArthurSonzogni opened this issue Oct 21, 2024 Discussed in #939 · 1 comment
Open

Properly changing window title text color #940

ArthurSonzogni opened this issue Oct 21, 2024 Discussed in #939 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ArthurSonzogni
Copy link
Owner

Discussed in #939

Originally posted by sentientbottleofwine October 20, 2024
This might be a very simple question and I might be just missing something obvious, I tried and couldn't resolve my issue. When I try to make a window that has a title that's supposed to be colored and apply the color to the title the whole upper border of the window changes color:
20241020_17h22m27s_grim
Here's the code:

#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>

int main() {
    using namespace ftxui;
    auto render = window(text("Only text should be colored") | color(Color::Green), text("Contents")) | color(Color::White);
    auto screen = Screen::Create(
        Dimension::Full(),
        Dimension::Fit(render)
    );
    Render(screen, render);
    screen.Print();
}

I have no idea how to do this correctly. I greatly appreciate and thank any help.

@ArthurSonzogni
Copy link
Owner Author

Thanks!

This looks like a bug. I believe this is because the "title" is flexible by default and covers the whole line, causing the color decorator to apply to everything that is behind.

We probably want to fix this.

@ArthurSonzogni ArthurSonzogni self-assigned this Oct 22, 2024
@ArthurSonzogni ArthurSonzogni added the bug Something isn't working label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant