Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:local="clr-namespace:PrettyScreenSHOT">
xmlns:local="clr-namespace:PrettyScreenSHOT"
xmlns:converters="clr-namespace:PrettyScreenSHOT.Converters">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- WPF UI Theme Resources -->
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />

<!-- Custom WPF UI Styles -->
<ResourceDictionary Source="pack://application:,,,/Themes/WpfUiCustom.xaml"/>
<!-- Application Base Theme (includes Colors, Typography, Spacing, and Custom Styles) -->
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml"/>
</ResourceDictionary.MergedDictionaries>

<!-- Global Converters -->
<converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/>
</ResourceDictionary>
</Application.Resources>
</Application>
29 changes: 29 additions & 0 deletions Converters/NullToVisibilityConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace PrettyScreenSHOT.Converters
{
/// <summary>
/// Converts null or empty values to Visibility
/// </summary>
public class NullToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool isInverse = parameter?.ToString() == "Inverse";
bool isNull = value == null || (value is string str && string.IsNullOrEmpty(str));

if (isInverse)
return isNull ? Visibility.Visible : Visibility.Collapsed;
else
return !isNull ? Visibility.Visible : Visibility.Collapsed;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
2 changes: 1 addition & 1 deletion Helpers/DebugHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class DebugHelper
[System.Diagnostics.Conditional("DEBUG")]
public static void ShowMessage(string title, string message)
{
System.Windows.MessageBox.Show(message, title);
MessageBoxHelper.Show(message, title);
}

/// <summary>
Expand Down
66 changes: 66 additions & 0 deletions Helpers/MessageBoxHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using System.Windows;
using Wpf.Ui.Controls;

namespace PrettyScreenSHOT.Helpers
{
/// <summary>
/// Helper for showing Wpf.Ui MessageBoxes with a simplified API
/// </summary>
public static class MessageBoxHelper
{
public static MessageBoxResult Show(
string message,
string title,
MessageBoxButton button = MessageBoxButton.OK)
{
return Application.Current.Dispatcher.Invoke(() =>
{
var messageBox = new Wpf.Ui.Controls.MessageBox
{
Title = title,
Content = message,
ButtonLeftName = GetButtonName(button, true),
ButtonRightName = GetButtonName(button, false)
};

var result = messageBox.ShowDialogAsync().GetAwaiter().GetResult();
return MapToMessageBoxResult(result, button);
});
}

private static string GetButtonName(MessageBoxButton button, bool isLeft)
{
return button switch
{
MessageBoxButton.OK => isLeft ? "OK" : string.Empty,
MessageBoxButton.OKCancel => isLeft ? "OK" : "Cancel",
MessageBoxButton.YesNo => isLeft ? "Yes" : "No",
MessageBoxButton.YesNoCancel => isLeft ? "Yes" : (isLeft ? "No" : "Cancel"),
_ => isLeft ? "OK" : string.Empty
};
}

private static MessageBoxResult MapToMessageBoxResult(
Wpf.Ui.Controls.MessageBoxResult wpfUiResult,
MessageBoxButton buttonType)
{
return buttonType switch
{
MessageBoxButton.OK => MessageBoxResult.OK,
MessageBoxButton.OKCancel => wpfUiResult == Wpf.Ui.Controls.MessageBoxResult.Primary
? MessageBoxResult.OK
: MessageBoxResult.Cancel,
MessageBoxButton.YesNo => wpfUiResult == Wpf.Ui.Controls.MessageBoxResult.Primary
? MessageBoxResult.Yes
: MessageBoxResult.No,
MessageBoxButton.YesNoCancel => wpfUiResult switch
{
Wpf.Ui.Controls.MessageBoxResult.Primary => MessageBoxResult.Yes,
Wpf.Ui.Controls.MessageBoxResult.Secondary => MessageBoxResult.No,
_ => MessageBoxResult.Cancel
},
_ => MessageBoxResult.None
};
}
}
}
21 changes: 21 additions & 0 deletions Themes/Base.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<!--
Base Theme for PrettyScreenSHOT

This file merges all theme resources into a single dictionary.
Include this in App.xaml to apply all custom styles and resources.
-->

<ResourceDictionary.MergedDictionaries>
<!-- Core theme resources -->
<ResourceDictionary Source="pack://application:,,,/Themes/Colors.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Themes/Typography.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Themes/Spacing.xaml"/>

<!-- Custom WPF UI overrides -->
<ResourceDictionary Source="pack://application:,,,/Themes/WpfUiCustom.xaml"/>
</ResourceDictionary.MergedDictionaries>

</ResourceDictionary>
34 changes: 34 additions & 0 deletions Themes/Colors.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<!--
Color Definitions for PrettyScreenSHOT

These colors complement WPF UI's theme system and provide brand-specific colors.
WPF UI provides automatic Light/Dark theme support through DynamicResource.
-->

<!-- Brand Colors -->
<SolidColorBrush x:Key="BrandPrimaryBrush" Color="#007ACC"/>
<SolidColorBrush x:Key="BrandSecondaryBrush" Color="#005A9E"/>

<!-- Status Colors -->
<SolidColorBrush x:Key="SuccessBrush" Color="#4CAF50"/>
<SolidColorBrush x:Key="WarningBrush" Color="#FF9800"/>
<SolidColorBrush x:Key="ErrorBrush" Color="#F44336"/>
<SolidColorBrush x:Key="InfoBrush" Color="#2196F3"/>

<!-- Semantic Colors -->
<SolidColorBrush x:Key="RecordingIndicatorBrush" Color="#F44336"/>
<SolidColorBrush x:Key="SavedIndicatorBrush" Color="#4CAF50"/>

<!--
Note: For theme-aware colors (that change with Light/Dark theme),
use WPF UI's built-in DynamicResources like:
- TextFillColorPrimaryBrush
- TextFillColorSecondaryBrush
- ControlFillColorDefaultBrush
- etc.
-->

</ResourceDictionary>
41 changes: 41 additions & 0 deletions Themes/Spacing.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<!--
Spacing Definitions for PrettyScreenSHOT

Defines consistent spacing values across the application.
Use these values for margins, padding, and spacing between elements.
-->

<!-- Spacing Values (System) -->
<System:Double xmlns:System="clr-namespace:System;assembly=mscorlib" x:Key="SpacingXSmall">4</System:Double>
<System:Double xmlns:System="clr-namespace:System;assembly=mscorlib" x:Key="SpacingSmall">8</System:Double>
<System:Double xmlns:System="clr-namespace:System;assembly=mscorlib" x:Key="SpacingMedium">12</System:Double>
<System:Double xmlns:System="clr-namespace:System;assembly=mscorlib" x:Key="SpacingLarge">16</System:Double>
<System:Double xmlns:System="clr-namespace:System;assembly=mscorlib" x:Key="SpacingXLarge">20</System:Double>
<System:Double xmlns:System="clr-namespace:System;assembly=mscorlib" x:Key="SpacingXXLarge">24</System:Double>

<!-- Thickness Values -->
<Thickness x:Key="PaddingSmall">8</Thickness>
<Thickness x:Key="PaddingMedium">12</Thickness>
<Thickness x:Key="PaddingLarge">16</Thickness>
<Thickness x:Key="PaddingXLarge">20</Thickness>

<Thickness x:Key="MarginSmall">0,0,0,8</Thickness>
<Thickness x:Key="MarginMedium">0,0,0,12</Thickness>
<Thickness x:Key="MarginLarge">0,0,0,16</Thickness>
<Thickness x:Key="MarginXLarge">0,0,0,20</Thickness>

<!-- Border Thickness -->
<Thickness x:Key="BorderThin">1</Thickness>
<Thickness x:Key="BorderMedium">2</Thickness>
<Thickness x:Key="BorderThick">3</Thickness>

<!-- Corner Radius -->
<CornerRadius x:Key="CornerRadiusSmall">4</CornerRadius>
<CornerRadius x:Key="CornerRadiusMedium">8</CornerRadius>
<CornerRadius x:Key="CornerRadiusLarge">12</CornerRadius>
<CornerRadius x:Key="CornerRadiusCircle">999</CornerRadius>

</ResourceDictionary>
77 changes: 77 additions & 0 deletions Themes/Typography.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<!--
Typography Definitions for PrettyScreenSHOT

Defines text styles for consistent typography across the application.
-->

<!-- Title Styles -->
<Style x:Key="TitleLargeText" TargetType="TextBlock">
<Setter Property="FontSize" Value="28"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Margin" Value="0,0,0,16"/>
</Style>

<Style x:Key="TitleText" TargetType="TextBlock">
<Setter Property="FontSize" Value="24"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Margin" Value="0,0,0,12"/>
</Style>

<Style x:Key="SubtitleText" TargetType="TextBlock">
<Setter Property="FontSize" Value="20"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Margin" Value="0,0,0,12"/>
</Style>

<!-- Header Styles -->
<Style x:Key="HeaderText" TargetType="TextBlock">
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Margin" Value="0,0,0,8"/>
</Style>

<Style x:Key="SubheaderText" TargetType="TextBlock">
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Margin" Value="0,0,0,8"/>
</Style>

<!-- Body Styles -->
<Style x:Key="BodyLargeText" TargetType="TextBlock">
<Setter Property="FontSize" Value="15"/>
<Setter Property="FontWeight" Value="Regular"/>
</Style>

<Style x:Key="BodyText" TargetType="TextBlock">
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="Regular"/>
</Style>

<Style x:Key="BodySmallText" TargetType="TextBlock">
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="Regular"/>
</Style>

<!-- Caption/Label Styles -->
<Style x:Key="CaptionText" TargetType="TextBlock">
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Regular"/>
<Setter Property="Foreground" Value="{DynamicResource TextFillColorSecondaryBrush}"/>
</Style>

<Style x:Key="LabelText" TargetType="TextBlock">
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Margin" Value="0,0,0,4"/>
</Style>

<!-- Monospace Styles -->
<Style x:Key="MonospaceText" TargetType="TextBlock">
<Setter Property="FontFamily" Value="Consolas, Courier New, monospace"/>
<Setter Property="FontSize" Value="13"/>
</Style>

</ResourceDictionary>
Loading
Loading