Skip to content

Commit

Permalink
+ Multiple styling changes made to resemble Rock more.
Browse files Browse the repository at this point in the history
  • Loading branch information
cabal95 committed Mar 26, 2018
1 parent 837ce9a commit 0bc398f
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 24 deletions.
63 changes: 63 additions & 0 deletions RockDevBooster/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,33 @@
<ResourceDictionary Source="/Rock.Wpf;component/StyleResources.xaml" />
</ResourceDictionary.MergedDictionaries>

<!-- Button Style: Menu Icon-->
<Style x:Key="buttonStyleMenuIcon"
TargetType="{x:Type Button}">
<Setter Property="FontFamily" Value="./resources/#FontAwesome" />
<Setter Property="Width" Value="80" />
<Setter Property="Height" Value="65" />
<Setter Property="FontSize" Value="32" />
<Setter Property="Foreground" Value="White" />
<Setter Property="BorderThickness" Value="0 0 0 1" />
<Setter Property="BorderBrush" Value="#4d4b46" />
<Setter Property="Background" Value="#3a3935"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#4f4e48"/>
</Trigger>
</Style.Triggers>
</Style>

<!-- Button Style: Icon-->
<Style x:Key="buttonStyleIcon"
BasedOn="{StaticResource buttonStyle}"
Expand Down Expand Up @@ -64,6 +91,42 @@
<Setter Property="BorderBrush" Value="#902c2c" />
</Style>

<Style x:Key="menuTabControl" TargetType="{x:Type TabControl}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TabPanel
Name="HeaderPanel"
Grid.Row="0"
Panel.ZIndex="1"
Margin="1,2,4,-1"
IsItemsHost="True"
KeyboardNavigation.TabIndex="1"
Background="Transparent" />
<Border
Name="Border"
Grid.Row="1"
BorderThickness="0"
KeyboardNavigation.TabNavigation="Local"
KeyboardNavigation.DirectionalNavigation="Contained"
KeyboardNavigation.TabIndex="2" >
<ContentPresenter
Name="PART_SelectedContentHost"
Margin="0"
ContentSource="SelectedContent" />
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
8 changes: 4 additions & 4 deletions RockDevBooster/GitHubVersions.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Grid>
<Label
HorizontalAlignment="Left"
Margin="0,10,0,0"
Margin="10,8,0,0"
Content="Version"
VerticalAlignment="Top"
Width="75"
Expand All @@ -23,7 +23,7 @@

<Label
HorizontalAlignment="Left"
Margin="0,38,0,0"
Margin="10,35,0,0"
Content="Build With"
VerticalAlignment="Top"
Width="75"
Expand All @@ -41,7 +41,7 @@
Style="{StaticResource buttonStyleIconAction}"/>

<TextBlock Name="txtStatus"
Margin="0,105,0,0"
Margin="10,105,10,0"
TextWrapping="Wrap"
Text="Status"
TextAlignment="Center" Height="16" VerticalAlignment="Top"/>
Expand All @@ -53,7 +53,7 @@
VerticalScrollBarVisibility="Visible"
Text="{Binding Text, Mode=OneWay}"
FontFamily="Consolas"
BorderThickness="1"
BorderThickness="0 1 0 0"
IsReadOnly="True"
/>
</Grid>
Expand Down
20 changes: 10 additions & 10 deletions RockDevBooster/InstancesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
<Grid>
<Label
HorizontalAlignment="Left"
Margin="0,10,0,0"
Margin="10,8,0,0"
Content="Instance"
VerticalAlignment="Top"
Width="67"
Width="65"
Style="{StaticResource labelStyleBold}"
/>
<ComboBox Name="cbInstances"
Margin="72,10,10,0"
Margin="80,10,10,0"
VerticalAlignment="Top"
SelectionChanged="cbInstances_SelectionChanged"
/>

<Label HorizontalAlignment="Left"
Margin="0,39,0,0"
Margin="10,37,0,0"
Content="Port"
VerticalAlignment="Top"
Width="67"
Width="65"
Style="{StaticResource labelStyleBold}"
/>
<TextBox Name="txtPort"
Margin="72,37,10,0"
Margin="80,37,10,0"
TextWrapping="Wrap"
Text="6229"
VerticalAlignment="Top"
Expand All @@ -40,15 +40,15 @@

<Button Name="btnStartStop"
Content="&#xF04B; Start"
Margin="72,72,0,0"
Margin="80,72,0,0"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Width="65"
Click="btnStartStop_Click"
Style="{StaticResource buttonStyleIconSuccess}"
/>
<Button Name="btnMakeTemplate"
Content="&#xF1B3; Make Template"
Content="&#xF0C5; Make Template"
Margin="0,72,88,0"
VerticalAlignment="Top"
HorizontalAlignment="Right"
Expand All @@ -65,7 +65,7 @@
Style="{StaticResource buttonStyleIconDanger}"/>

<TextBlock Name="txtStatus"
Margin="0,113,0,0"
Margin="10,113,10,0"
Text="Instance"
TextAlignment="Center"
VerticalAlignment="Top"
Expand All @@ -78,7 +78,7 @@
VerticalScrollBarVisibility="Visible"
Text="{Binding Text, Mode=OneWay}"
FontFamily="Consolas"
BorderThickness="1"
BorderThickness="0 1 0 0"
IsReadOnly="True"
/>
</Grid>
Expand Down
35 changes: 34 additions & 1 deletion RockDevBooster/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
MinWidth="400"
Background="#dbd5cb">
<Grid>
<TabControl Background="#dbd5cb">
<TabControl Name="tcMain" BorderThickness="0" Background="#dbd5cb" Margin="80,0,0,0" Style="{StaticResource menuTabControl}">
<TabItem Header="Instances">
<Grid Background="#dbd5cb">
<local:InstancesView />
Expand All @@ -34,5 +34,38 @@
</Grid>
</TabItem>
</TabControl>
<Grid
HorizontalAlignment="Left"
Margin="0,0,0,0"
Width="80"
Background="#3a3935">
<Button
Content="&#xf04b;"
Click="btnMenu_Click"
Style="{StaticResource buttonStyleMenuIcon}"
CommandParameter="Instances"
VerticalAlignment="Top" />
<Button
Content="&#xf09b;"
Margin="0,65,0,0"
Click="btnMenu_Click"
Style="{StaticResource buttonStyleMenuIcon}"
CommandParameter="GitHub Versions"
VerticalAlignment="Top" />
<Button
Content="&#xf0c5;"
Margin="0,130,0,0"
Click="btnMenu_Click"
Style="{StaticResource buttonStyleMenuIcon}"
CommandParameter="Templates"
VerticalAlignment="Top" />
<Button
Content="&#xf1b2;"
Margin="0,195,0,0"
Click="btnMenu_Click"
Style="{StaticResource buttonStyleMenuIcon}"
CommandParameter="Package"
VerticalAlignment="Top" />
</Grid>
</Grid>
</Window>
11 changes: 11 additions & 0 deletions RockDevBooster/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public partial class MainWindow : Window
public MainWindow()
{
InitializeComponent();

foreach ( TabItem item in tcMain.Items )
{
item.Visibility = Visibility.Collapsed;
}
}

protected override void OnClosing( CancelEventArgs e )
Expand All @@ -40,5 +45,11 @@ protected override void OnSourceInitialized( EventArgs e )
base.OnSourceInitialized( e );
WindowPlacement.SetPlacement( new WindowInteropHelper( this ).Handle, Settings.Default.MainWindowPlacement );
}

private void btnMenu_Click( object sender, RoutedEventArgs e )
{
string name = ( ( Button ) sender ).CommandParameter.ToString();
tcMain.SelectedIndex = tcMain.Items.Cast<TabItem>().ToList().FindIndex( i => i.Header.ToString() == name );
}
}
}
6 changes: 3 additions & 3 deletions RockDevBooster/PackageView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Click="btnBuildPackage_Click"
Style="{StaticResource buttonStyleIconAction}"/>
<TextBlock x:Name="txtStatus"
Margin="0,78,0,0"
Margin="10,78,10,0"
TextWrapping="Wrap"
Text="Status"
TextAlignment="Center" Height="16" VerticalAlignment="Top"/>
Expand All @@ -35,12 +35,12 @@
VerticalScrollBarVisibility="Visible"
Text="{Binding Text, Mode=OneWay}"
FontFamily="Consolas"
BorderThickness="1"
BorderThickness="0 1 0 0"
IsReadOnly="True"
/>
<Label
HorizontalAlignment="Left"
Margin="2,11,0,0"
Margin="10,8,0,0"
Content="Build With"
VerticalAlignment="Top"
Width="75"
Expand Down
13 changes: 7 additions & 6 deletions RockDevBooster/TemplatesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,28 @@
<Grid>
<Label
HorizontalAlignment="Left"
Margin="0,10,0,0"
Margin="10,8,0,0"
Content="Template"
VerticalAlignment="Top"
Style="{StaticResource labelStyleBold}" Width="70"
Style="{StaticResource labelStyleBold}"
Width="70"
/>
<ComboBox Name="cbTemplates"
Margin="75,10,10,0"
Margin="85,10,10,0"
VerticalAlignment="Top"
SelectionChanged="cbTemplates_SelectionChanged"
/>

<Label
HorizontalAlignment="Left"
Margin="0,40,0,0"
Margin="10,37,0,0"
Content="Name"
VerticalAlignment="Top"
Width="70"
Style="{StaticResource labelStyleBold}"
/>
<TextBox Name="txtName"
Margin="75,37,10,0"
Margin="85,37,10,0"
TextWrapping="Wrap"
Text=""
VerticalAlignment="Top"
Expand All @@ -40,7 +41,7 @@

<Button Name="btnDeploy"
Content="&#xF0EE; Deploy"
Margin="75,72,0,0"
Margin="85,72,0,0"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Width="80"
Expand Down

0 comments on commit 0bc398f

Please sign in to comment.