Skip to content

Commit 42362ce

Browse files
VicTachevDimitar-Goshev
authored andcommitted
chore: update icons, remove flicker
1 parent 407aed9 commit 42362ce

File tree

4 files changed

+31
-34
lines changed

4 files changed

+31
-34
lines changed

Kendo-UI-Bootstrap-Integration/src/Kendo-UI-Bootstrap-Integration/Startup.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
5+
using Kendo.Mvc;
56
using Microsoft.AspNetCore.Builder;
67
using Microsoft.AspNetCore.Hosting;
78
using Microsoft.Extensions.Configuration;
89
using Microsoft.Extensions.DependencyInjection;
910
using Microsoft.Extensions.Hosting;
1011
using Microsoft.Extensions.Logging;
1112
using Newtonsoft.Json.Serialization;
13+
using static System.Net.Mime.MediaTypeNames;
1214

1315
namespace mvc_core
1416
{
@@ -30,7 +32,10 @@ public void ConfigureServices(IServiceCollection services)
3032
.AddNewtonsoftJson(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());
3133

3234
// Add Kendo UI services to the services container
33-
services.AddKendo();
35+
services.AddKendo(x =>
36+
{
37+
x.IconType = IconType.Svg;
38+
});
3439
}
3540

3641
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

Kendo-UI-Bootstrap-Integration/src/Kendo-UI-Bootstrap-Integration/Views/Home/Index.cshtml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@
5555
.Name("tabstrip")
5656
.Items(tabstrip =>
5757
{
58-
tabstrip.Add().Text("<span class='km-icon revenue'></span><span class='hidden-xs'>Revenue</span>")
58+
tabstrip.Add().Text("<span class='km-icon revenue-icon'></span><span class='hidden-xs'>Revenue</span>")
5959
.Encoded(false)
6060
.Selected(true)
6161
.Content(@<text>
6262
@(Html.Kendo().Chart<Kendo_UI_Bootstrap_Integration.Models.RevenueViewModel>()
6363
.Name("revenue")
6464
.DataSource(ds => ds.Read(read => read.Action("Revenue", "Home")))
6565
.Transitions(false)
66-
.Theme("bootstrap")
66+
.Theme("sass")
6767
.ChartArea(chart => chart.Margin(m => m.Top(15))
6868
.Background("transparent"))
6969
.Legend(l => l.Visible(false))
@@ -92,18 +92,18 @@
9292
.Tooltip(t=>t.Visible(true).Template("#= series.name # <br /> #= category #: $#= value #"))
9393
)
9494
</text>);
95-
tabstrip.Add().Text("<span class='km-icon spd'></span><span class='hidden-xs'>Sales / day</span>")
95+
tabstrip.Add().Text("<span class='km-icon spd-icon'></span><span class='hidden-xs'>Sales / day</span>")
9696
.Encoded(false)
9797
.Content(@<text>
9898
@(Html.Kendo().Chart<Kendo_UI_Bootstrap_Integration.Models.SalesPerDayViewModel>()
9999
.Name("sales-per-day")
100100
.DataSource(ds => ds.Read(read => read.Action("SalesPerDay", "Home")))
101101
.Transitions(false)
102-
.Theme("bootstrap")
102+
.Theme("sass")
103103
.ChartArea(chart => chart.Margin(m => m.Top(15))
104104
.Background("transparent"))
105105
.Legend(l => l.Visible(false))
106-
.SeriesDefaults(s => s.VerticalBullet())
106+
.SeriesDefaults(s => s.VerticalBullet().Target(t=>t.Color("#ff0000")))
107107
.CategoryAxis(a => a.Categories(m => m.Date)
108108
.Labels(l => l.Visible(false))
109109
.MajorGridLines(m => m.Visible(false)))
@@ -115,14 +115,14 @@
115115
}))
116116
)
117117
</text>);
118-
tabstrip.Add().Text("<span class='km-icon spr'></span><span class='hidden-xs'>Sales / region</span>")
118+
tabstrip.Add().Text("<span class='km-icon spr-icon'></span><span class='hidden-xs'>Sales / region</span>")
119119
.Encoded(false)
120120
.Content(@<text>
121121
@(Html.Kendo().Chart<Kendo_UI_Bootstrap_Integration.Models.SalesPerRegionViewModel>()
122122
.Name("sales-per-region")
123123
.DataSource(ds => ds.Read(read => read.Action("SalesPerRegion", "Home")))
124124
.Transitions(false)
125-
.Theme("bootstrap")
125+
.Theme("sass")
126126
.Legend(l=>l.Visible(false))
127127
.ChartArea(c=>c.Margin(m => m.Top(15))
128128
.Background("transparent"))
@@ -136,7 +136,7 @@
136136
.Labels(l=>l.Visible(false))
137137
.MajorGridLines(l=>l.Visible(false))
138138
)
139-
.Tooltip(t=>t.Visible(false).Template("#= series.name # <br /> #= category #: #= value #"))
139+
.Tooltip(t=>t.Visible(true).Shared(true).Template("#= series.name # <br /> #= category #: #= value #"))
140140
.Series(series => {
141141
series.Area(model => model.Canterbury).Name("Canterbury");
142142
series.Area(model => model.Manchester).Name("Manchester");
@@ -145,15 +145,15 @@
145145
.ValueAxis(v=>v.Numeric().Labels(l=>l.Step(2)))
146146
)
147147
</text>);
148-
tabstrip.Add().Text("<span class='km-icon share'></span><span class='hidden-xs'>Market share</span>")
148+
tabstrip.Add().Text("<span class='km-icon share-icon'></span><span class='hidden-xs'>Market share</span>")
149149
.Encoded(false)
150150
.Content(@<text>
151151
@(Html.Kendo().Chart<Kendo_UI_Bootstrap_Integration.Models.DonutChartViewModel>()
152152
.HtmlAttributes(new { @class = "market-donut"})
153153
.Name("market-alice-mutton")
154154
.DataSource(ds => ds.Read(read => read.Action("AliceMutton", "Home")).Group(g => g.Add(d=> d.Series)))
155155
.Transitions(false)
156-
.Theme("bootstrap")
156+
.Theme("sass")
157157
.Title(t => t
158158
.Text("Alice Mutton")
159159
.Position(ChartTitlePosition.Bottom)
@@ -176,7 +176,7 @@
176176
.Name("market-gravad")
177177
.DataSource(ds => ds.Read(read => read.Action("Gravad", "Home")).Group(g => g.Add(d=> d.Series)))
178178
.Transitions(false)
179-
.Theme("bootstrap")
179+
.Theme("sass")
180180
.Title(t => t
181181
.Text("Gravad lax")
182182
.Position(ChartTitlePosition.Bottom)
@@ -199,7 +199,7 @@
199199
.Name("market-inlagd")
200200
.DataSource(ds => ds.Read(read => read.Action("Inlagd", "Home")).Group(g => g.Add(d=> d.Series)))
201201
.Transitions(false)
202-
.Theme("bootstrap")
202+
.Theme("sass")
203203
.Title(t => t
204204
.Text("Inlagd Sill")
205205
.Position(ChartTitlePosition.Bottom)
@@ -222,7 +222,7 @@
222222
.Name("market-spageslid")
223223
.DataSource(ds => ds.Read(read => read.Action("Spegesild", "Home")).Group(g => g.Add(d=> d.Series)))
224224
.Transitions(false)
225-
.Theme("bootstrap")
225+
.Theme("sass")
226226
.Title(t => t
227227
.Text("Spageslid")
228228
.Position(ChartTitlePosition.Bottom)
@@ -603,3 +603,13 @@
603603
</section>
604604
<footer>Copyright © @DateTime.Now.Year Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.</footer>
605605
</div>
606+
607+
<script>
608+
$(document).ready(function () {
609+
kendo.ui.icon($(".revenue-icon"), { icon: 'dollar' });
610+
kendo.ui.icon($(".spd-icon"), { icon: 'chart-column-clustered' });
611+
kendo.ui.icon($(".spr-icon"), { icon: 'graph' });
612+
kendo.ui.icon($(".share-icon"), { icon: 'chart-doughnut' });
613+
614+
});
615+
</script>

Kendo-UI-Bootstrap-Integration/src/Kendo-UI-Bootstrap-Integration/Views/Shared/_Layout.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<link rel="stylesheet" href="@Url.Content("~/css/styles.css")" />
1515
</head>
1616
<body>
17+
@(Html.Kendo().DefaultSettings())
1718
<script>
1819
function filterSwatches() {
1920
return {

Kendo-UI-Bootstrap-Integration/src/Kendo-UI-Bootstrap-Integration/wwwroot/css/styles.css

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
@font-face {
2-
font-family: "Kendo UI";
3-
src: url("https://kendo.cdn.telerik.com/2023.1.117/styles/images/kendoui.woff") format("woff"), url("https://kendo.cdn.telerik.com/2023.1.117/styles/images/kendoui.ttf") format("truetype");
4-
}
5-
6-
body:before {
7-
font-family: "Kendo UI";
8-
content: "\a0";
9-
font-size: 0;
10-
width: 0;
11-
height: 0;
12-
position: absolute;
13-
z-index: -1;
14-
}
15-
161
html,
172
body {
183
margin: 0;
@@ -29,6 +14,7 @@ header {
2914
font-size: 20px;
3015
color: #fff;
3116
background-color: #272727;
17+
max-height: 80px;
3218
}
3319

3420
header h1,
@@ -101,11 +87,6 @@ header {
10187
line-height: 45px;
10288
}
10389

104-
header .k-dropdown .k-i-arrow-s {
105-
background-image: url("http://cdn.kendostatic.com/2023.1.117/styles/Bootstrap/sprite.png");
106-
background-position: -16px -32px;
107-
}
108-
10990
header .k-dropdown .k-input {
11091
color: #fff;
11192
}

0 commit comments

Comments
 (0)