Skip to content

Commit

Permalink
Merge pull request #11 from cinnamon-msft/cinnamon/general-xaml
Browse files Browse the repository at this point in the history
Add rendering and appearance - global pages
  • Loading branch information
vineeththomasalex authored Jul 27, 2020
2 parents 932ceda + 53b3b16 commit ab56031
Show file tree
Hide file tree
Showing 14 changed files with 199 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/TerminalSettings/TerminalSettings/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#include "Globals.h"
#include "Launch.h"
#include "Interaction.h"
#include "Rendering.h"
#include "Profiles.h"
#include "GlobalAppearance.h"
#include "ColorSchemes.h"
#include "Keybindings.h"

Expand Down
18 changes: 18 additions & 0 deletions src/TerminalSettings/TerminalSettings/GlobalAppearance.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "pch.h"
#include "GlobalAppearance.h"
#include "GlobalAppearance.g.cpp"

using namespace winrt;
using namespace Windows::UI::Xaml;

namespace winrt::SettingsControl::implementation
{
GlobalAppearance::GlobalAppearance()
{
InitializeComponent();
}

void GlobalAppearance::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
}
}
20 changes: 20 additions & 0 deletions src/TerminalSettings/TerminalSettings/GlobalAppearance.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once

#include "GlobalAppearance.g.h"

namespace winrt::SettingsControl::implementation
{
struct GlobalAppearance : GlobalAppearanceT<GlobalAppearance>
{
GlobalAppearance();

void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}

namespace winrt::SettingsControl::factory_implementation
{
struct GlobalAppearance : GlobalAppearanceT<GlobalAppearance, implementation::GlobalAppearance>
{
};
}
7 changes: 7 additions & 0 deletions src/TerminalSettings/TerminalSettings/GlobalAppearance.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace SettingsControl
{
[default_interface] runtimeclass GlobalAppearance : Windows.UI.Xaml.Controls.Page
{
GlobalAppearance();
}
}
41 changes: 41 additions & 0 deletions src/TerminalSettings/TerminalSettings/GlobalAppearance.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<Page
x:Class="SettingsControl.GlobalAppearance"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SettingsControl"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Controls="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Margin="0,12,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Global Appearance"
Style="{StaticResource HeaderTextBlockStyle}"
Margin="0,0,0,10" />
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
<Controls:RadioButtons Header="Theme" Margin="0,0,0,10">
<RadioButton x:Name="DefaultTheme" Content="Default"/>
<RadioButton x:Name="DarkTheme" Content="Dark"/>
<RadioButton x:Name="LightTheme" Content="Light"/>
</Controls:RadioButtons>
<CheckBox Content="Show the title bar" />
<CheckBox Content="Show terminal title in title bar" />
<CheckBox Content="Always show tabs" />
<Controls:RadioButtons Header="Tab width mode" Margin="0,0,0,10">
<RadioButton x:Name="EqualTabWidthMode" Content="Equal"/>
<RadioButton x:Name="TitleLengthTabWidthMode" Content="Title length"/>
<RadioButton x:Name="CompactTabWidthMode" Content="Compact"/>
</Controls:RadioButtons>
<CheckBox Content="Hide close all tabs popup" />
</StackPanel>
</Grid>
</Page>
3 changes: 0 additions & 3 deletions src/TerminalSettings/TerminalSettings/Interaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ namespace winrt::SettingsControl::implementation
{
Interaction();

int32_t MyProperty();
void MyProperty(int32_t value);

void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/TerminalSettings/TerminalSettings/Launch.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ namespace winrt::SettingsControl::implementation
{
Launch();

int32_t MyProperty();
void MyProperty(int32_t value);

void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}
Expand Down
8 changes: 7 additions & 1 deletion src/TerminalSettings/TerminalSettings/MainPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include "Globals.h"
#include "Launch.h"
#include "Interaction.h"
#include "Rendering.h"
#include "Profiles.h"
#include "GlobalAppearance.h"
#include "ColorSchemes.h"
#include "Keybindings.h"

Expand Down Expand Up @@ -88,6 +90,10 @@ namespace winrt::SettingsControl::implementation
{
contentFrame().Navigate(xaml_typename<SettingsControl::Interaction>());
}
else if (clickedItemTag == renderingSubpage)
{
contentFrame().Navigate(xaml_typename<SettingsControl::Rendering>());
}
else if (clickedItemTag == globalprofileSubpage)
{
contentFrame().Navigate(xaml_typename<SettingsControl::Profiles>());
Expand All @@ -102,7 +108,7 @@ namespace winrt::SettingsControl::implementation
}
else if (clickedItemTag == globalAppearancePage)
{
contentFrame().Navigate(xaml_typename<SettingsControl::ColorSchemes>());
contentFrame().Navigate(xaml_typename<SettingsControl::GlobalAppearance>());
}
else if (clickedItemTag == keybindingsPage)
{
Expand Down
18 changes: 18 additions & 0 deletions src/TerminalSettings/TerminalSettings/Rendering.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "pch.h"
#include "Rendering.h"
#include "Rendering.g.cpp"

using namespace winrt;
using namespace Windows::UI::Xaml;

namespace winrt::SettingsControl::implementation
{
Rendering::Rendering()
{
InitializeComponent();
}

void Rendering::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
}
}
20 changes: 20 additions & 0 deletions src/TerminalSettings/TerminalSettings/Rendering.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once

#include "Rendering.g.h"

namespace winrt::SettingsControl::implementation
{
struct Rendering : RenderingT<Rendering>
{
Rendering();

void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}

namespace winrt::SettingsControl::factory_implementation
{
struct Rendering : RenderingT<Rendering, implementation::Rendering>
{
};
}
8 changes: 8 additions & 0 deletions src/TerminalSettings/TerminalSettings/Rendering.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace SettingsControl
{
[default_interface]
runtimeclass Rendering : Windows.UI.Xaml.Controls.Page
{
Rendering();
}
}
30 changes: 30 additions & 0 deletions src/TerminalSettings/TerminalSettings/Rendering.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Page
x:Class="SettingsControl.Rendering"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SettingsControl"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Controls="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Margin="0,12,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Rendering"
Style="{StaticResource HeaderTextBlockStyle}"
Margin="0,0,0,10" />
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
<CheckBox Content="Windows resize behavior" />
<CheckBox Content="Screen redrawing" />
<CheckBox Content="Software rendering" />
</StackPanel>
</Grid>
</Page>
26 changes: 26 additions & 0 deletions src/TerminalSettings/TerminalSettings/SettingsControl.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="GlobalAppearance.h">
<DependentUpon>GlobalAppearance.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="ColorSchemes.h">
<DependentUpon>ColorSchemes.xaml</DependentUpon>
<SubType>Code</SubType>
Expand Down Expand Up @@ -136,11 +139,17 @@
<DependentUpon>Profiles.xaml</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="Rendering.h">
<DependentUpon>Rendering.xaml</DependentUpon>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="GlobalAppearance.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="ColorSchemes.xaml">
<SubType>Designer</SubType>
</Page>
Expand All @@ -162,6 +171,9 @@
<Page Include="Profiles.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Rendering.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
Expand Down Expand Up @@ -190,6 +202,9 @@
<Image Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="GlobalAppearance.cpp">
<DependentUpon>GlobalAppearance.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="ColorSchemes.cpp">
<DependentUpon>ColorSchemes.xaml</DependentUpon>
<SubType>Code</SubType>
Expand Down Expand Up @@ -226,11 +241,18 @@
<DependentUpon>Profiles.xaml</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="Rendering.cpp">
<DependentUpon>Rendering.xaml</DependentUpon>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Midl Include="App.idl">
<DependentUpon>App.xaml</DependentUpon>
</Midl>
<Midl Include="GlobalAppearance.idl">
<DependentUpon>GlobalAppearance.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="ColorSchemes.idl">
<DependentUpon>ColorSchemes.xaml</DependentUpon>
<SubType>Code</SubType>
Expand All @@ -247,6 +269,10 @@
<DependentUpon>Interaction.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="Rendering.idl">
<DependentUpon>Rendering.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="Keybindings.idl">
<DependentUpon>Keybindings.xaml</DependentUpon>
<SubType>Code</SubType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<Page Include="Keybindings.xaml" />
<Page Include="Launch.xaml" />
<Page Include="Interaction.xaml" />
<Page Include="Rendering.xaml" />
<Page Include="Appearance.xaml" />
</ItemGroup>
<ItemGroup>
<Midl Include="App.idl" />
Expand Down

0 comments on commit ab56031

Please sign in to comment.