Skip to content
This repository was archived by the owner on Jul 2, 2022. It is now read-only.

Commit 2d5a53f

Browse files
committed
Revert "Just having some fun"
This reverts commit 89148da. Conflicts: lib/CodeFramework
1 parent d570380 commit 2d5a53f

3 files changed

Lines changed: 29 additions & 81 deletions

File tree

CodeHub.iOS/Images/Images.cs

Lines changed: 29 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.IO;
33
using MonoTouch.Foundation;
44
using MonoTouch.UIKit;
5-
using System.Collections.Generic;
65

76
namespace CodeHub.iOS
87
{
@@ -21,99 +20,48 @@ public static UIImage FromFileAuto(string path)
2120
var template = img.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
2221
return template;
2322
}
24-
25-
public static UIImage WithTint(this UIImage img, UIColor color)
26-
{
27-
UIGraphics.BeginImageContextWithOptions(img.Size, false, img.CurrentScale);
28-
var context = UIGraphics.GetCurrentContext();
29-
context.TranslateCTM(0, img.Size.Height);
30-
context.ScaleCTM(1.0f, -1.0f);
31-
context.SetBlendMode(MonoTouch.CoreGraphics.CGBlendMode.Normal);
32-
var rect = new System.Drawing.RectangleF(0, 0, img.Size.Width, img.Size.Height);
33-
context.ClipToMask(rect, img.CGImage);
34-
color.SetFill();
35-
context.FillRect(rect);
36-
var i = UIGraphics.GetImageFromCurrentImageContext();
37-
UIGraphics.EndImageContext();
38-
return i;
39-
}
40-
41-
private static readonly Dictionary<string, UIImage> _retainedImages = new Dictionary<string, UIImage>();
42-
public static UIImage LoadTemplateImage(string path, UIColor color, bool retain = true)
43-
{
44-
if (_retainedImages.ContainsKey(path))
45-
return _retainedImages[path];
46-
47-
using (var img = UIImageHelper.FromFileAuto(path))
48-
{
49-
using (var template = img.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate))
50-
{
51-
var tintedImage = template.WithTint(color);
52-
if (retain)
53-
_retainedImages.Add(path, tintedImage);
54-
return tintedImage;
55-
}
56-
}
57-
}
5823

5924
public static UIImage Merge { get { return FromBundle("/Images/merge"); } }
25+
public static UIImage Language { get { return FromBundle("/Images/language"); } }
6026
public static UIImage Webpage { get { return FromBundle("/Images/webpage"); } }
61-
27+
public static UIImage Repo { get { return FromBundle("/Images/repo"); } }
28+
public static UIImage Size { get { return FromBundle("/Images/size"); } }
29+
public static UIImage Locked { get { return FromBundle("/Images/locked"); } }
30+
public static UIImage Unlocked { get { return FromBundle("/Images/unlocked"); } }
31+
public static UIImage Heart { get { return FromBundle("/Images/heart"); } }
32+
public static UIImage Fork { get { return FromBundle("/Images/fork"); } }
6233
public static UIImage Pencil { get { return FromBundle("/Images/pencil"); } }
6334
public static UIImage Tag { get { return FromBundle("/Images/tag"); } }
35+
public static UIImage Comments { get { return FromBundle("/Images/comments"); } }
36+
public static UIImage BinClosed { get { return FromBundle("/Images/bin_closed"); } }
6437
public static UIImage Milestone { get { return FromBundle("/Images/milestone"); } }
6538
public static UIImage Script { get { return FromBundle("/Images/script"); } }
66-
67-
public static UIImage Create { get { return FromBundle("/Images/create"); } }
68-
69-
public static UIImage File { get { return LoadTemplateImage("Images/file", UIColor.FromRGB(44, 62, 80)); } }
70-
71-
public static UIImage Following { get { return LoadTemplateImage("Images/following", UIColor.FromRGB(192, 57, 43)); } }
72-
public static UIImage Folder { get { return LoadTemplateImage("Images/folder", UIColor.FromRGB(243, 156, 18)); } }
73-
74-
public static UIImage BinClosed { get { return LoadTemplateImage("Images/bin_closed", UIColor.FromRGB(231, 76, 60)); } }
39+
public static UIImage Commit { get { return FromBundle("/Images/commit"); } }
40+
public static UIImage Following { get { return FromBundle("/Images/following"); } }
41+
public static UIImage Folder { get { return FromBundle("/Images/folder"); } }
42+
public static UIImage File { get { return FromBundle("/Images/file"); } }
43+
public static UIImage Branch { get { return FromBundle("/Images/branch"); } }
44+
public static UIImage Create { get { return FromBundle("/Images/create"); } }
7545

76-
public static UIImage Comments { get { return LoadTemplateImage("Images/comments", UIColor.FromRGB(142, 68, 173)); } }
77-
public static UIImage Heart { get { return LoadTemplateImage("Images/heart", UIColor.FromRGB(231, 76, 60)); } }
78-
79-
public static UIImage Repo { get { return LoadTemplateImage("Images/repo", UIColor.FromRGB(52, 73, 94)); } }
80-
public static UIImage Branch { get { return LoadTemplateImage("Images/branch", UIColor.FromRGB(0x6c, 0xc6, 0x44)); } }
81-
82-
public static UIImage Language { get { return LoadTemplateImage("Images/language", UIColor.FromRGB(52, 73, 94)); } }
83-
public static UIImage Size { get { return LoadTemplateImage("Images/size", UIColor.FromRGB(41, 128, 185)); } }
84-
85-
public static UIImage Locked { get { return LoadTemplateImage("Images/locked", UIColor.FromRGB(241, 196, 15), false); } }
86-
public static UIImage Unlocked { get { return LoadTemplateImage("Images/unlocked", UIColor.FromRGB(241, 196, 15), false); } }
87-
88-
public static UIImage Commit { get { return LoadTemplateImage("Images/commit", UIColor.FromRGB(0x15, 0x6f, 0x9e)); } }
89-
public static UIImage Fork { get { return LoadTemplateImage("Images/fork", UIColor.FromRGB(0x6c, 0xc6, 0x44)); } }
90-
public static UIImage Issue { get { return LoadTemplateImage("Images/flag", UIColor.FromRGB(0x6c, 0xc6, 0x44)); } }
91-
public static UIImage Hand { get { return LoadTemplateImage("Images/hand", UIColor.FromRGB(0x9e, 0x15, 0x7c)); } }
92-
93-
public static UIImage Star { get { return LoadTemplateImage("Images/star", UIColor.FromRGB(241, 196, 15)); } }
94-
95-
public static UIImage User { get { return LoadTemplateImage("Images/user", UIColor.FromRGB(52, 152, 219)); } }
96-
public static UIImage Priority { get { return LoadTemplateImage("Images/priority", UIColor.FromRGB(243, 156, 18)); } }
97-
public static UIImage Cog { get { return LoadTemplateImage("Images/cog", UIColor.FromRGB(44, 62, 80)); } }
98-
99-
public static UIImage Eye { get { return LoadTemplateImage("Images/eye", UIColor.FromRGB(22, 160, 133)); } }
100-
101-
public static UIImage Event { get { return LoadTemplateImage("Images/events", UIColor.FromRGB(192, 57, 43)); } }
102-
103-
public static UIImage Group { get { return LoadTemplateImage("Images/group", UIColor.FromRGB(39, 174, 96)); } }
46+
public static UIImage Info { get { return FromBundle("/Images/info"); } }
10447

48+
public static UIColor IssueColor { get { return UIColor.FromRGB(0x6c, 0xc6, 0x44); } }
49+
public static UIImage Issue { get { return FromBundle("/Images/flag"); } }
10550

51+
public static UIImage User { get { return FromBundle("/Images/user"); } }
52+
public static UIImage Explore { get { return FromBundle("/Images/explore"); } }
53+
public static UIImage Group { get { return FromBundle("/Images/group"); } }
54+
public static UIImage Event { get { return FromBundle("/Images/events"); } }
55+
public static UIImage Cog { get { return FromBundle("/Images/cog"); } }
56+
public static UIImage Star { get { return FromBundle("/Images/star"); } }
57+
public static UIImage News { get { return FromBundle("/Images/news"); } }
58+
public static UIImage Notifications { get { return FromBundle("/Images/notifications"); } }
59+
public static UIImage Priority { get { return FromBundle("/Images/priority"); } }
10660
public static UIImage Anonymous { get { return FromBundle("/Images/anonymous"); } }
10761

108-
109-
11062
public static UIImage Team { get { return FromFileAuto("Images/team"); } }
111-
112-
//These only appear in the menu
113-
public static UIImage News { get { return FromFileAuto("Images/news"); } }
114-
public static UIImage Info { get { return FromFileAuto("Images/info"); } }
115-
public static UIImage Explore { get { return FromFileAuto("Images/explore"); } }
116-
public static UIImage Notifications { get { return FromFileAuto("Images/notifications"); } }
63+
public static UIImage Eye { get { return FromFileAuto("Images/eye"); } }
64+
public static UIImage Hand { get { return FromFileAuto("Images/hand"); } }
11765
public static UIImage Bug { get { return FromFileAuto("Images/bug"); } }
11866

11967

CodeHub.iOS/Images/info.png

-1 Bytes
Loading

CodeHub.iOS/Images/info@2x.png

-5 Bytes
Loading

0 commit comments

Comments
 (0)