Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit 1200708

Browse files
committed
Significant UI overhaul, code has been split between pages sorta sorry.
1 parent 65ce56e commit 1200708

File tree

11 files changed

+667
-300
lines changed

11 files changed

+667
-300
lines changed

ActiveDesktop/ActiveDesktop.csproj

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@
6060
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
6161
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
6262
</Reference>
63+
<Reference Include="ModernWpf, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
64+
<HintPath>..\packages\ModernWpfUI.0.9.0\lib\net462\ModernWpf.dll</HintPath>
65+
</Reference>
66+
<Reference Include="ModernWpf.Controls, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
67+
<HintPath>..\packages\ModernWpfUI.0.9.0\lib\net462\ModernWpf.Controls.dll</HintPath>
68+
</Reference>
6369
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
6470
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
6571
</Reference>
@@ -84,6 +90,9 @@
8490
<Reference Include="System" />
8591
<Reference Include="System.Data" />
8692
<Reference Include="System.Drawing" />
93+
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
94+
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
95+
</Reference>
8796
<Reference Include="System.Xml" />
8897
<Reference Include="Microsoft.CSharp" />
8998
<Reference Include="System.Core" />
@@ -105,6 +114,15 @@
105114
<Generator>MSBuild:Compile</Generator>
106115
<SubType>Designer</SubType>
107116
</ApplicationDefinition>
117+
<Compile Include="Views\CurrentApps.xaml.cs">
118+
<DependentUpon>CurrentApps.xaml</DependentUpon>
119+
</Compile>
120+
<Compile Include="Views\SavedApps.xaml.cs">
121+
<DependentUpon>SavedApps.xaml</DependentUpon>
122+
</Compile>
123+
<Compile Include="Views\Settings.xaml.cs">
124+
<DependentUpon>Settings.xaml</DependentUpon>
125+
</Compile>
108126
<Page Include="ADPVideoWallpaper.xaml">
109127
<SubType>Designer</SubType>
110128
<Generator>MSBuild:Compile</Generator>
@@ -124,6 +142,18 @@
124142
<DependentUpon>MainWindow.xaml</DependentUpon>
125143
<SubType>Code</SubType>
126144
</Compile>
145+
<Page Include="Views\CurrentApps.xaml">
146+
<SubType>Designer</SubType>
147+
<Generator>MSBuild:Compile</Generator>
148+
</Page>
149+
<Page Include="Views\SavedApps.xaml">
150+
<SubType>Designer</SubType>
151+
<Generator>MSBuild:Compile</Generator>
152+
</Page>
153+
<Page Include="Views\Settings.xaml">
154+
<SubType>Designer</SubType>
155+
<Generator>MSBuild:Compile</Generator>
156+
</Page>
127157
</ItemGroup>
128158
<ItemGroup>
129159
<Compile Include="Properties\AssemblyInfo.cs">
@@ -174,6 +204,8 @@
174204
</PropertyGroup>
175205
<Error Condition="!Exists('..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props'))" />
176206
<Error Condition="!Exists('..\packages\Fody.6.2.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.2.0\build\Fody.targets'))" />
207+
<Error Condition="!Exists('..\packages\System.Runtime.WindowsRuntime.4.7.0\build\net461\System.Runtime.WindowsRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Runtime.WindowsRuntime.4.7.0\build\net461\System.Runtime.WindowsRuntime.targets'))" />
177208
</Target>
178209
<Import Project="..\packages\Fody.6.2.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.2.0\build\Fody.targets')" />
210+
<Import Project="..\packages\System.Runtime.WindowsRuntime.4.7.0\build\net461\System.Runtime.WindowsRuntime.targets" Condition="Exists('..\packages\System.Runtime.WindowsRuntime.4.7.0\build\net461\System.Runtime.WindowsRuntime.targets')" />
179211
</Project>

ActiveDesktop/App.xaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:local="clr-namespace:ActiveDesktop"
5-
StartupUri="MainWindow.xaml">
5+
StartupUri="MainWindow.xaml"
6+
xmlns:ui="http://schemas.modernwpf.com/2019">
67
<Application.Resources>
7-
8+
<ResourceDictionary>
9+
<ResourceDictionary.MergedDictionaries>
10+
<ui:ThemeResources />
11+
<ui:XamlControlsResources />
12+
<!-- Other merged dictionaries here -->
13+
</ResourceDictionary.MergedDictionaries>
14+
<!-- Other app resources here -->
15+
</ResourceDictionary>
816
</Application.Resources>
917
</Application>

ActiveDesktop/MainWindow.xaml

Lines changed: 24 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:tb="http://www.hardcodet.net/taskbar"
7-
mc:Ignorable="d" Height="408.917" KeyDown="OnKeyDownHandler" KeyUp="OnKeyUpHandler" Width="674" ResizeMode="NoResize" Title="Active Desktop Plus">
7+
mc:Ignorable="d" Height="497" Width="372" KeyDown="OnKeyDownHandler" KeyUp="OnKeyUpHandler" ResizeMode="NoResize" Title="Active Desktop Plus"
8+
xmlns:ui="http://schemas.modernwpf.com/2019"
9+
ui:WindowHelper.UseModernWindowStyle="True">
810

911
<!-- I don't actually understand XAML at all give my my WinForms back.
1012
Seriously, the tab UI thing I had before actually worked why did I switch to this mess?
1113
Also if you're reading this yes I am going to redo the UI but if I can't get a pile of buttons working what even is the point in going on -->
1214

13-
<Grid Height="376" VerticalAlignment="Top">
15+
16+
17+
<Grid>
1418
<tb:TaskbarIcon x:Name="tbi" IconSource="/desktop.ico" ToolTipText="Active Desktop Plus">
1519
<tb:TaskbarIcon.ContextMenu>
1620
<ContextMenu>
@@ -19,50 +23,25 @@
1923
</ContextMenu>
2024
</tb:TaskbarIcon.ContextMenu>
2125
</tb:TaskbarIcon>
26+
<ui:NavigationView
27+
x:Name="NavView"
28+
IsBackButtonVisible="Visible"
29+
IsBackEnabled="False"
30+
IsPaneOpen="True"
31+
Loaded="NavView_Loaded"
32+
SelectionChanged="NavView_SelectionChanged"
33+
ItemInvoked="NavView_ItemInvoked" PaneDisplayMode="LeftCompact">
2234

23-
<Rectangle Fill="#06000000" Stroke="#22000000" Height="164" VerticalAlignment="Top" Margin="332,18,0,0" HorizontalAlignment="Left" Width="317"/>
24-
<Rectangle Fill="#06000000" Stroke="#22000000" Height="153" VerticalAlignment="Top" Margin="9,210,0,0" HorizontalAlignment="Left" Width="317"/>
25-
<Rectangle Fill="#06000000" Stroke="#22000000" Height="153" VerticalAlignment="Top" Margin="332,210,0,0" HorizontalAlignment="Left" Width="317"/>
26-
<Rectangle Fill="#06000000" Stroke="#22000000" Height="164" VerticalAlignment="Top" Margin="9,18,0,0" HorizontalAlignment="Left" Width="317"/>
35+
<ui:NavigationView.MenuItems>
36+
<ui:NavigationViewItem Icon="AllApps" Tag="Page_Current">
37+
<TextBlock Tag="Nav_Current">Current Apps</TextBlock>
38+
</ui:NavigationViewItem>
39+
<ui:NavigationViewItem Icon="Save" Tag="Page_Saved">
40+
<TextBlock Tag="Nav_Saved">Saved Apps</TextBlock>
41+
</ui:NavigationViewItem>
42+
</ui:NavigationView.MenuItems>
2743

28-
<Label x:Name="HandleLabel" Content="Selected handle: " HorizontalAlignment="Left" Margin="11,50,0,0" VerticalAlignment="Top" Width="104" Height="26"/>
29-
<TextBox x:Name="HwndInputTextBox" Height="26" Margin="120,50,0,0" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" Width="205" ToolTip="The handle of the currently selected window"/>
30-
<Button x:Name="ApplyHwndButton" Content="Send to Desktop" Margin="10,81,0,0" Click="ApplyHwndButton_Click" HorizontalAlignment="Left" Width="315" Height="27" VerticalAlignment="Top" IsDefault="True" ToolTip="Send the selected window to the desktop"/>
31-
<ListBox x:Name="HandleListBox" Margin="333,19,0,0" Height="130" VerticalAlignment="Top" HorizontalAlignment="Left" Width="315" ToolTip="List of apps currently open on the desktop">
32-
<UniformGrid Columns="2"/>
33-
</ListBox>
34-
<Button x:Name="BorderlessButton" Content="Toggle Borders" Margin="120,121,0,0" HorizontalContentAlignment="Center" Height="27" VerticalAlignment="Top" Click="BorderlessButton_Click" HorizontalAlignment="Left" Width="98" ToolTip="Hide and show the selected window's borders"/>
35-
<Button x:Name="LockButton" Content="Toggle Lock" Margin="227,121,0,0" HorizontalContentAlignment="Center" Height="27" VerticalAlignment="Top" Click="LockButton_Click" HorizontalAlignment="Left" Width="98" ToolTip="Lock the selected window, preventing you from interacting or moving it"/>
36-
<Button x:Name="FixButton" Content="Fix Alignment" Margin="120,154,0,0" HorizontalContentAlignment="Center" Height="27" VerticalAlignment="Top" HorizontalAlignment="Left" Width="98" Click="FixButton_Click" ToolTip="If your window appears partially or completely off-screen, this button might fix it"/>
37-
<Button x:Name="CloseButton" Content="Close" Margin="227,154,0,0" HorizontalContentAlignment="Center" Height="27" VerticalAlignment="Top" Click="CloseButton_Click" HorizontalAlignment="Left" Width="98" ToolTip="Close the selected window"/>
38-
<Button x:Name="SaveButton" Content="Copy selected app to Saved Apps" Margin="333,154,0,0" HorizontalContentAlignment="Center" Height="27" VerticalAlignment="Top" Click="SaveButton_Click" HorizontalAlignment="Left" Width="315" ToolTip="Copies the properties of the selected app to the Saved Apps section below, so you can quickly add it to your list of saved apps"/>
39-
<TextBox x:Name="CmdBox" Margin="10,211,0,0" Text="Command Line" HorizontalAlignment="Left" Width="236" Height="21" VerticalAlignment="Top" LostFocus="CmdBox_LostFocus" GotFocus="CmdBox_GotFocus" ToolTip="Path to the executable you wish to start. &quot;MEDIA&quot; will set a video as your wallpaper"/>
40-
<TextBox x:Name="FlagBox" Margin="10,238,0,0" Text="Flags" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" Width="236" LostFocus="FlagBox_LostFocus" GotFocus="FlagBox_GotFocus" ToolTip="Any paths, flags or switches you want your application to start with. If the command-line is &quot;MEDIA&quot;, then this box acts as a path to the video you wish to play."/>
41-
<TextBox x:Name="XBox" Margin="10,262,0,0" Text="X" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" Width="115" PreviewMouseDown="ResetMonitorSelectButton" GotFocus="XBox_GotFocus" LostFocus="XBox_LostFocus" ToolTip="The X coordinate of the top-left of your window"/>
42-
<TextBox x:Name="YBox" Margin="131,262,0,0" Text="Y" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" Width="115" PreviewMouseDown="ResetMonitorSelectButton" GotFocus="YBox_GotFocus" LostFocus="YBox_LostFocus" ToolTip="The Y coordinate of the top-left of your window"/>
43-
<TextBox x:Name="WidthBox" Margin="10,287,0,0" Text="Width" HorizontalAlignment="Left" Width="115" Height="20" VerticalAlignment="Top" PreviewMouseDown="ResetMonitorSelectButton" GotFocus="WidthBox_GotFocus" LostFocus="WidthBox_LostFocus" ToolTip="The width of the window"/>
44-
<TextBox x:Name="HeightBox" Margin="131,287,0,0" Text="Height" HorizontalAlignment="Left" Width="115" Height="20" VerticalAlignment="Top" PreviewMouseDown="ResetMonitorSelectButton" GotFocus="HeightBox_GotFocus" LostFocus="HeightBox_LostFocus" ToolTip="The height of the window"/>
45-
<TextBox x:Name="NameBox" Margin="10,311,0,0" Text="Friendly Name" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" Width="115" GotFocus="NameBox_GotFocus" LostFocus="NameBox_LostFocus" ToolTip="The name you want this app to appear as in the list of saved apps"/>
46-
<TextBox x:Name="TimeBox" Margin="131,311,0,0" Text="Wait Time" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" Width="115" GotFocus="TimeBox_GotFocus" LostFocus="TimeBox_LostFocus" ToolTip="How long ADP should wait before attempting to send the app to the desktop"/>
47-
<Button x:Name="AddButton" Content=" Add to&#xD;&#xA;saved apps" Margin="250,311,0,0" HorizontalContentAlignment="Center" Click="AddButton_Click" Height="51" VerticalAlignment="Top" HorizontalAlignment="Left" Width="75" ToolTip="Adds the configured app to the list of saved apps"/>
48-
<ListBox x:Name="SavedListBox" Margin="333,211,0,0" HorizontalAlignment="Left" Width="315" Height="126" VerticalAlignment="Top" RenderTransformOrigin="0.365,0.679" ToolTip="List of apps saved in the config"/>
49-
<Button x:Name="RemoveButton" Content="Remove" Margin="440,342,0,0" HorizontalContentAlignment="Center" Height="20" VerticalAlignment="Top" Click="RemoveButton_Click" HorizontalAlignment="Left" Width="101" ToolTip="Removes an entry on the saved apps list" />
50-
<Button x:Name="TestButton" Content="Launch" Margin="547,342,0,0" HorizontalContentAlignment="Center" Height="20" VerticalAlignment="Top" Click="TestButton_Click" HorizontalAlignment="Left" Width="101" ToolTip="Launches the selected app from the list"/>
51-
<Button x:Name="WriteButton" Content="Save changes" Margin="333,342,0,0" HorizontalContentAlignment="Center" Height="20" VerticalAlignment="Top" Click="WriteButton_Click" HorizontalAlignment="Left" Width="101" IsEnabled="False" Foreground="Red" ToolTip="Saves changes to the config file"/>
52-
<Separator Height="11" Margin="10,188,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="638" Background="Black"/>
53-
<CheckBox x:Name="LockedCheckBox" Content="Start Locked" HorizontalAlignment="Left" Margin="11,332,0,0" VerticalAlignment="Top" Width="110" Height="15" ToolTip="Start the app with interaction disabled"/>
54-
<CheckBox x:Name="AutostartCheckBox" Content="Start with ADP" HorizontalAlignment="Left" Margin="11,347,0,0" VerticalAlignment="Top" Width="100" Height="15" ToolTip="Starts the app as soon as ADP opens"/>
55-
<Label x:Name="WindowLabel" Content="Selected window: " HorizontalAlignment="Left" Margin="11,19,0,0" VerticalAlignment="Top" Width="109" Height="26"/>
56-
<TextBox x:Name="TitleTextBox" Height="26" Margin="120,19,0,0" VerticalAlignment="Top" Focusable="False" HorizontalAlignment="Left" Width="205" MaxLines="1" ToolTip="The name of the currently selected window"/>
57-
<Separator Height="13" Margin="10,108,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="315" Background="Black"/>
58-
<Label x:Name="SavedAppsLabel" Content="Saved Apps" HorizontalAlignment="Left" Margin="10,188,0,0" VerticalAlignment="Top" Height="26" Width="72"/>
59-
<Separator Height="11" Margin="10,-4,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="638" Background="Black"/>
60-
<Label x:Name="CurrentAppsLabel" Content="Current Apps" HorizontalAlignment="Left" Margin="10,-4,0,0" VerticalAlignment="Top" Height="26" Width="80"/>
61-
<CheckBox x:Name="StartupCheckBox" Content="Run at startup" HorizontalAlignment="Left" Margin="10,128,0,0" VerticalAlignment="Top" Checked="StartupCheckBox_Checked" Unchecked="StartupCheckBox_Unchecked" Height="15" Width="95" ToolTip="Add ADP to startup apps so it opens when you log in"/>
62-
<CheckBox x:Name="DarkThemeCheckBox" Content="Dark Theme" HorizontalAlignment="Left" Margin="10,161,0,0" VerticalAlignment="Top" IsEnabled="False" Height="15" Width="84" ToolTip="Enable the dark theme for ADP's UI"/>
63-
<Button x:Name="MonitorSelectButton" Content=" Select &#xD;&#xA;Monitor" HorizontalAlignment="Left" Margin="250,262,0,0" VerticalAlignment="Top" Width="75" Height="45" Click="MonitorSelectButton_Click" ToolTip="Cycles through all monitors and automatically fills out their X, Y, Width and Height"/>
64-
<Button x:Name="MediaButton" Content="Use Video" HorizontalAlignment="Left" Margin="250,211,0,0" VerticalAlignment="Top" Width="75" Height="47" Click="MediaButton_Click" ToolTip="Click this to add a video as opposed to an app"/>
65-
<CheckBox x:Name="PinnedCheckBox" Content="Start pinned" HorizontalAlignment="Left" Margin="131,332,0,0" VerticalAlignment="Top" ToolTip="Removes the borders from the app after its started"/>
66-
<CheckBox x:Name="FixCheckBox" Content="Fix alignment" HorizontalAlignment="Left" Margin="131,347,0,0" VerticalAlignment="Top" ToolTip="Attempts to fix the alignment of an app once it's opened"/>
44+
<Frame x:Name="ContentFrame" NavigationUIVisibility="Hidden"></Frame>
45+
</ui:NavigationView>
6746
</Grid>
6847
</Window>

0 commit comments

Comments
 (0)