Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented SidebarBorderWidth Settings #386

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
20 changes: 19 additions & 1 deletion SidebarDiagnostics/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion SidebarDiagnostics/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
Expand Down Expand Up @@ -1040,4 +1041,12 @@
<value>Shows the name of the computer.</value>
<comment>Settings show machine name tooltip</comment>
</data>
</root>
<data name="SettingsSidebarBorderWidth" xml:space="preserve">
<value>Sidebar Border Width</value>
<comment>Settings sidebar border width label</comment>
</data>
<data name="SettingsSidebarBorderWidthTooltip" xml:space="preserve">
<value>Width of the sidebar border in pixels.</value>
<comment>Settings sidebar border width tooltip</comment>
</data>
</root>
17 changes: 17 additions & 0 deletions SidebarDiagnostics/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,23 @@ public int SidebarWidth
}
}

private int _sidebarBorderWidth { get; set; } = 12;

[JsonProperty]
public int SidebarBorderWidth
{
get
{
return _sidebarBorderWidth;
}
set
{
_sidebarBorderWidth = value;

NotifyPropertyChanged("SidebarBorderWidth");
}
}

private bool _autoBGColor { get; set; } = false;

[JsonProperty]
Expand Down
7 changes: 7 additions & 0 deletions SidebarDiagnostics/Settings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="38px"></RowDefinition>
<RowDefinition Height="38px"></RowDefinition>
</Grid.RowDefinitions>

<Label Grid.Column="0" Grid.Row="0" Content="{x:Static frame:Resources.SettingsSidebarWidth}" />
Expand Down Expand Up @@ -207,6 +208,12 @@

<Label Grid.Column="0" Grid.Row="12" Content="{x:Static frame:Resources.SettingsDateFormat}" />
<ComboBox Grid.Column="1" Grid.Row="12" ItemsSource="{Binding Path=DateSettingItems}" DisplayMemberPath="Display" SelectedValue="{Binding Path=DateSetting, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=ShowClock, Mode=OneWay}" ToolTip="{x:Static frame:Resources.SettingsDateFormatTooltip}" />

<Label Grid.Column="0" Grid.Row="13" Content="{x:Static frame:Resources.SettingsSidebarBorderWidth}" />
<DockPanel Grid.Column="1" Grid.Row="13">
<TextBox Text="{Binding ElementName=SidebarBorderWidthSlider, Path=Value, UpdateSourceTrigger=PropertyChanged}" PreviewTextInput="NumberBox_PreviewTextInput" />
<Slider x:Name="SidebarBorderWidthSlider" Value="{Binding Path=SidebarBorderWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Minimum="0" Maximum="20" TickFrequency="1" LargeChange="2" ToolTip="{x:Static frame:Resources.SettingsSidebarBorderWidthTooltip}" />
</DockPanel>
</Grid>
</TabItem>
<TabItem Header="{x:Static frame:Resources.SettingsMonitorsTab}">
Expand Down
18 changes: 18 additions & 0 deletions SidebarDiagnostics/SettingsModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public SettingsModel(Sidebar sidebar)
AutoUpdate = Framework.Settings.Instance.AutoUpdate;
RunAtStartup = Framework.Settings.Instance.RunAtStartup;
SidebarWidth = Framework.Settings.Instance.SidebarWidth;
SidebarBorderWidth = Framework.Settings.Instance.SidebarBorderWidth;
AutoBGColor = Framework.Settings.Instance.AutoBGColor;
BGColor = Framework.Settings.Instance.BGColor;
BGOpacity = Framework.Settings.Instance.BGOpacity;
Expand Down Expand Up @@ -148,6 +149,7 @@ public void Save()
Framework.Settings.Instance.AutoUpdate = AutoUpdate;
Framework.Settings.Instance.RunAtStartup = RunAtStartup;
Framework.Settings.Instance.SidebarWidth = SidebarWidth;
Framework.Settings.Instance.SidebarBorderWidth = SidebarBorderWidth;
Framework.Settings.Instance.AutoBGColor = AutoBGColor;
Framework.Settings.Instance.BGColor = BGColor;
Framework.Settings.Instance.BGOpacity = BGOpacity;
Expand Down Expand Up @@ -576,6 +578,22 @@ public int SidebarWidth
}
}

private int _sidebarBorderWidth { get; set; }

public int SidebarBorderWidth
{
get
{
return _sidebarBorderWidth;
}
set
{
_sidebarBorderWidth = value;

NotifyPropertyChanged("SidebarBorderWidth");
}
}

private bool _autoBGColor { get; set; }

public bool AutoBGColor
Expand Down
8 changes: 4 additions & 4 deletions SidebarDiagnostics/Sidebar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
</Ellipse.Style>
</Ellipse>

<DockPanel Style="{StaticResource MainPanel}">
<StackPanel x:Name="WindowControls" Style="{StaticResource MenuBar}">
<DockPanel Style="{StaticResource MainPanel}" Margin="0">
<StackPanel x:Name="WindowControls" Style="{StaticResource MenuBar}" Margin="{Binding Source={x:Static frame:Settings.Instance}, Path=SidebarBorderWidth, Mode=OneWay}">
<Button Click="GraphButton_Click" Style="{StaticResource MenuButton}">
<Path Width="12" Height="12" Data="M 17,19L 20,19L 20,54L 59,54L 59,57L 17,57L 17,19 Z M 22,52L 22,47.25L 32,37L 45,43.75L 57,25L 59,27L 46,48L 32.25,41L 22,52 Z" />
</Button>
Expand All @@ -64,8 +64,8 @@
</Button>
</StackPanel>

<ScrollViewer Style="{StaticResource ContentView}">
<StackPanel Style="{StaticResource ContentPanel}">
<ScrollViewer Style="{StaticResource ContentView}" Margin="{Binding Source={x:Static frame:Settings.Instance}, Path=SidebarBorderWidth, Mode=OneWay}">
<StackPanel Style="{StaticResource ContentPanel}" Margin="0">
<ContentControl>
<ContentControl.Style>
<Style TargetType="{x:Type ContentControl}">
Expand Down
28 changes: 13 additions & 15 deletions SidebarDiagnostics/SidebarDiagnostics.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\squirrel.windows.1.9.1\build\squirrel.windows.props" Condition="Exists('..\packages\squirrel.windows.1.9.1\build\squirrel.windows.props')" />
<Import Project="..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props" Condition="Exists('..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -111,23 +111,23 @@
<Reference Include="Microsoft.Win32.TaskScheduler, Version=2.8.15.0, Culture=neutral, PublicKeyToken=c416bc1b32d97233, processorArchitecture=MSIL">
<HintPath>..\packages\TaskScheduler.2.8.15\lib\net452\Microsoft.Win32.TaskScheduler.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll</HintPath>
<Reference Include="Mono.Cecil, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.11.2\lib\net40\Mono.Cecil.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
<Reference Include="Mono.Cecil.Mdb, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.11.2\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
<Reference Include="Mono.Cecil.Pdb, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.11.2\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
<Reference Include="Mono.Cecil.Rocks, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.11.2\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.1.9.1\lib\Net45\NuGet.Squirrel.dll</HintPath>
<HintPath>..\packages\squirrel.windows.2.0.1\lib\Net45\NuGet.Squirrel.dll</HintPath>
</Reference>
<Reference Include="OxyPlot, Version=1.0.0.0, Culture=neutral, PublicKeyToken=638079a8f0bd61e9, processorArchitecture=MSIL">
<HintPath>..\packages\OxyPlot.Core.1.0.0\lib\net45\OxyPlot.dll</HintPath>
Expand All @@ -143,8 +143,8 @@
<Reference Include="Splat, Version=5.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Splat.5.1.1\lib\net461\Splat.dll</HintPath>
</Reference>
<Reference Include="Squirrel, Version=1.9.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.1.9.1\lib\Net45\Squirrel.dll</HintPath>
<Reference Include="Squirrel, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.2.0.1\lib\Net45\Squirrel.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down Expand Up @@ -422,10 +422,8 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\squirrel.windows.1.9.1\build\squirrel.windows.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\squirrel.windows.1.9.1\build\squirrel.windows.props'))" />
<Error Condition="!Exists('..\packages\squirrel.windows.1.9.1\build\squirrel.windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\squirrel.windows.1.9.1\build\squirrel.windows.targets'))" />
<Error Condition="!Exists('..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props'))" />
</Target>
<Import Project="..\packages\squirrel.windows.1.9.1\build\squirrel.windows.targets" Condition="Exists('..\packages\squirrel.windows.1.9.1\build\squirrel.windows.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
4 changes: 2 additions & 2 deletions SidebarDiagnostics/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<package id="Extended.Wpf.Toolkit" version="3.5.0" targetFramework="net471" />
<package id="gong-wpf-dragdrop" version="2.0.4" targetFramework="net471" />
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.8" targetFramework="net461" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net471" />
<package id="Mono.Cecil" version="0.11.2" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net471" />
<package id="OxyPlot.Core" version="1.0.0" targetFramework="net461" />
<package id="OxyPlot.Wpf" version="1.0.0" targetFramework="net461" />
<package id="SharpCompress" version="0.17.1" targetFramework="net471" />
<package id="Splat" version="5.1.1" targetFramework="net471" />
<package id="squirrel.windows" version="1.9.1" targetFramework="net471" />
<package id="squirrel.windows" version="2.0.1" targetFramework="net472" />
<package id="System.Drawing.Primitives" version="4.3.0" targetFramework="net471" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net471" />
<package id="TaskScheduler" version="2.8.15" targetFramework="net471" />
Expand Down