-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add CornerRadiusConverter for rounded SettingsExpander bottom c…
…orners, add mica to both project, close #5
- Loading branch information
Showing
16 changed files
with
693 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
UWPPackage/SettingsExpanderLastItemConrnerRadiusConverter.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "pch.h" | ||
#include "SettingsExpanderLastItemConrnerRadiusConverter.h" | ||
#if __has_include("SettingsExpanderLastItemConrnerRadiusConverter.g.cpp") | ||
#include "SettingsExpanderLastItemConrnerRadiusConverter.g.cpp" | ||
#endif | ||
|
||
namespace winrt::UWPPackage::implementation | ||
{ | ||
winrt::Windows::Foundation::IInspectable SettingsExpanderLastItemConrnerRadiusConverter::Convert( | ||
winrt::Windows::Foundation::IInspectable const& value, | ||
winrt::Windows::UI::Xaml::Interop::TypeName const&, | ||
winrt::Windows::Foundation::IInspectable const&, | ||
winrt::hstring const&) | ||
{ | ||
if (auto cornerRadius = value.try_as<winrt::Windows::UI::Xaml::CornerRadius>()) | ||
{ | ||
return winrt::box_value(winrt::Windows::UI::Xaml::CornerRadius{ | ||
.TopLeft = 0, | ||
.TopRight = 0, | ||
.BottomRight = cornerRadius->BottomRight, | ||
.BottomLeft = cornerRadius->BottomLeft | ||
}); | ||
} | ||
return value; | ||
} | ||
|
||
winrt::Windows::Foundation::IInspectable SettingsExpanderLastItemConrnerRadiusConverter::ConvertBack( | ||
winrt::Windows::Foundation::IInspectable const& value, | ||
winrt::Windows::UI::Xaml::Interop::TypeName const&, | ||
winrt::Windows::Foundation::IInspectable const&, | ||
winrt::hstring const&) | ||
{ | ||
return value; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
UWPPackage/SettingsExpanderLastItemConrnerRadiusConverter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include "SettingsExpanderLastItemConrnerRadiusConverter.g.h" | ||
|
||
namespace winrt::UWPPackage::implementation | ||
{ | ||
struct SettingsExpanderLastItemConrnerRadiusConverter : SettingsExpanderLastItemConrnerRadiusConverterT<SettingsExpanderLastItemConrnerRadiusConverter> | ||
{ | ||
SettingsExpanderLastItemConrnerRadiusConverter() = default; | ||
|
||
winrt::Windows::Foundation::IInspectable Convert( | ||
winrt::Windows::Foundation::IInspectable const& value, | ||
winrt::Windows::UI::Xaml::Interop::TypeName const& targetType, | ||
winrt::Windows::Foundation::IInspectable const& parameter, | ||
winrt::hstring const& language | ||
); | ||
|
||
winrt::Windows::Foundation::IInspectable ConvertBack( | ||
winrt::Windows::Foundation::IInspectable const& value, | ||
winrt::Windows::UI::Xaml::Interop::TypeName const& targetType, | ||
winrt::Windows::Foundation::IInspectable const& parameter, | ||
winrt::hstring const& language | ||
); | ||
}; | ||
} | ||
|
||
namespace winrt::UWPPackage::factory_implementation | ||
{ | ||
struct SettingsExpanderLastItemConrnerRadiusConverter : SettingsExpanderLastItemConrnerRadiusConverterT<SettingsExpanderLastItemConrnerRadiusConverter, implementation::SettingsExpanderLastItemConrnerRadiusConverter> | ||
{ | ||
}; | ||
} |
9 changes: 9 additions & 0 deletions
9
UWPPackage/SettingsExpanderLastItemConrnerRadiusConverter.idl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace UWPPackage | ||
{ | ||
[bindable] | ||
[default_interface] | ||
runtimeclass SettingsExpanderLastItemConrnerRadiusConverter : Windows.UI.Xaml.Data.IValueConverter | ||
{ | ||
SettingsExpanderLastItemConrnerRadiusConverter(); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
WinUI3Package/SettingsExpanderLastItemConrnerRadiusConverter.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "pch.h" | ||
#include "SettingsExpanderLastItemConrnerRadiusConverter.h" | ||
#if __has_include("SettingsExpanderLastItemConrnerRadiusConverter.g.cpp") | ||
#include "SettingsExpanderLastItemConrnerRadiusConverter.g.cpp" | ||
#endif | ||
|
||
namespace winrt::WinUI3Package::implementation | ||
{ | ||
winrt::Windows::Foundation::IInspectable SettingsExpanderLastItemConrnerRadiusConverter::Convert( | ||
winrt::Windows::Foundation::IInspectable const& value, | ||
winrt::Windows::UI::Xaml::Interop::TypeName const&, | ||
winrt::Windows::Foundation::IInspectable const&, | ||
winrt::hstring const&) | ||
{ | ||
if (auto cornerRadius = value.try_as<winrt::Microsoft::UI::Xaml::CornerRadius>()) | ||
{ | ||
return winrt::box_value(winrt::Microsoft::UI::Xaml::CornerRadius{ | ||
.TopLeft = 0, | ||
.TopRight = 0, | ||
.BottomRight = cornerRadius->BottomRight, | ||
.BottomLeft = cornerRadius->BottomLeft | ||
}); | ||
} | ||
return value; | ||
} | ||
|
||
winrt::Windows::Foundation::IInspectable SettingsExpanderLastItemConrnerRadiusConverter::ConvertBack( | ||
winrt::Windows::Foundation::IInspectable const& value, | ||
winrt::Windows::UI::Xaml::Interop::TypeName const&, | ||
winrt::Windows::Foundation::IInspectable const&, | ||
winrt::hstring const&) | ||
{ | ||
return value; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
WinUI3Package/SettingsExpanderLastItemConrnerRadiusConverter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include "SettingsExpanderLastItemConrnerRadiusConverter.g.h" | ||
|
||
namespace winrt::WinUI3Package::implementation | ||
{ | ||
struct SettingsExpanderLastItemConrnerRadiusConverter : SettingsExpanderLastItemConrnerRadiusConverterT<SettingsExpanderLastItemConrnerRadiusConverter> | ||
{ | ||
SettingsExpanderLastItemConrnerRadiusConverter() = default; | ||
|
||
winrt::Windows::Foundation::IInspectable Convert( | ||
winrt::Windows::Foundation::IInspectable const& value, | ||
winrt::Windows::UI::Xaml::Interop::TypeName const& targetType, | ||
winrt::Windows::Foundation::IInspectable const& parameter, | ||
winrt::hstring const& language | ||
); | ||
|
||
winrt::Windows::Foundation::IInspectable ConvertBack( | ||
winrt::Windows::Foundation::IInspectable const& value, | ||
winrt::Windows::UI::Xaml::Interop::TypeName const& targetType, | ||
winrt::Windows::Foundation::IInspectable const& parameter, | ||
winrt::hstring const& language | ||
); | ||
}; | ||
} | ||
|
||
namespace winrt::WinUI3Package::factory_implementation | ||
{ | ||
struct SettingsExpanderLastItemConrnerRadiusConverter : SettingsExpanderLastItemConrnerRadiusConverterT<SettingsExpanderLastItemConrnerRadiusConverter, implementation::SettingsExpanderLastItemConrnerRadiusConverter> | ||
{ | ||
}; | ||
} |
9 changes: 9 additions & 0 deletions
9
WinUI3Package/SettingsExpanderLastItemConrnerRadiusConverter.idl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace WinUI3Package | ||
{ | ||
[bindable] | ||
[default_interface] | ||
runtimeclass SettingsExpanderLastItemConrnerRadiusConverter : Microsoft.UI.Xaml.Data.IValueConverter | ||
{ | ||
SettingsExpanderLastItemConrnerRadiusConverter(); | ||
} | ||
} |
Oops, something went wrong.