[longomatch] Replace unicode characters with images
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Replace unicode characters with images
- Date: Wed, 5 Nov 2014 19:03:23 +0000 (UTC)
commit b5057d31384dc8ae75795c349087d86560e7b62c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Wed Nov 5 16:28:04 2014 +0100
Replace unicode characters with images
LongoMatch.Core/StyleConf.cs | 4 +-
LongoMatch.Drawing/CanvasObjects/CategoryObject.cs | 41 ++++++++++++++---
data/icons/Makefile.am | 1 +
.../scalable/actions/longomatch-apply-button.svg | 49 ++++++++++++++++++++
4 files changed, 86 insertions(+), 9 deletions(-)
---
diff --git a/LongoMatch.Core/StyleConf.cs b/LongoMatch.Core/StyleConf.cs
index 18316e2..33ff515 100644
--- a/LongoMatch.Core/StyleConf.cs
+++ b/LongoMatch.Core/StyleConf.cs
@@ -90,8 +90,8 @@ namespace LongoMatch.Core.Common
public const string SubsUnlock = "hicolor/scalable/actions/longomatch-player-swap-unlock.svg";
public const string DefaultShield = "hicolor/scalable/actions/longomatch-default-shield.svg";
- public const string EditButton = "hicolor/scalable/actions/longomatch-apply.svg";
- public const string ApplyButton = "hicolor/scalable/actions/longomatch-apply.svg";
+ public const string EditButton = "hicolor/scalable/actions/longomatch-pencil.svg";
+ public const string ApplyButton = "hicolor/scalable/actions/longomatch-apply-button.svg";
public const string CancelButton = "hicolor/scalable/actions/longomatch-mark.svg";
public const string RecordButton = "hicolor/scalable/actions/longomatch-control-record.svg";
diff --git a/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
b/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
index a397a78..191d996 100644
--- a/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
@@ -31,6 +31,10 @@ namespace LongoMatch.Drawing.CanvasObjects
public event ButtonSelectedHandler EditButtonTagsEvent;
static Image iconImage;
+ static Image recImage;
+ static Image editImage;
+ static Image cancelImage;
+ static Image applyImage;
Dictionary <Rectangle, object> rects, buttonsRects;
Dictionary <string, List<Tag>> tagsByGroup;
bool recording, emitEvent, delayEvent, editClicked;
@@ -59,6 +63,22 @@ namespace LongoMatch.Drawing.CanvasObjects
iconImage = new Image (Path.Combine (Config.ImagesDir,
StyleConf.ButtonEventIcon));
}
+ if (recImage == null) {
+ recImage = new Image (Path.Combine (Config.IconsDir,
+ StyleConf.RecordButton));
+ }
+ if (editImage == null) {
+ editImage = new Image (Path.Combine (Config.IconsDir,
+ StyleConf.EditButton));
+ }
+ if (cancelImage == null) {
+ cancelImage = new Image (Path.Combine (Config.IconsDir,
+ StyleConf.CancelButton));
+ }
+ if (applyImage == null) {
+ applyImage = new Image (Path.Combine (Config.IconsDir,
+ StyleConf.ApplyButton));
+ }
MinWidth = 100;
MinHeight = HeaderHeight * 2;
}
@@ -113,7 +133,7 @@ namespace LongoMatch.Drawing.CanvasObjects
&& Mode != TagMode.Edit;
}
}
-
+
bool ShowTags {
get {
return Button.ShowSubcategories && Button.AnalysisEventType.Tags.Count != 0;
@@ -430,10 +450,12 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.StrokeColor = BackgroundColor;
tk.DrawRectangle (pos, width, height);
tk.StrokeColor = Color.Green1;
+ tk.FillColor = Color.Green1;
tk.FontSize = StyleConf.ButtonButtonsFontSize;
- tk.DrawText (pos, width, height, "✐ EDIT");
editRect.Update (pos, width, height);
buttonsRects [editRect] = editbutton;
+ pos = new Point (pos.X, pos.Y + 5);
+ tk.DrawImage (pos, width, height - 10, editImage, true, true);
}
void DrawSelectedTags (IDrawingToolkit tk)
@@ -495,15 +517,17 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.LineWidth = 0;
tk.DrawRectangle (pos, width, height);
tk.StrokeColor = Color.Green1;
+ tk.FillColor = Color.Green1;
tk.FontSize = 12;
- tk.DrawText (pos, width, height, " ✔ ");
applyRect.Update (pos, width, height);
- buttonsRects[applyRect] = applyButton;
+ buttonsRects [applyRect] = applyButton;
+ pos = new Point (pos.X, pos.Y + 5);
+ tk.DrawImage (pos, width, height - 10, applyImage, true, true);
}
void DrawRecordButton (IDrawingToolkit tk)
{
- Point pos;
+ Point pos, bpos;
double width, height;
if (Button.TagMode != TagMode.Free) {
@@ -512,6 +536,7 @@ namespace LongoMatch.Drawing.CanvasObjects
pos = new Point (Position.X + Width - StyleConf.ButtonRecWidth,
Position.Y);
+ bpos = new Point (pos.X, pos.Y + 5);
width = StyleConf.ButtonRecWidth;
height = HeaderHeight;
@@ -522,12 +547,14 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.LineWidth = StyleConf.ButtonLineWidth;
tk.DrawRectangle (pos, width, height);
tk.StrokeColor = Color.Red1;
- tk.DrawText (pos, width, height, "● REC");
+ tk.FillColor = Color.Red1;
+ tk.DrawImage (bpos, width, height - 10, recImage, true, true);
} else {
tk.FillColor = tk.StrokeColor = BackgroundColor;
tk.DrawRectangle (pos, width, height);
tk.StrokeColor = TextColor;
- tk.DrawText (pos, width, height, "✕");
+ tk.FillColor = TextColor;
+ tk.DrawImage (bpos, width, height - 10, cancelImage, true, true);
cancelRect.Update (pos, width, height);
buttonsRects [cancelRect] = cancelButton;
}
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index c7272c9..7714e39 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -16,6 +16,7 @@ nobase_dist_icons_DATA = Makefile.am \
hicolor/scalable/actions/gtk-save.svg \
hicolor/scalable/actions/longomat-project.svg \
hicolor/scalable/actions/longomatch-angle.svg \
+ hicolor/scalable/actions/longomatch-apply-button.svg \
hicolor/scalable/actions/longomatch-apply.svg \
hicolor/scalable/actions/longomatch-arrow.svg \
hicolor/scalable/actions/longomatch-back.svg \
diff --git a/data/icons/hicolor/scalable/actions/longomatch-apply-button.svg
b/data/icons/hicolor/scalable/actions/longomatch-apply-button.svg
new file mode 100644
index 0000000..58a6e27
--- /dev/null
+++ b/data/icons/hicolor/scalable/actions/longomatch-apply-button.svg
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="26"
+ height="26"
+ viewBox="0 0 26 26"
+ enable-background="new 0 0 58 58"
+ xml:space="preserve"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="longomatch-apply-button.svg"><metadata
+ id="metadata8"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs6" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="920"
+ inkscape:window-height="640"
+ id="namedview4"
+ showgrid="false"
+ inkscape:zoom="7.7882543"
+ inkscape:cx="29"
+ inkscape:cy="29"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" /><path
+ id="checkmark_1_"
+ d="M 10.561838,24 C 10.101658,24 9.6608553,23.795072 9.3353391,23.432922 L 0.50861904,13.049876 C
0.18310285,12.686644 0,12.192213 0,11.678265 0,11.162149 0.18310285,10.668802 0.50861904,10.307738 L
1.7341487,8.935041 C 2.0732281,8.55446 2.5169376,8.36688 2.9596784,8.36688 c 0.4446783,0 0.8874191,0.188665
1.2264985,0.568161 L 10.562806,14.557023 21.812491,2.5692459 C 22.138007,2.2038442 22.57881,2 23.038989,2 l
0,0 c 0.460179,0 0.900982,0.2038442 1.226499,0.5692459 l 1.226498,1.3716116 c 0.67719,0.7557418
0.67719,1.985313 9.69e-4,2.7410549 L 11.788336,23.431838 C 11.464757,23.793987 11.021048,24 10.561838,24 z"
+ inkscape:connector-curvature="0"
+ style="fill:#50b44b" /></svg>
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]