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

chore: prop setters accessible via ThemeResources #1491

Closed
wants to merge 3 commits into from

Conversation

Kunal22shah
Copy link
Contributor

GitHub Issue: #1469

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes, no api changes)
  • Build or CI related changes
  • Documentation content changes
  • Other... Please describe:

Description

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@Kunal22shah Kunal22shah self-assigned this Oct 23, 2024
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1491.eastus2.azurestaticapps.net

Comment on lines 714 to +717
<Setter Target="PlaceholderElement.Foreground" Value="{ThemeResource OutlinedTextBoxPlaceholderForegroundFocused}" />
<Setter Target="HeaderElement.Foreground" Value="{ThemeResource OutlinedTextBoxHeaderForegroundFocused}" />
<Setter Target="RootBorder.BorderThickness" Value="{ThemeResource MaterialOutlinedTextBoxBorderThicknessFocused}" />
<Setter Target="RootBorder.Padding" Value="0" />
<Setter Target="RootBorder.Padding" Value="{ThemeResource MaterialOutlinedTextBoxPaddingFocused}" />
Copy link
Contributor

@agneszitte agneszitte Oct 23, 2024

Choose a reason for hiding this comment

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

@kazo0, @eriklimakc, @Xiaoy312 please help me remember if there is a particular reason why we have a mismatch of OutlinedTextBox... and MaterialOutlinedTextBox... for the ThemeResources for example here please

Copy link
Contributor

Choose a reason for hiding this comment

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

not that i remember of, other than negligence

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that from the very start of the lightweight style, this was already like that. You can see it here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there is a reason for that, not that I recall

Copy link
Contributor

@agneszitte agneszitte Oct 24, 2024

Choose a reason for hiding this comment

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

@kazo0, @Xiaoy312, @eriklimakc We have all these resources below starting with "Material" that we will need to review I think then. I just wanted to make sure I did not forget a specific reason why it was kept "Material" in the name.
And I imagine it will be a breaking change as well for the resource's naming with the documentation update.

  • https://github.com/unoplatform/Uno.Themes/blob/master/doc/styles/TextBox.md
  • <!--#region Filled TextBox Style-->
    <CornerRadius x:Key="MaterialFilledTextBoxCornerRadius">4,4,0,0</CornerRadius>
    <macos:Thickness x:Key="MaterialFilledTextBoxPadding">16,7</macos:Thickness>
    <not_macos:Thickness x:Key="MaterialFilledTextBoxPadding">16,8</not_macos:Thickness>
    <x:Double x:Key="MaterialFilledTextBoxMinHeight">58</x:Double>
    <x:Double x:Key="MaterialFilledTextBoxBorderHeightFocused">2</x:Double>
    <!--#endregion-->
    <!--#region Outlined TextBox Style-->
    <x:Double x:Key="MaterialOutlinedTextBoxBorderThickness">1</x:Double>
    <CornerRadius x:Key="MaterialOutlinedTextBoxCornerRadius">4</CornerRadius>
    <macos:Thickness x:Key="MaterialOutlinedTextBoxPadding">16,7,14,7</macos:Thickness>
    <not_macos:Thickness x:Key="MaterialOutlinedTextBoxPadding">16,8</not_macos:Thickness>
    <x:Double x:Key="MaterialOutlinedTextBoxMinHeight">56</x:Double>
    <Thickness x:Key="MaterialOutlinedTextBoxBorderPadding">1</Thickness>
    <x:Double x:Key="MaterialOutlinedTextBoxBorderThicknessFocused">2</x:Double>
    <Thickness x:Key="MaterialOutlinedTextBoxPaddingFocused">0</Thickness>
    <x:Double x:Key="MaterialOutlinedTextBoxBorderThicknessPointerOver">2</x:Double>
    <Thickness x:Key="MaterialOutlinedTextBoxPaddingPointerOver">0</Thickness>
    <!--#endregion-->

Seems we would need to double-check other controls also (maybe on separate PRs for other controls ? so it is easier to follow the adjustments):
https://github.com/search?q=repo%3Aunoplatform%2FUno.Themes+%22%7C+%60Material%22&type=code

Copy link
Contributor

Choose a reason for hiding this comment

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

@Kunal22shah, @kazo0 As mentioned by @Xiaoy312, renaming should be carefully reviewed (and normally a breaking change for lightweight styling, so breaking change should be mentioned in the commit message)

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1491.eastus2.azurestaticapps.net

@@ -162,6 +163,9 @@
<x:Double x:Key="MaterialOutlinedTextBoxMinHeight">56</x:Double>
<Thickness x:Key="MaterialOutlinedTextBoxBorderPadding">1</Thickness>
<x:Double x:Key="MaterialOutlinedTextBoxBorderThicknessFocused">2</x:Double>
<Thickness x:Key="MaterialOutlinedTextBoxPaddingFocused">0</Thickness>
<x:Double x:Key="MaterialOutlinedTextBoxBorderThicknessPointerOver">2</x:Double>
<Thickness x:Key="MaterialOutlinedTextBoxPaddingPointerOver">0</Thickness>
<!--#endregion-->
</ResourceDictionary>

Copy link
Contributor

@agneszitte agneszitte Oct 23, 2024

Choose a reason for hiding this comment

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

doc/styles/TextBox.md Outdated Show resolved Hide resolved
Co-authored-by: Agnès ZITTE <[email protected]>
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1491.eastus2.azurestaticapps.net

@Kunal22shah
Copy link
Contributor Author

Closing this in favour of #1495

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.

[Material][TextBox] Make all property values on Setters from VisualStates accessible via ThemeResources
4 participants