-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPipWindow.xaml
More file actions
145 lines (136 loc) · 6.49 KB
/
PipWindow.xaml
File metadata and controls
145 lines (136 loc) · 6.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<Window x:Class="PiPCrunchy.PipWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
mc:Ignorable="d"
Title="PiPStream - Picture-in-Picture"
Style="{StaticResource ModernWindow}"
Height="480" Width="640"
MinHeight="240" MinWidth="320"
Topmost="True"
WindowStyle="None"
ResizeMode="CanResizeWithGrip"
AllowsTransparency="False"
ShowInTaskbar="True"
WindowStartupLocation="Manual">
<Window.Resources>
<!-- Close Button Style -->
<Style x:Key="CloseButton" TargetType="Button">
<Setter Property="Background" Value="#C42B1C"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Width" Value="32"/>
<Setter Property="Height" Value="32"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="0">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#E81123"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#A20A0A"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Minimize Button Style -->
<Style x:Key="MinimizeButton" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Width" Value="32"/>
<Setter Property="Height" Value="32"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#3E3E3E"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#2D2D2D"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Border BorderBrush="{StaticResource AccentColor}"
BorderThickness="2"
Background="{StaticResource PrimaryBackground}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Custom Title Bar -->
<Border Grid.Row="0"
Background="{StaticResource SecondaryBackground}"
MouseLeftButtonDown="TitleBar_MouseLeftButtonDown">
<Grid Height="32">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Title Icon/Text -->
<TextBlock Grid.Column="0"
Text="PiP"
Foreground="{StaticResource AccentColor}"
FontWeight="Bold"
FontSize="12"
VerticalAlignment="Center"
Margin="8,0,0,0"/>
<!-- Title (URL) -->
<TextBlock Grid.Column="1"
x:Name="TitleTextBlock"
Text="Picture-in-Picture"
Foreground="{StaticResource TextSecondaryColor}"
FontSize="11"
VerticalAlignment="Center"
Margin="8,0,0,0"
TextTrimming="CharacterEllipsis"/>
<!-- Minimize Button -->
<Button Grid.Column="2"
Content="─"
Style="{StaticResource MinimizeButton}"
Click="MinimizeButton_Click"
ToolTip="Minimize"/>
<!-- Close Button -->
<Button Grid.Column="3"
Content="✕"
Style="{StaticResource CloseButton}"
Click="CloseButton_Click"
ToolTip="Close Picture-in-Picture"/>
</Grid>
</Border>
<!-- WebView2 Browser -->
<Border Grid.Row="1"
Background="Black">
<wv2:WebView2 x:Name="PipWebView"
NavigationCompleted="PipWebView_NavigationCompleted"/>
</Border>
</Grid>
</Border>
</Window>