-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Settings: XAML refactoring #29785
Settings: XAML refactoring #29785
Conversation
src/settings-ui/Settings.UI/SettingsXAML/Controls/AlphaColorPickerButton.xaml
Show resolved
Hide resolved
What about switching order between hyperlink and buttons? 🤔 (First hyperlink, then buttins.) |
Possible. But why? Links usually have a "less than important" feeling. |
I thought it might look better to have the "big" buttons after the "small" text and link, and not between. |
This comment was marked as resolved.
This comment was marked as resolved.
@Jay-o-Way https://marketplace.visualstudio.com/items?itemName=TeamXavalon.XAMLStyler2022 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually run this incantation when switching branches:
git clean -ffxd
So, Settings doesn't crash for me if I run it directly from Visual Studio (PowerToys Run plugins, at least, since VCM page is disabled when running like that).
It still crashes if I run it through "Start without Debugging"(Ctrl+F5) or if I start the runner and then start Settings from the tray icon. (This is what I usually do when testing since it's the normal way to start the Settings apps)
On PowerToys Run page, when I try to expand one of the plugins, it crashes the Settings app.
When I try to open the VCM Settings page, it crashes Settings.Does it crash for you as well?
I gave the PR a try again and it still crashes for me on these two places.
@Jay-o-Way , @jaimecbernardo |
@jaimecbernardo @niels9001 GREAT NEWS! Looks like something can't deal with an empty/null string as Image Source? When I do have an image readily set, and then use the button to ClearOverlayImageAction, the app freezes. Important This also happens in 0.76.2 (GA) so this is not an issue created in this PR! |
Guys, have a moment? 😇 |
Most of us are out of office for the holidays. I'll make sure to get back to this once I'm back! |
@@ -2,51 +2,47 @@ | |||
x:Class="Microsoft.PowerToys.Settings.UI.Views.EnvironmentVariablesPage" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" | |||
xmlns:controls1="using:CommunityToolkit.WinUI.Controls" | |||
xmlns:custom="using:Microsoft.PowerToys.Settings.UI.Controls" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jay-o-Way Why is this namespace custom
now? That's rather confusing actually, since they are using the .Controls
namespace? That's why we use converters
namespace for Converters
Can't we use controls
for PowerToys controls, and toolkit
or toolkitcontrols
for all controls part of the Toolkit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, looking at the updated XAML.. toolkitcontrols
is pretty verbose and makes the XAML harder to read :(.
Could we use tk:SettingsCard
instead maybe? Or we do use custom
for custom controls (it's used only in a handful of files) and use controls
for Toolkit controls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this namespace
custom
now?
and
looking at the updated XAML..
toolkitcontrols
is pretty verbose and makes the XAML harder to read :(.Could we use
tk:SettingsCard
instead maybe?In themain
branch,custom
is already (consistently) used through-out the OOBE xaml pages. Under the rest of SettingsXAML area/folder,controls
,local
, andcustom
are all used.
@niels9001 Both PowerToys and CommunityToolkit can have namespaces for Controls and Converters declared. That's four combinations. Simply using "controls" or "converters" is ambiguous. We can shorten "CommunityToolkit" to "ct" and "PowerToys" to "pt", but when both versions of Controls or Converters are used in the same file, we can't shorten it any more than that. (Aside from skipping vowels...)
Therefore I suggest
- xmlns:ptcontrols="using:Microsoft.PowerToys.Settings.UI.Controls"
- xmlns:ptconverters="using:Microsoft.PowerToys.Settings.UI.Converters"
- xmlns:ctcontrols="using:CommunityToolkit.WinUI.UI.Controls"
- xmlns:ctconverters="using:CommunityToolkit.WinUI.Converters"
Images:
@niels9001 you're right. The longer it takes, the bigger it gets. I should re-do this into a few prs.
|
Summary of the Pull Request
Overhaul of Settings & Welcome XAML files.
(invisible)
{x:Bind Mode=m, Path=p}
→{x:Bind p, Mode=m}
(visible)
incl. OobeSubtitleStyle → SubtitleTextBlockStyle)PR Checklist
Detailed Description of the Pull Request / Additional comments
DataContext -> new pr
↳ (0.75.1) This padding should not be here; missing space next to keys
↳ (pr)
SubtitleTextBlockStyle;Hyperlink on new line; padding fixedValidation Steps Performed
Build with Visual Studio.