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

To discuss: When text are changed they do not automaticly reapply the skin #146

Open
Nyan11 opened this issue May 7, 2024 · 1 comment
Labels
bug Something isn't working question Further information is requested

Comments

@Nyan11
Copy link
Collaborator

Nyan11 commented May 7, 2024

Hello,

I had a discussion about automatically reapplying the skin after changing the text of an element.
In example1 i present an example of a code where the skin are not reapply.
In example2, i present the current solution to force the reapplication of the skin.

The discution

Developper A say: when you change the text of a label or a button, the skin should automatically be reapply.
The usefull information of a ropped text is the string it contains.

Developper B say: when you change any properties of an element you do not want the skin to be reapply.
It should be the same for the RoppedText.

I think the ropped text has 2 functions:

  • It is the model of what you want to display and therefore should be updated by the style sheet (like adding a new element).
  • It is the model of how you want to display it and therefore in conflict with the style sheet (like changing a property after the installation phase of a skin).

example1

label := ToLabel new text: 'hello world'; addStamp: #danger; position: 0@50; yourself.
button := ToButton new labelText: 'Change the label'; addEventHandlerOn: BlClickEvent do: [ label text: 'goodBye' ]; yourself. 


space := BlSpace new.
space root addChild: button.
space root addChild: label.
space show.

space toTheme: ToBeeThemeGenerated new.

When i do it the upper code in a playground i obtain the folowing picture:
image

If i click 2 times on the button i obtain the following picture:
image

We saw in this example that the skin is not reapply to the ropped text inside the label and the button.
The text should be red for the label and white for the button.

example2

labelToChange := ToLabel new text: 'hello world'; addStamp: #danger; position: 0@50; yourself.
buttonToChange := ToButton new labelText: 'hello world'; addStamp: #primary; position: 100 @ 50; yourself.
button := ToButton new
	labelText: 'Change the label';
	addEventHandlerOn: BlClickEvent do: [ 
		labelToChange text: 'goodbye sky'; requestNewSkin.
		buttonToChange labelText: 'goodbye sky'; requestNewSkin .
		];
	yourself. 


space := BlSpace new.
space root addChild: button.
space root addChild: labelToChange.
space root addChild: buttonToChange.
space show.

space toTheme: ToBeeThemeGenerated new.
@Nyan11 Nyan11 added the question Further information is requested label May 7, 2024
@plantec
Copy link
Collaborator

plantec commented May 7, 2024

the skin should be reapplied when the text is changed

@plantec plantec added the bug Something isn't working label May 7, 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 question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants