Parcourir la source

update file ui

Karathan il y a 6 ans
Parent
révision
a3f3c9a858

+ 7
- 0
Control/Control.csproj Voir le fichier

@@ -0,0 +1,7 @@
1
+<Project Sdk="Microsoft.NET.Sdk">
2
+
3
+  <PropertyGroup>
4
+    <TargetFramework>netstandard2.0</TargetFramework>
5
+  </PropertyGroup>
6
+
7
+</Project>

+ 10
- 0
Control/TabItemExpander.cs Voir le fichier

@@ -0,0 +1,10 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+
5
+namespace Editopia.Control
6
+{
7
+    class TabItemExpander
8
+    {
9
+    }
10
+}

+ 11
- 0
Editopia.Control/Editopia.Control.csproj Voir le fichier

@@ -0,0 +1,11 @@
1
+<Project Sdk="Microsoft.NET.Sdk">
2
+
3
+  <PropertyGroup>
4
+    <TargetFramework>netstandard2.0</TargetFramework>
5
+  </PropertyGroup>
6
+
7
+  <ItemGroup>
8
+    <ProjectReference Include="..\Avalonia\src\Avalonia.Controls\Avalonia.Controls.csproj" />
9
+  </ItemGroup>
10
+
11
+</Project>

+ 35
- 0
Editopia.Control/TabItemIcon.cs Voir le fichier

@@ -0,0 +1,35 @@
1
+using Avalonia;
2
+using Avalonia.Controls;
3
+using Avalonia.Controls.Mixins;
4
+using Avalonia.Controls.Primitives;
5
+using System;
6
+
7
+namespace Editopia.Control
8
+{
9
+    public class TabItemIcon : HeaderedContentControl, ISelectable
10
+    {
11
+        /// <summary>
12
+        /// Defines the <see cref="IsSelected"/> property.
13
+        /// </summary>
14
+        public static readonly StyledProperty<bool> IsSelectedProperty =
15
+            ListBoxItem.IsSelectedProperty.AddOwner<TabItem>();
16
+
17
+        /// <summary>
18
+        /// Initializes static members of the <see cref="TabItem"/> class.
19
+        /// </summary>
20
+        static TabItemIcon()
21
+        {
22
+            SelectableMixin.Attach<TabItemIcon>(IsSelectedProperty);
23
+            FocusableProperty.OverrideDefaultValue(typeof(TabItem), true);
24
+        }
25
+
26
+        /// <summary>
27
+        /// Gets or sets the selection state of the item.
28
+        /// </summary>
29
+        public bool IsSelected
30
+        {
31
+            get { return GetValue(IsSelectedProperty); }
32
+            set { SetValue(IsSelectedProperty, value); }
33
+        }
34
+    }
35
+}

+ 45
- 4
Editopia.Editor/App.xaml Voir le fichier

@@ -2,18 +2,59 @@
2 2
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3 3
   <Application.Styles>
4 4
 
5
-    <Style Selector="TextBlock.h1">
5
+    <Style Selector="Border.grouped">
6
+      <Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/>
7
+      <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderLightBrush}"/>
8
+      <Setter Property="CornerRadius" Value="2"/>
9
+      <Setter Property="BorderThickness" Value="3"/>
10
+    </Style>
11
+    
12
+    <Style Selector="Button">
13
+      <Setter Property="FontWeight" Value="Light"/>
14
+      <Setter Property="FontFamily" Value="resm:Editopia.Editor.Assets.Font.Roboto-Light.ttf?assembly=Editopia.Editor#Roboto" />
15
+      <Setter Property="FontSize" Value="14"/>
16
+    </Style>
17
+
18
+    <Style Selector="TextBlock.content">
6 19
       <Setter Property="Foreground" Value="#212121"/>
7 20
       <Setter Property="FontSize" Value="20"/>
8
-      <Setter Property="FontWeight" Value="Medium"/>
21
+      <Setter Property="FontWeight" Value="Regular"/>
22
+      <Setter Property="FontFamily" Value="resm:Editopia.Editor.Assets.Font.Roboto-Regular.ttf?assembly=Editopia.Editor#Roboto"/>
9 23
     </Style>
10 24
 
11
-    <Style Selector="TextBlock.h2">
25
+    <Style Selector="TextBlock.emph">
26
+      <Setter Property="FontWeight" Value="Bold"/>
27
+      <Setter Property="FontFamily" Value="resm:Editopia.Editor.Assets.Font.Roboto-Bold.ttf?assembly=Editopia.Editor#Roboto"/>
28
+    </Style>
29
+
30
+    <Style Selector="TextBlock.h1">
31
+      <Setter Property="Foreground" Value="#212121"/>
32
+      <Setter Property="FontSize" Value="56"/>
33
+      <Setter Property="FontWeight" Value="Light"/>
34
+      <Setter Property="FontFamily" Value="resm:Editopia.Editor.Assets.Font.Roboto-Light.ttf?assembly=Editopia.Editor#Roboto"/>
35
+    </Style>
36
+
37
+    <Style Selector="TextBlock.sub1">
38
+      <Setter Property="FontWeight" Value="Regular"/>
39
+      <Setter Property="FontFamily" Value="resm:Editopia.Editor.Assets.Font.Roboto-Regular.ttf?assembly=Editopia.Editor#Roboto"/>
12 40
       <Setter Property="Foreground" Value="#727272"/>
13 41
       <Setter Property="FontSize" Value="13"/>
14 42
     </Style>
43
+
44
+    <Style Selector="TextBlock.h2">
45
+      <Setter Property="Foreground" Value="#212121"/>
46
+      <Setter Property="FontSize" Value="42"/>
47
+      <Setter Property="FontWeight" Value="Light"/>
48
+      <Setter Property="FontFamily" Value="resm:Editopia.Editor.Assets.Font.Roboto-Light.ttf?assembly=Editopia.Editor#Roboto"/>
49
+    </Style>
50
+    
51
+    <Style Selector="TextBlock.brand">
52
+      <Setter Property="FontWeight" Value="Regular"/>
53
+      <Setter Property="FontFamily" Value="resm:Editopia.Editor.Assets.Font.Awesome.Fa5-Brands-Regular-400.otf?assembly=Editopia.Editor#FontAwesome"/>
54
+    </Style>
55
+
15 56
     <StyleInclude Source="resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default"/>
16 57
     <StyleInclude Source="resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default"/>
17
-    <StyleInclude Source="resm:Editopia.Editor.SideBar.xaml"/>
58
+    <StyleInclude Source="resm:Editopia.Editor.Sidebar.Sidebar.xaml"/>
18 59
   </Application.Styles>
19 60
 </Application>

BIN
Editopia.Editor/Assets/Font/Awesome/gitsquare.png Voir le fichier


BIN
Editopia.Editor/Assets/Font/Awesome/project-diagram.png Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-Black.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-BlackItalic.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-Bold.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-BoldItalic.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-Italic.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-Light.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-LightItalic.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-Medium.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-MediumItalic.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-Regular.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-Thin.ttf Voir le fichier


BIN
Editopia.Editor/Assets/Font/Roboto-ThinItalic.ttf Voir le fichier


BIN
Editopia.Editor/Assets/background_acc.png Voir le fichier


BIN
Editopia.Editor/Assets/git.png Voir le fichier


BIN
Editopia.Editor/Assets/outline_folder_black_36dp.png Voir le fichier


+ 20
- 0
Editopia.Editor/Design/Brushes.cs Voir le fichier

@@ -0,0 +1,20 @@
1
+using Avalonia.Media;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Text;
5
+
6
+namespace Editopia.Editor.Design
7
+{
8
+    public class Brushes
9
+    {
10
+        private ImageBrush _mainBackgroundBrush = new ImageBrush(new Avalonia.Media.Imaging.Bitmap("resm:Editopia.Editor.Assets.background_acc.png"));
11
+
12
+        public IImageBrush ThemeBackgroundBrush
13
+        {
14
+            get
15
+            {
16
+                return _mainBackgroundBrush;
17
+            }
18
+        }
19
+    }
20
+}

+ 37
- 0
Editopia.Editor/Editopia.Editor.csproj Voir le fichier

@@ -21,12 +21,48 @@
21 21
     </EmbeddedResource>
22 22
   </ItemGroup>
23 23
   <ItemGroup>
24
+    <None Remove="Assets\background_acc.png" />
25
+    <None Remove="Assets\Font\Awesome\gitsquare.png" />
26
+    <None Remove="Assets\Font\Roboto-Black.ttf" />
27
+    <None Remove="Assets\Font\Roboto-BlackItalic.ttf" />
28
+    <None Remove="Assets\Font\Roboto-Bold.ttf" />
29
+    <None Remove="Assets\Font\Roboto-BoldItalic.ttf" />
30
+    <None Remove="Assets\Font\Roboto-Italic.ttf" />
31
+    <None Remove="Assets\Font\Roboto-Light.ttf" />
32
+    <None Remove="Assets\Font\Roboto-LightItalic.ttf" />
33
+    <None Remove="Assets\Font\Roboto-Medium.ttf" />
34
+    <None Remove="Assets\Font\Roboto-MediumItalic.ttf" />
35
+    <None Remove="Assets\Font\Roboto-Regular.ttf" />
36
+    <None Remove="Assets\Font\Roboto-Thin.ttf" />
37
+    <None Remove="Assets\Font\Roboto-ThinItalic.ttf" />
38
+    <None Remove="Assets\git.png" />
39
+    <None Remove="Assets\outline_folder_black_36dp.png" />
40
+    <None Remove="Assets\project-diagram.png" />
24 41
     <None Remove="MainView.xaml" />
25 42
     <None Remove="Pages\EditTrainer.xaml" />
26 43
     <None Remove="Pages\FilePage.xaml" />
27 44
     <None Remove="sidebar.xaml" />
28 45
   </ItemGroup>
29 46
   <ItemGroup>
47
+    <EmbeddedResource Include="Assets\background_acc.png" />
48
+    <EmbeddedResource Include="Assets\Font\Awesome\gitsquare.png" />
49
+    <EmbeddedResource Include="Assets\Font\Roboto-Black.ttf" />
50
+    <EmbeddedResource Include="Assets\Font\Roboto-BlackItalic.ttf" />
51
+    <EmbeddedResource Include="Assets\Font\Roboto-Bold.ttf" />
52
+    <EmbeddedResource Include="Assets\Font\Roboto-BoldItalic.ttf" />
53
+    <EmbeddedResource Include="Assets\Font\Roboto-Italic.ttf" />
54
+    <EmbeddedResource Include="Assets\Font\Roboto-Light.ttf" />
55
+    <EmbeddedResource Include="Assets\Font\Roboto-LightItalic.ttf" />
56
+    <EmbeddedResource Include="Assets\Font\Roboto-Medium.ttf" />
57
+    <EmbeddedResource Include="Assets\Font\Roboto-MediumItalic.ttf" />
58
+    <EmbeddedResource Include="Assets\Font\Roboto-Regular.ttf" />
59
+    <EmbeddedResource Include="Assets\Font\Roboto-Thin.ttf" />
60
+    <EmbeddedResource Include="Assets\Font\Roboto-ThinItalic.ttf" />
61
+    <EmbeddedResource Include="Assets\git.png" />
62
+    <EmbeddedResource Include="Assets\outline_folder_black_36dp.png" />
63
+    <EmbeddedResource Include="Assets\Font\Awesome\project-diagram.png" />
64
+  </ItemGroup>
65
+  <ItemGroup>
30 66
     <ProjectReference Include="..\Avalonia\src\Avalonia.Animation\Avalonia.Animation.csproj" />
31 67
     <ProjectReference Include="..\Avalonia\src\Avalonia.Base\Avalonia.Base.csproj" />
32 68
     <ProjectReference Include="..\Avalonia\src\Avalonia.Controls\Avalonia.Controls.csproj" />
@@ -40,6 +76,7 @@
40 76
     <ProjectReference Include="..\Avalonia\src\Avalonia.Visuals\Avalonia.Visuals.csproj" />
41 77
     <ProjectReference Include="..\Avalonia\src\Markup\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj" />
42 78
     <ProjectReference Include="..\Avalonia\src\Markup\Avalonia.Markup\Avalonia.Markup.csproj" />
79
+    <ProjectReference Include="..\Editopia.Control\Editopia.Control.csproj" />
43 80
   </ItemGroup>
44 81
   <ItemGroup>
45 82
     <Compile Update="MainView.xaml.cs">

+ 3
- 0
Editopia.Editor/MainView.xaml Voir le fichier

@@ -1,6 +1,9 @@
1 1
 <UserControl xmlns="https://github.com/avaloniaui"
2 2
         xmlns:pages="clr-namespace:Editopia.Editor.Pages"
3
+        xmlns:sidebar="clr-namespace:Editopia.Editor.Sidebar"
4
+        xmlns:editopia.control="clr-namespace:Editopia.Control"
3 5
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
6
+
4 7
   <TabControl Classes="sidebar" Name="Sidebar">
5 8
     <TabItem Header="File">
6 9
       <pages:FilePage/>

+ 12
- 1
Editopia.Editor/MainView.xaml.cs Voir le fichier

@@ -1,5 +1,10 @@
1
-using Avalonia.Controls;
1
+using Avalonia.Collections;
2
+using Avalonia.Controls;
2 3
 using Avalonia.Markup.Xaml;
4
+using Editopia.Editor.Pages;
5
+using System;
6
+using System.Collections;
7
+using System.Collections.Generic;
3 8
 
4 9
 namespace Editopia.Editor
5 10
 {
@@ -13,6 +18,12 @@ namespace Editopia.Editor
13 18
         private void InitializeComponent()
14 19
         {
15 20
             AvaloniaXamlLoader.Load(this);
21
+            IList tabItems = ((IList)this.FindControl<TabControl>("Sidebar").Items);
22
+            tabItems.Add(new TabItem()
23
+            {
24
+                Header = "Trainer Page",
25
+                Content = new EditTrainer()
26
+            });
16 27
         }
17 28
     }
18 29
 }

+ 70
- 2
Editopia.Editor/Pages/FilePage.xaml Voir le fichier

@@ -1,6 +1,74 @@
1 1
 <UserControl xmlns="https://github.com/avaloniaui">
2
-  <StackPanel Orientation="Vertical" Gap="4">
2
+  <UserControl.Styles>
3
+  </UserControl.Styles>
4
+  <StackPanel Orientation="Vertical" Gap="4" Background="{DynamicResource ThemeBackgroundBrush}">
3 5
     <TextBlock Classes="h1">File</TextBlock>
4
-    <TextBlock Classes="h2">Manage your project</TextBlock>
6
+    <TextBlock Classes="sub1">Manage your project</TextBlock>
7
+    <Grid RowDefinitions="Auto,*"
8
+          ColumnDefinitions="Auto,*" Margin="0,16,0,0">
9
+      <StackPanel Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="0,0,0,0">
10
+        <Border Classes="grouped">
11
+          <StackPanel Margin="8">
12
+            <StackPanel Orientation="Horizontal" Gap="10">
13
+              <Image Source="resm:Editopia.Editor.Assets.Font.Awesome.project-diagram.png" Width="30" Height="36" Grid.Column="0" Grid.Row="0"/>
14
+              <TextBlock Classes="h2" >Project Data</TextBlock>
15
+            </StackPanel>
16
+
17
+            <Grid RowDefinitions="Auto,*" ColumnDefinitions="Auto,*">
18
+              <StackPanel Grid.Column="0" Grid.Row="0">
19
+                <TextBlock Classes="content emph">Name: </TextBlock>
20
+                <TextBlock Classes="content emph">Workspace: </TextBlock>
21
+                <TextBlock Classes="content emph">Modules: </TextBlock>
22
+              </StackPanel>
23
+              <StackPanel Grid.Column="1" Grid.Row="0" Margin="8,0,0,0">
24
+                <TextBlock Classes="content">{projectName}</TextBlock>
25
+                <TextBlock Classes="content">{workspacePath}</TextBlock>
26
+                <TextBlock Classes="content">{loadedModules[]}</TextBlock>
27
+              </StackPanel>
28
+              
29
+            </Grid>
30
+            <Button Margin="0,8,0,0">OPEN FOLDER</Button>
31
+          </StackPanel>
32
+
33
+        </Border>
34
+      </StackPanel>
35
+
36
+            
37
+      
38
+      <Border Grid.Column="1" Grid.Row="2" HorizontalAlignment="Right" Margin="0,0,32,0" Classes="grouped">
39
+        <StackPanel>
40
+          <Grid RowDefinitions="Auto,*" Margin="8"
41
+            ColumnDefinitions="Auto,*">
42
+            <Image Source="resm:Editopia.Editor.Assets.Font.Awesome.gitsquare.png" Width="30" Height="36" Grid.Column="0" Grid.Row="0"/>
43
+            <TextBlock Classes="h2" Grid.Column="1" Grid.Row="0" Margin="12,0,0,0">Version Control</TextBlock>
44
+            <!--
45
+              <Image Source="resm:Editopia.Editor.Assets.git.png" Width="24" Height="30" Grid.Column="2" Grid.Row="0"/>
46
+            -->
47
+
48
+          </Grid>
49
+          <Grid RowDefinitions="Auto,*" ColumnDefinitions="Auto,*">
50
+
51
+
52
+            <StackPanel Grid.Column="0" Grid.Row="0" Margin="8">
53
+              <TextBlock Classes="content emph">Branch: </TextBlock>
54
+              <TextBlock Classes="content emph">Commit: </TextBlock>
55
+              <TextBlock Classes="content emph">Status: </TextBlock>
56
+            </StackPanel>
57
+            <StackPanel Grid.Column="1" Grid.Row="0" Margin="8">
58
+              <TextBlock Classes="content">{branch}</TextBlock>
59
+              <TextBlock Classes="content">{commitHash}</TextBlock>
60
+              <TextBlock Classes="content">{repositoryStatus}</TextBlock>
61
+
62
+            </StackPanel>
63
+
64
+
65
+          </Grid>
66
+
67
+        </StackPanel>
68
+
69
+      </Border>
70
+
71
+    </Grid>
72
+
5 73
   </StackPanel>
6 74
 </UserControl>

Editopia.Editor/SideBar.xaml → Editopia.Editor/Sidebar/Sidebar.xaml Voir le fichier

@@ -33,6 +33,11 @@
33 33
     <Setter Property="Margin" Value="0"/>
34 34
     <Setter Property="Padding" Value="16"/>
35 35
     <Setter Property="Opacity" Value="0.5"/>
36
+    <Setter Property="Transitions">
37
+      <Transitions>
38
+        <DoubleTransition Property="Opacity" Duration="0:0:0.1"/>
39
+      </Transitions>
40
+    </Setter>
36 41
   </Style>
37 42
 
38 43
   <Style Selector="TabControl.sidebar TabStripItem:pointerover">

+ 7
- 0
Editopia.sln Voir le fichier

@@ -53,6 +53,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Win32", "Avalonia\
53 53
 EndProject
54 54
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.ReactiveUI", "Avalonia\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj", "{FD55342C-7A40-44DE-8A90-C8F2F2165FB1}"
55 55
 EndProject
56
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Editopia.Control", "Editopia.Control\Editopia.Control.csproj", "{A874E7B7-44B2-4918-AB15-BBA352CB3B88}"
57
+EndProject
56 58
 Global
57 59
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
58 60
 		Debug|Any CPU = Debug|Any CPU
@@ -151,6 +153,10 @@ Global
151 153
 		{FD55342C-7A40-44DE-8A90-C8F2F2165FB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
152 154
 		{FD55342C-7A40-44DE-8A90-C8F2F2165FB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
153 155
 		{FD55342C-7A40-44DE-8A90-C8F2F2165FB1}.Release|Any CPU.Build.0 = Release|Any CPU
156
+		{A874E7B7-44B2-4918-AB15-BBA352CB3B88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
157
+		{A874E7B7-44B2-4918-AB15-BBA352CB3B88}.Debug|Any CPU.Build.0 = Debug|Any CPU
158
+		{A874E7B7-44B2-4918-AB15-BBA352CB3B88}.Release|Any CPU.ActiveCfg = Release|Any CPU
159
+		{A874E7B7-44B2-4918-AB15-BBA352CB3B88}.Release|Any CPU.Build.0 = Release|Any CPU
154 160
 	EndGlobalSection
155 161
 	GlobalSection(SolutionProperties) = preSolution
156 162
 		HideSolutionNode = FALSE
@@ -179,6 +185,7 @@ Global
179 185
 		{DE60FF65-3F0A-4F27-BCD3-0697A45DD24C} = {BE2ACD11-9552-42C2-A288-D803C94A4196}
180 186
 		{1BB33107-5BD0-49DB-BF8B-CEA312E4DC62} = {BE2ACD11-9552-42C2-A288-D803C94A4196}
181 187
 		{FD55342C-7A40-44DE-8A90-C8F2F2165FB1} = {BE2ACD11-9552-42C2-A288-D803C94A4196}
188
+		{A874E7B7-44B2-4918-AB15-BBA352CB3B88} = {C722AF49-670F-4338-8DD6-A2BE0304A799}
182 189
 	EndGlobalSection
183 190
 	GlobalSection(ExtensibilityGlobals) = postSolution
184 191
 		SolutionGuid = {1E71EF89-9E35-40BB-9071-247DE301209B}