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

extended BlockModel::draw(const property_map&) API #459

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

RalphSteinhagen
Copy link
Member

needed to pass some optional non-global UI constraints to the specific block e.g. in case the same block is redrawn in two different UI views.

needed to pass some optional non-global UI constraints to the specific block e.g. in case the same block is redrawn in two different UI views.

Signed-off-by: rstein <r.steinhagen@gsi.de>
Copy link

sonarqubecloud bot commented Nov 2, 2024

Copy link
Member

@wirew0rm wirew0rm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

I assume the intended use will become clearer on coming follow-up PRs, but just to get a rough picture, the idea is to allow overriding things like line-style/color and/or passing in additional layout constraints, right?

This means the ImGui code (just assuming imgui for now, might of course be another drawing framework) now has 3 sources of information:

  • the global settings of the drawable Block
  • the property map passed to the draw block (this PR)
  • the global ImGui context information (things like currently active style and layout constraints)

With regard to the last 2, there might be some overlap, where we have to make sure that the priorities and usage between them is consistent between different blocks and parts of the code, but anyway having a generic way to pass additional information to the draw call looks very useful for future extension.

@wirew0rm wirew0rm merged commit 2849b24 into main Nov 4, 2024
12 of 13 checks passed
@wirew0rm wirew0rm deleted the add-draw-parameter branch November 4, 2024 09:01
@RalphSteinhagen
Copy link
Member Author

the idea is to allow overriding things like line-style/color and/or passing in additional layout constraints, right?

Yes, also to suppressing the drawing entirely e.g. if data is supposed to be processed and stored in the internal buffers but not to be drawn.

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

Successfully merging this pull request may close these issues.

2 participants