Skip to content

A macOS-style dock, widget bar and desktop widgets for Windows (WPF, .NET 10)

7.8 KB
Raw Blame
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:sys="clr-namespace:System;assembly=System.Runtime">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Palettes/Dark.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <FontFamily x:Key="InterfaceFont">Segoe UI</FontFamily>
    <sys:Double x:Key="MenuLabelWidth">286</sys:Double>
    <Thickness x:Key="MenuRowPadding">10,7</Thickness>
    <Thickness x:Key="MenuDividerInset">12,7</Thickness>
    <sys:Double x:Key="TextSizeBody">13</sys:Double>
    <sys:Double x:Key="TextSizeCaption">12</sys:Double>
    <sys:Double x:Key="DockHeadroom">44</sys:Double>
    <sys:Double x:Key="DockWindowHeight">108</sys:Double>
    <sys:Double x:Key="DockCellSize">50</sys:Double>
    <sys:Double x:Key="DockCellHeight">52</sys:Double>
    <sys:Double x:Key="DockTileSize">42</sys:Double>
    <CornerRadius x:Key="DockTileRadius">11</CornerRadius>
    <CornerRadius x:Key="DockGlassRadius">17</CornerRadius>
    <sys:Double x:Key="DockIconSize">32</sys:Double>
    <sys:Double x:Key="PreviewWidth">344</sys:Double>
    <sys:Double x:Key="PreviewHeight">236</sys:Double>
    <sys:Double x:Key="PreviewHeaderHeight">40</sys:Double>
    <sys:Double x:Key="PreviewGap">18</sys:Double>
    <sys:Double x:Key="DockHoverScale">1.85</sys:Double>
    <sys:Double x:Key="HoverDurationMs">120</sys:Double>
    <sys:Double x:Key="PreviewDurationMs">160</sys:Double>
    <Thickness x:Key="DockInset">12,0,12,6</Thickness>
    <Thickness x:Key="DockPadding">8,0,8,0</Thickness>
    <Thickness x:Key="ControlStroke">1</Thickness>
    <CornerRadius x:Key="DockRadius">18</CornerRadius>
    <!-- A theme's own texture and bottom band on the dock (Services/ThemePatterns.cs); none for Glass. -->
    <SolidColorBrush x:Key="DockPattern" Color="Transparent" />
    <SolidColorBrush x:Key="DockBand" Color="Transparent" />
    <sys:Double x:Key="DockBandHeight">0</sys:Double>
    <CornerRadius x:Key="ControlRadius">12</CornerRadius>
    <CornerRadius x:Key="PopupRadius">10</CornerRadius>
    <Style TargetType="ToolTip">
        <Setter Property="Background" Value="{DynamicResource SurfacePopup}" />
        <Setter Property="Foreground" Value="{DynamicResource TextPrimary}" />
        <Setter Property="FontFamily" Value="{StaticResource InterfaceFont}" />
        <Setter Property="FontSize" Value="{DynamicResource TextSizeCaption}" />
        <Setter Property="BorderBrush" Value="{DynamicResource StrokeSubtle}" />
        <Setter Property="Padding" Value="10,6" />
    </Style>

    <Style TargetType="ScrollBar">
        <Setter Property="Width" Value="12" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollBar">
                    <Track x:Name="PART_Track" IsDirectionReversed="True" Orientation="Vertical"
                           Minimum="{TemplateBinding Minimum}" Maximum="{TemplateBinding Maximum}"
                           Value="{TemplateBinding Value}" ViewportSize="{TemplateBinding ViewportSize}">
                        <Track.DecreaseRepeatButton><RepeatButton Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="False" /></Track.DecreaseRepeatButton>
                        <Track.Thumb>
                            <Thumb Margin="4,2" MinHeight="24">
                                <Thumb.Style>
                                    <Style TargetType="Thumb">
                                        <Setter Property="Background" Value="{DynamicResource MenuDivider}" />
                                        <Setter Property="Template"><Setter.Value><ControlTemplate TargetType="Thumb"><Border Background="{TemplateBinding Background}" CornerRadius="2" /></ControlTemplate></Setter.Value></Setter>
                                        <Style.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="Background" Value="{DynamicResource TextSecondary}" /></Trigger></Style.Triggers>
                                    </Style>
                                </Thumb.Style>
                            </Thumb>
                        </Track.Thumb>
                        <Track.IncreaseRepeatButton><RepeatButton Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="False" /></Track.IncreaseRepeatButton>
                    </Track>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Lucide Vector Icon Geometries (24x24 outline coordinate space) -->
    <StreamGeometry x:Key="IconOpen">M15 3h6v6 M10 14L21 3 M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6</StreamGeometry>
    <StreamGeometry x:Key="IconPin">M12 17v5 M9 10.76a2 2 0 0 1-1.11 1.79l-1.78 0.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-0.76a2 2 0 0 0-1.11-1.79l-1.78-0.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z</StreamGeometry>
    <StreamGeometry x:Key="IconUnpin">M12 17v5 M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89 M2 2l20 20 M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78 0.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11</StreamGeometry>
    <StreamGeometry x:Key="IconClose">M18 6L6 18 M6 6l12 12</StreamGeometry>
    <StreamGeometry x:Key="IconTerminate">M7.86 2h8.28L22 7.86v8.28L16.14 22H7.86L2 16.14V7.86L7.86 2z M12 8v4 M12 16h0.01</StreamGeometry>
    <StreamGeometry x:Key="IconSettings">M21 4h-7 M10 4H3 M14 2v4 M21 12h-9 M8 12H3 M12 10v4 M21 20h-5 M12 20H3 M16 18v4</StreamGeometry>
    <StreamGeometry x:Key="IconAlignLeft">M21 6H3 M15 12H3 M17 18H3</StreamGeometry>
    <StreamGeometry x:Key="IconAlignCenter">M21 6H3 M17 12H7 M19 18H5</StreamGeometry>
    <StreamGeometry x:Key="IconAlignRight">M21 6H3 M21 12H9 M21 18H7</StreamGeometry>
    <StreamGeometry x:Key="IconExit">M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4 M16 17l5-5-5-5 M21 12H9</StreamGeometry>
    <StreamGeometry x:Key="IconCheck">M20 6L9 17l-5-5</StreamGeometry>
    <StreamGeometry x:Key="IconLayout">M3 3h7v7H3z M14 3h7v7h-7z M14 14h7v7h-7z M3 14h7v7H3z</StreamGeometry>
    <StreamGeometry x:Key="IconEdit">M12 20h9 M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z</StreamGeometry>
    <StreamGeometry x:Key="IconDock">M3 17h18 M7 21h10 M12 3v9 M8 8l4 4 4-4</StreamGeometry>
    <StreamGeometry x:Key="IconMoon">M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z</StreamGeometry>
    <StreamGeometry x:Key="IconMonitor">M3 4h18v12H3z M8 20h8 M12 16v4</StreamGeometry>
    <StreamGeometry x:Key="IconSparkle">M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z M19 16l.8 2.2L22 19l-2.2.8L19 22l-.8-2.2L16 19l2.2-.8z</StreamGeometry>
    <StreamGeometry x:Key="IconPlus">M12 5v14 M5 12h14</StreamGeometry>
    <StreamGeometry x:Key="IconLeaf">M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.5 19 2c1 2 2 4.2 2 8 0 5.5-4.8 10-10 10z M2 21c0-3 1.9-5.4 5.1-6</StreamGeometry>
    <StreamGeometry x:Key="IconGauge">M12 14l4-4 M3.3 19a10 10 0 1 1 17.4 0</StreamGeometry>
    <StreamGeometry x:Key="IconSun">M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8 M12 2v2 M12 20v2 M4.9 4.9l1.4 1.4 M17.7 17.7l1.4 1.4 M2 12h2 M20 12h2 M4.9 19.1l1.4-1.4 M17.7 6.3l1.4-1.4</StreamGeometry>
    <StreamGeometry x:Key="IconChevronRight">M9 18l6-6-6-6</StreamGeometry>

    <!-- Vector Icon DataTemplate for MenuItems -->
    <DataTemplate DataType="{x:Type Geometry}">
        <Path Data="{Binding}"
              Stroke="{Binding (TextElement.Foreground), RelativeSource={RelativeSource AncestorType=ContentPresenter}}"
              StrokeThickness="1.6"
              StrokeStartLineCap="Round"
              StrokeEndLineCap="Round"
              StrokeLineJoin="Round"
              Width="14"
              Height="14"
              Stretch="Uniform"
              SnapsToDevicePixels="True"
              VerticalAlignment="Center"
              HorizontalAlignment="Center" />
    </DataTemplate>
</ResourceDictionary>