From 7e9c3bf04589becadd5c774d3d90978263ccf792 Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Mon, 8 Jul 2024 11:05:19 -0300 Subject: [PATCH] Update `RibbonThemeImageUtils` --- CHANGELOG.md | 3 ++- Directory.Build.props | 2 +- ...meBitmapUtils.cs => RibbonThemeImageUtils.cs} | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) rename ricaun.Revit.UI/Utils/{RibbonThemeBitmapUtils.cs => RibbonThemeImageUtils.cs} (72%) diff --git a/CHANGELOG.md b/CHANGELOG.md index aca61cc..95603ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Change `GetRibbonItem` to `GetRibbonItem_Alternative` to fix null when panel is removed. - Update `SetImage` to work with `ComboBoxMember` - Add `CreateComboBoxMember` to create `ComboBoxMember`. -- Add `RibbonThemeBitmapUtils` to change theme for `BitmapSource`. +- Add `RibbonThemeImageUtils` to change theme for `ImageSource`. +- Update `RibbonThemeImageUtils` with public `GetThemeImageSource`. - Add `RibbonThemePanelUtils` to update the theme for itens in the `RibbonPanel`. - Update `RibbonPanel` create and remove to update the theme of the itens. ### Tests diff --git a/Directory.Build.props b/Directory.Build.props index af8d48e..544470a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,5 @@ - 0.6.3-beta.2 + 0.6.3-beta.3 \ No newline at end of file diff --git a/ricaun.Revit.UI/Utils/RibbonThemeBitmapUtils.cs b/ricaun.Revit.UI/Utils/RibbonThemeImageUtils.cs similarity index 72% rename from ricaun.Revit.UI/Utils/RibbonThemeBitmapUtils.cs rename to ricaun.Revit.UI/Utils/RibbonThemeImageUtils.cs index 2e9389b..323bf4c 100644 --- a/ricaun.Revit.UI/Utils/RibbonThemeBitmapUtils.cs +++ b/ricaun.Revit.UI/Utils/RibbonThemeImageUtils.cs @@ -3,12 +3,24 @@ namespace ricaun.Revit.UI.Utils { - internal static class RibbonThemeBitmapUtils + /// + /// RibbonThemeImageUtils + /// + public static class RibbonThemeImageUtils { private const string NAME_DARK = "dark"; private const string NAME_LIGHT = "light"; - internal static TImageSource GetThemeImageSource(this TImageSource imageSource, bool isLight = true) where TImageSource : ImageSource + /// + /// GetThemeImageSource + /// + /// + /// + /// + /// + /// Replace 'light' to 'dark' or 'dark' to 'light' in the image source name. + /// + public static TImageSource GetThemeImageSource(this TImageSource imageSource, bool isLight = true) where TImageSource : ImageSource { if (imageSource.GetSourceName().TryThemeImage(isLight, out string imageTheme)) {