Material.Avalonia icon indicating copy to clipboard operation
Material.Avalonia copied to clipboard

Opacity of floating watermark

Open kerams opened this issue 1 year ago • 2 comments

Usage Information

3.7.4

Description

image

Reproduction Steps

https://avaloniacommunity.github.io/Material.Avalonia/

<TextBox
  UseFloatingWatermark="True"
  Classes="clearButton"
  p1:TextFieldAssist.Label="Text field"
  xmlns:p1="clr-namespace:Material.Styles.Assists;assembly=Material.Styles" />

Expected Behavior

When a floating watermark functions as the placeholder/regular watermark (i.e. when the focus is elsewhere), it should have reduced opacity, otherwise it looks like the text box contains an actual value.

All text in the picture above should have the same opacity as the second text box.

Actual Behavior

Floating watermark is always rendered with full opacity.

Regression?

No response

Known Workarounds

No response

Anything else?

No response

Could you help with a pull-request?

No

Is there an existing issue for this?

  • [X] I have searched the existing issues

kerams avatar Oct 13 '24 14:10 kerams

I suppose it's actually by design, but it probably isn't hard to change.

SKProCH avatar Oct 13 '24 23:10 SKProCH

I would be happy with using an overriding style in my application, if there is one.

kerams avatar Oct 14 '24 06:10 kerams

Should be something like that:

<Style Selector="TextBox:empty:not(:focus-within) /template/ TextBlock#PART_LabelText">
  <Setter Property="Opacity" Value="0.5"></Setter>
</Style>

P.S. Sorry for late response. If you have any additional questions feel free to reopen the issue.

SKProCH avatar Dec 25 '24 22:12 SKProCH