Skip to content

Commit fd5fbc3

Browse files
committed
gitlab: move logos to resource files
1 parent 7dec930 commit fd5fbc3

File tree

3 files changed

+86
-133
lines changed

3 files changed

+86
-133
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<ResourceDictionary xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3+
<DrawingImage x:Key="GitLabLogo">
4+
<DrawingGroup>
5+
<GeometryDrawing Brush="#E24329" Geometry="M442.097,243.57h-87.12l37.425-115.224c1.919-5.895,10.282-5.895,12.27,0L442.097,243.57L442.097,243.57zM292.778,434.892L292.778,434.892l62.199-191.322H230.669L292.778,434.892L292.778,434.892zM143.549,243.57h87.12l-37.494-115.224c-1.919-5.895-10.282-5.895-12.27,0L143.549,243.57L143.549,243.57z"/>
6+
<GeometryDrawing Brush="#FCA326" Geometry="M442.097,243.57L442.097,243.57l18.873,58.126c1.714,5.278-0.137,11.104-4.661,14.394L292.778,434.892L442.097,243.57L442.097,243.57zM143.549,243.57L143.549,243.57l-18.941,58.126c-1.714,5.278,0.137,11.104,4.661,14.394l163.509,118.801L143.549,243.57L143.549,243.57z"/>
7+
<GeometryDrawing Brush="#FC6D26">
8+
<GeometryDrawing.Geometry>
9+
<CombinedGeometry GeometryCombineMode="Union">
10+
<CombinedGeometry.Geometry1>
11+
<PolylineGeometry IsFilled="True">
12+
<PolylineGeometry.Points>
13+
<Point>292.778,434.892</Point>
14+
<Point>354.977,243.57</Point>
15+
<Point>442.097,243.57</Point>
16+
</PolylineGeometry.Points>
17+
</PolylineGeometry>
18+
</CombinedGeometry.Geometry1>
19+
<CombinedGeometry.Geometry2>
20+
<PolylineGeometry IsFilled="True">
21+
<PolylineGeometry.Points>
22+
<Point>292.778,434.892</Point>
23+
<Point>143.549,243.57</Point>
24+
<Point>230.669,243.57</Point>
25+
</PolylineGeometry.Points>
26+
</PolylineGeometry>
27+
</CombinedGeometry.Geometry2>
28+
</CombinedGeometry>
29+
</GeometryDrawing.Geometry>
30+
</GeometryDrawing>
31+
</DrawingGroup>
32+
</DrawingImage>
33+
<DrawingImage x:Key="GitLabLogoType">
34+
<GeometryDrawing Brush="#8C929D">
35+
<GeometryGroup>
36+
<PathGeometry>
37+
<PathGeometry.Transform>
38+
<TranslateTransform X="977.327440" Y="143.286396"/>
39+
</PathGeometry.Transform>
40+
M13,188.892c-5.5,5.7-14.6,11.4-27,11.4c-16.6,0-23.3-8.2-23.3-18.9
41+
c0-16.1,11.2-23.8,35-23.8c4.5,0,11.7,0.5,15.4,1.2v30.1H13z M-9.6,90.392c-17.6,0-33.8,6.2-46.4,16.7l7.7,13.4
42+
c8.9-5.2,19.8-10.4,35.5-10.4c17.9,0,25.8,9.2,25.8,24.6v7.9c-3.5-0.7-10.7-1.2-15.1-1.2c-38.2,0-57.6,13.4-57.6,41.4
43+
c0,25.1,15.4,37.7,38.7,37.7c15.7,0,30.8-7.2,36-18.9l4,15.9h15.4v-83.2C34.3,107.992,22.9,90.392-9.6,90.392L-9.6,90.392z
44+
</PathGeometry>
45+
<PathGeometry>
46+
<PathGeometry.Transform>
47+
<TranslateTransform X="1099.766904" Y="143.128930"/>
48+
</PathGeometry.Transform>
49+
M-17.7,201.192c-8.2,0-15.4-1-20.8-3.5v-67.3v-7.8c7.4-6.2,16.6-10.7,28.3-10.7
50+
c21.1,0,29.2,14.9,29.2,39C19,185.092,5.9,201.192-17.7,201.192 M-8.5,90.592c-19.5,0-30,13.3-30,13.3v-21l-0.1-27.8h-9.8h-11.5
51+
l0.1,158.5c10.7,4.5,25.3,6.9,41.2,6.9c40.7,0,60.3-26,60.3-70.9C41.6,114.092,23.5,90.592-8.5,90.592
52+
</PathGeometry>
53+
<PathGeometry>
54+
<PathGeometry.Transform>
55+
<TranslateTransform X="584.042117" Y="143.630796"/>
56+
</PathGeometry.Transform>
57+
M18.3,72.192c19.3,0,31.8,6.4,39.9,12.9l9.4-16.3c-12.7-11.2-29.9-17.2-48.3-17.2
58+
c-46.4,0-78.9,28.3-78.9,85.4c0,59.8,35.1,83.1,75.2,83.1c20.1,0,37.2-4.7,48.4-9.4l-0.5-63.9v-7.5v-12.6H4v20.1h38l0.5,48.5
59+
c-5,2.5-13.6,4.5-25.3,4.5c-32.2,0-53.8-20.3-53.8-63C-36.7,93.292-14.4,72.192,18.3,72.192
60+
</PathGeometry>
61+
<PathGeometry>
62+
<PathGeometry.Transform>
63+
<TranslateTransform X="793.569045" Y="142.577463"/>
64+
</PathGeometry.Transform>
65+
M-37.7,55.592H-59l0.1,27.3v11.2v6.5v11.4v65v0.2c0,26.3,11.4,43.9,43.9,43.9
66+
c4.5,0,8.9-0.4,13.1-1.2v-19.1c-3.1,0.5-6.4,0.7-9.9,0.7c-17.9,0-25.8-9.2-25.8-24.6v-65h35.7v-17.8h-35.7L-37.7,55.592
67+
L-37.7,55.592z
68+
</PathGeometry>
69+
<PathGeometry>
70+
M839.7,198.192h-21.8l0.1,162.5h88.3v-20.1h-66.5L839.7,198.192L839.7,198.192z
71+
M680.4,360.692h21.3v-124h-21.3V360.692L680.4,360.692z
72+
M680.4,219.592h21.3v-21.3h-21.3V219.592L680.4,219.592z
73+
</PathGeometry>
74+
</GeometryGroup>
75+
</GeometryDrawing>
76+
</DrawingImage>
77+
</ResourceDictionary>

src/shared/GitLab/UI/Views/CredentialsView.axaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
mc:Ignorable="d" d:DesignWidth="420"
88
x:Class="GitLab.UI.Views.CredentialsView"
99
x:Name="view">
10+
<UserControl.Resources>
11+
<ResourceDictionary>
12+
<ResourceDictionary.MergedDictionaries>
13+
<ResourceInclude Source="/UI/Assets/Images.axaml"/>
14+
</ResourceDictionary.MergedDictionaries>
15+
</ResourceDictionary>
16+
</UserControl.Resources>
1017
<Design.DataContext>
1118
<vm:CredentialsViewModel/>
1219
</Design.DataContext>
@@ -19,10 +26,10 @@
1926
<StackPanel Orientation="Horizontal"
2027
HorizontalAlignment="Center"
2128
Margin="0,0,0,10">
22-
<Image Source="{Binding GitLabLogoImage, ElementName=view}"
29+
<Image Source="{DynamicResource GitLabLogo}"
2330
Height="46" VerticalAlignment="Center" Margin="0,0,8,0"
2431
IsVisible="{Binding Url, Converter={x:Static StringConverters.IsNullOrEmpty}}"/>
25-
<Image Source="{Binding GitLabLogoTypeImage, ElementName=view}"
32+
<Image Source="{DynamicResource GitLabLogoType}"
2633
Height="24" VerticalAlignment="Center"/>
2734
</StackPanel>
2835
<TextBlock Text="Sign in"
Lines changed: 0 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
using Avalonia;
21
using Avalonia.Controls;
32
using Avalonia.Markup.Xaml;
4-
using Avalonia.Media;
53
using GitLab.UI.ViewModels;
64
using GitCredentialManager.UI.Controls;
75

@@ -15,8 +13,6 @@ public class CredentialsView : UserControl, IFocusable
1513
private TextBox _patUserNameTextBox;
1614
private TextBox _userNameTextBox;
1715
private TextBox _passwordTextBox;
18-
private DrawingImage _gitLabLogoImage;
19-
private DrawingImage _gitLabLogoTypeImage;
2016

2117
public CredentialsView()
2218
{
@@ -67,132 +63,5 @@ public void SetFocus()
6763
}
6864
}
6965
}
70-
71-
public IImage GitLabLogoImage
72-
{
73-
get
74-
{
75-
if (_gitLabLogoImage is null)
76-
{
77-
var brush1 = SolidColorBrush.Parse("#E24329");
78-
var brush2 = SolidColorBrush.Parse("#FCA326");
79-
var brush3 = SolidColorBrush.Parse("#FC6D26");
80-
81-
var geometry1 = PathGeometry.Parse(
82-
"M442.097,243.57h-87.12l37.425-115.224c1.919-5.895,10.282-5.895,12.27,0L442.097,243.57L442.097,243.57z" +
83-
"M292.778,434.892L292.778,434.892l62.199-191.322H230.669L292.778,434.892L292.778,434.892z" +
84-
"M143.549,243.57h87.12l-37.494-115.224c-1.919-5.895-10.282-5.895-12.27,0L143.549,243.57L143.549,243.57z"
85-
);
86-
var geometry2 = PathGeometry.Parse(
87-
"M442.097,243.57L442.097,243.57l18.873,58.126c1.714,5.278-0.137,11.104-4.661,14.394L292.778,434.892L442.097,243.57L442.097,243.57z" +
88-
"M143.549,243.57L143.549,243.57l-18.941,58.126c-1.714,5.278,0.137,11.104,4.661,14.394l163.509,118.801L143.549,243.57L143.549,243.57z"
89-
);
90-
var poly1 = new PolylineGeometry
91-
{
92-
Points =
93-
{
94-
new Point(292.778,434.892),
95-
new Point(354.977,243.57),
96-
new Point(442.097,243.57),
97-
}
98-
};
99-
var poly2 = new PolylineGeometry
100-
{
101-
Points =
102-
{
103-
new Point(292.778,434.892),
104-
new Point(143.549,243.57),
105-
new Point(230.669,243.57),
106-
}
107-
};
108-
109-
_gitLabLogoImage = new DrawingImage
110-
{
111-
Drawing = new DrawingGroup
112-
{
113-
Children =
114-
{
115-
new GeometryDrawing { Geometry = geometry1, Brush = brush1 },
116-
new GeometryDrawing { Geometry = geometry2, Brush = brush2 },
117-
new GeometryDrawing { Geometry = poly1, Brush = brush3 },
118-
new GeometryDrawing { Geometry = poly2, Brush = brush3 },
119-
}
120-
}
121-
};
122-
}
123-
124-
return _gitLabLogoImage;
125-
}
126-
}
127-
128-
public IImage GitLabLogoTypeImage
129-
{
130-
get
131-
{
132-
if (_gitLabLogoTypeImage is null)
133-
{
134-
var brush = SolidColorBrush.Parse("#8C929D");
135-
var geometry1 = PathGeometry.Parse(
136-
"M13,188.892c-5.5,5.7-14.6,11.4-27,11.4c-16.6,0-23.3-8.2-23.3-18.9" +
137-
"c0-16.1,11.2-23.8,35-23.8c4.5,0,11.7,0.5,15.4,1.2v30.1H13z M-9.6,90.392c-17.6,0-33.8,6.2-46.4,16.7l7.7,13.4" +
138-
"c8.9-5.2,19.8-10.4,35.5-10.4c17.9,0,25.8,9.2,25.8,24.6v7.9c-3.5-0.7-10.7-1.2-15.1-1.2c-38.2,0-57.6,13.4-57.6,41.4" +
139-
"c0,25.1,15.4,37.7,38.7,37.7c15.7,0,30.8-7.2,36-18.9l4,15.9h15.4v-83.2C34.3,107.992,22.9,90.392-9.6,90.392L-9.6,90.392z"
140-
);
141-
var geometry2 = PathGeometry.Parse(
142-
"M-17.7,201.192c-8.2,0-15.4-1-20.8-3.5v-67.3v-7.8c7.4-6.2,16.6-10.7,28.3-10.7" +
143-
"c21.1,0,29.2,14.9,29.2,39C19,185.092,5.9,201.192-17.7,201.192 M-8.5,90.592c-19.5,0-30,13.3-30,13.3v-21l-0.1-27.8h-9.8h-11.5" +
144-
"l0.1,158.5c10.7,4.5,25.3,6.9,41.2,6.9c40.7,0,60.3-26,60.3-70.9C41.6,114.092,23.5,90.592-8.5,90.592"
145-
);
146-
var geometry3 = PathGeometry.Parse(
147-
"M18.3,72.192c19.3,0,31.8,6.4,39.9,12.9l9.4-16.3c-12.7-11.2-29.9-17.2-48.3-17.2" +
148-
"c-46.4,0-78.9,28.3-78.9,85.4c0,59.8,35.1,83.1,75.2,83.1c20.1,0,37.2-4.7,48.4-9.4l-0.5-63.9v-7.5v-12.6H4v20.1h38l0.5,48.5" +
149-
"c-5,2.5-13.6,4.5-25.3,4.5c-32.2,0-53.8-20.3-53.8-63C-36.7,93.292-14.4,72.192,18.3,72.192"
150-
);
151-
var geometry4 = PathGeometry.Parse(
152-
"M-37.7,55.592H-59l0.1,27.3v11.2v6.5v11.4v65v0.2c0,26.3,11.4,43.9,43.9,43.9" +
153-
"c4.5,0,8.9-0.4,13.1-1.2v-19.1c-3.1,0.5-6.4,0.7-9.9,0.7c-17.9,0-25.8-9.2-25.8-24.6v-65h35.7v-17.8h-35.7L-37.7,55.592" +
154-
"L-37.7,55.592z"
155-
);
156-
var geometry5 = PathGeometry.Parse(
157-
"M839.7,198.192h-21.8l0.1,162.5h88.3v-20.1h-66.5L839.7,198.192L839.7,198.192z" +
158-
"M680.4,360.692h21.3v-124h-21.3V360.692L680.4,360.692z" +
159-
"M680.4,219.592h21.3v-21.3h-21.3V219.592L680.4,219.592z"
160-
);
161-
162-
_gitLabLogoTypeImage = new DrawingImage
163-
{
164-
Drawing = new DrawingGroup
165-
{
166-
Children =
167-
{
168-
new DrawingGroup
169-
{
170-
Transform = new TranslateTransform(977.327440, 143.286396),
171-
Children = { new GeometryDrawing { Geometry = geometry1, Brush = brush } }
172-
},
173-
new DrawingGroup
174-
{
175-
Transform = new TranslateTransform(1099.766904, 143.128930),
176-
Children = { new GeometryDrawing { Geometry = geometry2, Brush = brush } }
177-
},
178-
new DrawingGroup
179-
{
180-
Transform = new TranslateTransform(584.042117, 143.630796),
181-
Children = { new GeometryDrawing { Geometry = geometry3, Brush = brush } }
182-
},
183-
new DrawingGroup
184-
{
185-
Transform = new TranslateTransform(793.569045, 142.577463),
186-
Children = { new GeometryDrawing { Geometry = geometry4, Brush = brush } }
187-
},
188-
new GeometryDrawing { Geometry = geometry5, Brush = brush },
189-
}
190-
}
191-
};
192-
}
193-
194-
return _gitLabLogoTypeImage;
195-
}
196-
}
19766
}
19867
}

0 commit comments

Comments
 (0)