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

[RTL] Add support for image dynamic updating, padding, tooltips and size in percent. #80410

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Aug 8, 2023

  • Adds method to update RTL images without changing the text.
  • Adds support for small image padding.
  • Adds support for image size in percent of control width.

RTL only part of #69751

@bruvzg bruvzg force-pushed the rtl_img_features branch from 37ed04f to 1901b84 Compare August 9, 2023 11:19
@bruvzg bruvzg requested a review from a team as a code owner August 9, 2023 11:19
@bruvzg bruvzg force-pushed the rtl_img_features branch from 1901b84 to 924f1ec Compare August 9, 2023 12:24
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

Functionality-wise looks ok.

I wonder if there is a simpler way to make update_image() than having to call a method with 7 unused arguments (in case you want to change 1 thing); it's likely the most efficient/intuitive way. The other solution I could think of is replacing arguments with Variant array that has to be filled depending on the mask, but that would be more error-prone.

Another concern is parameter creep in add_image() 🙃 It can't be solved without named arguments though.

@fire
Copy link
Member

fire commented Aug 31, 2023

There is some changes to be rebased @bruvzg

@bruvzg bruvzg requested a review from a team as a code owner September 1, 2023 06:39
Comment on lines +27 to +30
<param index="6" name="key" type="Variant" default="null" />
<param index="7" name="pad" type="bool" default="false" />
<param index="8" name="tooltip" type="String" default="&quot;&quot;" />
<param index="9" name="size_in_percent" type="bool" default="false" />
Copy link
Member

Choose a reason for hiding this comment

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

The full list of parameters is starting to be quite convoluted, that will be an awkward API to use IMO.
Struct support would be great here, passing a configuration struct with selected optional members defined would probably be better.

@YuriSizov YuriSizov modified the milestones: 4.x, 4.2 Sep 5, 2023
@bruvzg bruvzg force-pushed the rtl_img_features branch 2 times, most recently from 39538f6 to be42c54 Compare September 20, 2023 10:06
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Needs rebase, otherwise seems good to me.

editor/editor_help.cpp Outdated Show resolved Hide resolved
scene/gui/rich_text_label.compat.inc Outdated Show resolved Hide resolved
scene/gui/rich_text_label.cpp Outdated Show resolved Hide resolved
scene/gui/rich_text_label.cpp Outdated Show resolved Hide resolved
scene/gui/rich_text_label.h Outdated Show resolved Hide resolved
scene/gui/rich_text_label.h Outdated Show resolved Hide resolved
scene/gui/rich_text_label.h Outdated Show resolved Hide resolved
@akien-mga akien-mga merged commit ca8b229 into godotengine:master Sep 26, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants