From c8486087d85cb04456d067eddaae16b2680e86ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pol=C3=A1=C5=A1ek?= Date: Tue, 30 Sep 2025 16:06:48 +0200 Subject: [PATCH] CmdPal: Update visual style of details panel elements (#42102) ## Summary of the Pull Request This PR updates the details panel formatting: - Hides the empty text block used as a separator when the key is empty. - Makes separators more subtle by adjusting the brush. - Reverses the typographical hierarchy of detail key/value items, making the value dominant and the key more subtle to help users focus on the content. - Defines new detail text styles derived from the base WinUI typographical styles. | Before | After | |--------|-------| | image | image | ## PR Checklist - [x] Closes: #42099 - [x] Closes: #41664 - [ ] **Communication:** I've discussed this with core contributors already. If the 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 - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed --- .../Helpers/BindTransformers.cs | 8 +++ .../Microsoft.CmdPal.UI/Pages/ShellPage.xaml | 59 +++++++++++-------- 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Helpers/BindTransformers.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI/Helpers/BindTransformers.cs index 66744b4c99..24d2ef47a6 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Helpers/BindTransformers.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Helpers/BindTransformers.cs @@ -2,9 +2,17 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.UI.Xaml; + namespace Microsoft.CmdPal.UI.Helpers; internal static class BindTransformers { public static bool Negate(bool value) => !value; + + public static Visibility EmptyToCollapsed(string? input) + => string.IsNullOrEmpty(input) ? Visibility.Collapsed : Visibility.Visible; + + public static Visibility EmptyOrWhitespaceToCollapsed(string? input) + => string.IsNullOrWhiteSpace(input) ? Visibility.Collapsed : Visibility.Visible; } diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Pages/ShellPage.xaml b/src/modules/cmdpal/Microsoft.CmdPal.UI/Pages/ShellPage.xaml index af0eff2181..597072241a 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Pages/ShellPage.xaml +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Pages/ShellPage.xaml @@ -41,6 +41,31 @@ FalseValue="Visible" TrueValue="Collapsed" /> + + + + + + - + @@ -76,20 +101,13 @@ + - @@ -98,10 +116,7 @@ - + + Visibility="{x:Bind help:BindTransformers.EmptyOrWhitespaceToCollapsed(Key), FallbackValue=Collapsed}" /> - +