PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

[Settings] New Settings controls, XAML formatting and cleanup

Open niels9001 opened this issue 2 years ago • 6 comments

This PR removes our custom settings components and uses the Windows Community Toolkit SettingsCard and SettingsExpander.

This heavily reduces the amount of XAML we need and it's easier to maintain going forward.

  • XAML formatting according to XAML Styler.
  • Content is now horizontally centered, in line with W11 Settings.
  • Removing duplicate converters and move to App.xaml
  • By using the new Toolkit controls and using ItemsRepeaters instead of ListView, we have consistent disabled states: #18282

Summary of the Pull Request

PR Checklist

  • [X] Closes: #18282
  • [ ] Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • [ ] Tests: Added/updated and all pass
  • [ ] Localization: All end user facing strings can be localized
  • [ ] Dev docs: Added/updated
  • [ ] New binaries: Added on the required places
  • [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

niels9001 avatar Oct 18 '22 08:10 niels9001

@niels9001 Fyi: There is a bug in the number box control that when it is initially disabled the text color doesn't change on enabling it. Should we create an issue (in WinUi repo)?

htcfreek avatar Oct 18 '22 10:10 htcfreek

@htcfreek I think there's more then just one: https://github.com/microsoft/PowerToys/issues/18282

Jay-o-Way avatar Oct 18 '22 11:10 Jay-o-Way

@htcfreek I think there's more then just one: #18282

I think most of these will be resolved with this PR :).

niels9001 avatar Nov 17 '22 10:11 niels9001

@jaimecbernardo I know this is a pain to review.. functionality-wise there are no changes, just formatting and XAML syntax. Let me know if I can help with anything!

niels9001 avatar Nov 17 '22 10:11 niels9001

It's contained to Settings, which is good. I'll look into fixing that "can't find labs" issue.

jaimecbernardo avatar Nov 17 '22 12:11 jaimecbernardo

I think Setting.Description > TextBlock > Run General_SettingsBackupAndRestoreDescription (line 236-240) can be simplified? Same question for 8× TextBlock > Run (lines 280-312)

I think this is already tackled?

niels9001 avatar Nov 17 '22 12:11 niels9001

Thanks for opening up this PR. I haven't gotten to the code yet, but these are some of the issues I saw while testing, Can you please look into them and re-request a review? Thank you :)

  • Some visual weirdness I noticed on Windows 10: image
  • Keyboard Manager page is crashing as soon as I add any key mapping.
  • When trying to put color formats from color picker up or down they don't seem to move: image
  • The error of defining activation command is always on for PowerToys Run plugins: image
  • Quick Accent page just crashes. Can't open it.

Thanks fixed! Did you get a specific error for KBM? Seems to load fine on my machine?

niels9001 avatar Nov 18 '22 13:11 niels9001

Three things I see: 1) Text and Background color of Image Resizer presets is strange, when swithing module on & off. Also when going to another page and coming back. 2) image 3) image

Jay-o-Way avatar Nov 18 '22 16:11 Jay-o-Way

@niels9001 , I've tried running with debugger, to check what was crashing but it didn't crash. However, it crashes on the KBM page(with mappings added) when I start settings from the runner and also when I run settings directly but without attaching the debugger.

image

I'm guessing the new components we're using here might have some memory issues that don't get triggered when running with the debugger. (Running with debugger makes some memory errors not trigger)

jaimecbernardo avatar Nov 21 '22 11:11 jaimecbernardo

Three things I see: 1) Text and Background color of Image Resizer presets is strange, when swithing module on & off. Also when going to another page and coming back. 2) 3)

Fixed 2 + 3.. 1 is due to us using a ListView which has its own disabled styles. We can fix this with a custom style, but I'd keep that for a separate PR as this one is already pretty huge and hard to test :).

niels9001 avatar Nov 22 '22 13:11 niels9001

Is this in a state ready for review again?

crutkas avatar Nov 22 '22 22:11 crutkas

LGTM

Jay-o-Way avatar Nov 23 '22 15:11 Jay-o-Way