Skip to content

Feedback about the template. #5

@ArthurSonzogni

Description

@ArthurSonzogni

Hello,

I just tried the template. Things are working correctly!

I only had two issues build. It blocked me 10min.

  • I installed conan and got weird errors. They were really not easy to diagnose. The fix was to make python3 the default alternative instead of python2.7.
  • clang-tidy is a "required-dependency". It might worth mentioning it in: README_dependencies.md or making it work without it.

Some comments:

  1. Bitmap::Render writes into the [0, width-1] x [0, height-1] box. However you might get an area smaller than what was asked in ComputeRequirement().
    This would normally result in out of bounds errors.
    Fortunately, FTXUI has the concept of a "stencil", inhibiting writing outside of the box assigned to you:
    https://github.com/ArthurSonzogni/FTXUI/blob/548fa51b7115551b42c0f12235de9eb79e7e33e3/src/ftxui/screen/screen.cpp#L408-L413
    So this works, despite this. Not sure if you knew it.

  2. I see Bitmap::SetBox overrides Node::SetBox, but provide the same implementation has the default one. You might want to remove this line if this wasn't added purposefully to help people to learn it.

  3. spdlog is included, but I don't see any usage. I am not sure how this will interact with FTXUI, if used.

  4. You can replace:

  auto container = ftxui::Container::Horizontal(all_buttons);

  auto renderer = ftxui::Renderer(container, make_layout);

by

auto renderer = Renderer(make_layout);

The Renderer function "decorates" a component, by replacing it's "Render()" function implementation, by the one provided. This is a alternative to using c++ composition/inheritance, that is sometimes quicker to write.
In your case, the decorated component doesn't do much. So the second version taking only the function rendering the interface can be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions