[longomatch] Use team shield for the tabs icons



commit f094e03d0d43b47897a6b03244b5103f907bfc9e
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Nov 21 19:36:16 2014 +0100

    Use team shield for the tabs icons

 LongoMatch.GUI/Gui/Component/EventsListWidget.cs   |   40 ++++++++++++-
 data/icons/Makefile.am                             |    1 +
 .../scalable/actions/longomatch-category.svg       |   64 ++++++++++++++++++++
 3 files changed, 103 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/EventsListWidget.cs 
b/LongoMatch.GUI/Gui/Component/EventsListWidget.cs
index b1de796..c934c35 100644
--- a/LongoMatch.GUI/Gui/Component/EventsListWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/EventsListWidget.cs
@@ -19,6 +19,7 @@ using System;
 using LongoMatch.Core.Store;
 using LongoMatch.Core.Common;
 using System.Collections.Generic;
+using LongoMatch.Gui.Helpers;
 
 namespace LongoMatch.Gui.Component
 {
@@ -56,8 +57,9 @@ namespace LongoMatch.Gui.Component
                        playsList.Project = project;
                        visitorPlayersList.Project = project;
                        localPlayersList.Project = project;
-                       visitorPlaysList.LabelProp = project.VisitorTeamTemplate.TeamName;
-                       localPlaysList.LabelProp = project.LocalTeamTemplate.TeamName;
+                       SetTabProps (playsList, true);
+                       SetTabProps (localPlayersList, false);
+                       SetTabProps (visitorPlayersList, false);
                        UpdateTeamsModels ();
                }
                
@@ -80,6 +82,40 @@ namespace LongoMatch.Gui.Component
                        visitorPlayersList.SetTeam(project.VisitorTeamTemplate, project.Timeline);
                }
 
+               void SetTabProps (Gtk.Widget widget, bool active)
+               {
+                       Gdk.Pixbuf icon;
+                       Gtk.Image img;
+
+                       img = playsnotebook.GetTabLabel (widget) as Gtk.Image;
+                       if (img == null) {
+                               img = new Gtk.Image ();
+                               img.WidthRequest = StyleConf.NotebookTabSize;
+                               img.HeightRequest = StyleConf.NotebookTabSize;
+                               playsnotebook.SetTabLabel (widget, img);
+                       }
+
+                       if (widget == playsList) {
+                               icon = Misc.LoadIcon ("longomatch-category", StyleConf.NotebookTabIconSize);
+                       } else if (widget == localPlayersList) {
+                               if (project.LocalTeamTemplate.Shield != null) {
+                                       icon = project.LocalTeamTemplate.Shield.Scale 
(StyleConf.NotebookTabIconSize,
+                                                                                      
StyleConf.NotebookTabIconSize).Value;
+                               } else {
+                                       icon = Misc.LoadIcon ("longomatch-default-shield", 
StyleConf.NotebookTabIconSize);
+                               }
+                       } else if (widget == visitorPlayersList) {
+                               if (project.VisitorTeamTemplate.Shield != null) {
+                                       icon = project.VisitorTeamTemplate.Shield.Scale 
(StyleConf.NotebookTabIconSize,
+                                                                                        
StyleConf.NotebookTabIconSize).Value;
+                               } else {
+                                       icon = Misc.LoadIcon ("longomatch-default-shield", 
StyleConf.NotebookTabIconSize);
+                               }
+                       } else {
+                               return;
+                       }
+                       img.Pixbuf = icon;
+               }
        }
 }
 
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index e6e8b67..988f6b6 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -11,6 +11,7 @@ nobase_dist_icons_DATA = Makefile.am \
        hicolor/scalable/actions/longomatch-calendar.svg \
        hicolor/scalable/actions/longomatch-cancel-rec.svg \
        hicolor/scalable/actions/longomatch-category-header.svg \
+       hicolor/scalable/actions/longomatch-category.svg \
        hicolor/scalable/actions/longomatch-circle-fill.svg \
        hicolor/scalable/actions/longomatch-circle.svg \
        hicolor/scalable/actions/longomatch-control-attach.svg \
diff --git a/data/icons/hicolor/scalable/actions/longomatch-category.svg 
b/data/icons/hicolor/scalable/actions/longomatch-category.svg
new file mode 100644
index 0000000..ab28396
--- /dev/null
+++ b/data/icons/hicolor/scalable/actions/longomatch-category.svg
@@ -0,0 +1,64 @@
+<?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="37"
+   height="37"
+   viewBox="0 0 37 37"
+   enable-background="new 0 0 47 37"
+   xml:space="preserve"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="longomatch-category.svg"><metadata
+     id="metadata19"><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="defs17" /><sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="985"
+     inkscape:window-height="480"
+     id="namedview15"
+     showgrid="false"
+     inkscape:zoom="8.2221284"
+     inkscape:cx="23.5"
+     inkscape:cy="18.5"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="Layer_1" /><g
+     id="g3"
+     transform="matrix(1.0237725,0,0,1.0408743,-5.5590021,-0.75676343)"><path
+       d="m 37.381,19.751 -2.2,2.847 -2.848,-2.198 c -0.785,-0.606 -1.913,-0.461 -2.519,0.324 -0.605,0.782 
-0.46,1.91 0.325,2.517 l 2.848,2.199 -2.199,2.849 c -0.606,0.783 -0.461,1.911 0.324,2.518 0.782,0.606 
1.911,0.461 2.518,-0.323 l 2.199,-2.849 2.85,2.199 c 0.784,0.606 1.911,0.461 2.517,-0.323 0.606,-0.786 
0.462,-1.914 -0.323,-2.519 l -2.85,-2.199 2.2,-2.848 c 0.606,-0.786 0.462,-1.913 -0.324,-2.518 -0.785,-0.606 
-1.913,-0.462 -2.518,0.324 z"
+       id="path5"
+       inkscape:connector-curvature="0"
+       style="fill:#6b6b6a" /><path
+       d="M 29.412,5.404 25.841,5.863 25.382,2.293 C 25.256,1.311 24.357,0.615 23.375,0.742 22.391,0.869 
21.697,1.768 21.823,2.751 l 0.459,3.569 -3.571,0.46 c -0.981,0.126 -1.677,1.025 -1.55,2.008 0.125,0.983 
1.024,1.678 2.008,1.552 l 3.569,-0.46 0.46,3.57 c 0.125,0.983 1.024,1.678 2.008,1.551 0.983,-0.126 
1.678,-1.026 1.55,-2.008 L 26.3,9.424 29.87,8.965 C 30.852,8.839 31.548,7.939 31.421,6.957 31.294,5.972 
30.395,5.278 29.412,5.404 z"
+       id="path7"
+       inkscape:connector-curvature="0"
+       style="fill:#6b6b6a" /><path
+       d="m 13.371,13.057 -2.2,2.851 -2.849,-2.2 c -0.785,-0.605 -1.914,-0.46 -2.518,0.323 -0.606,0.785 
-0.46,1.913 0.324,2.518 l 2.848,2.201 -2.199,2.847 c -0.605,0.783 -0.46,1.913 0.324,2.518 0.784,0.606 
1.912,0.46 2.518,-0.323 l 2.199,-2.849 2.851,2.199 c 0.783,0.604 1.91,0.46 2.516,-0.323 0.606,-0.784 
0.46,-1.913 -0.323,-2.519 l -2.849,-2.197 2.199,-2.851 c 0.605,-0.784 0.46,-1.912 -0.323,-2.518 -0.785,-0.605 
-1.914,-0.46 -2.518,0.323 z"
+       id="path9"
+       inkscape:connector-curvature="0"
+       style="fill:#6b6b6a" /><g
+       id="g11"><path
+         d="m 40.489,11.759 0,0 L 39.068,10.662 35.273,7.73 C 34.488,7.125 33.36,7.269 32.754,8.055 c 
-0.605,0.784 -0.46,1.91 0.323,2.517 l 2.256,1.741 c -2.176,0.511 -5.597,1.608 -9.24,3.935 -2.922,1.865 
-5.585,6.029 -6.76,8.042 -0.89,-0.316 -1.855,-0.46 -2.856,-0.332 -3.387,0.436 -5.78,3.535 -5.344,6.921 
0.435,3.388 3.535,5.779 6.921,5.344 3.386,-0.435 5.78,-3.533 5.344,-6.921 -0.167,-1.305 -0.738,-2.457 
-1.562,-3.365 1.188,-2.06 3.605,-5.724 5.868,-7.168 2.965,-1.893 5.79,-2.882 7.724,-3.39 L 33.944,17.3 c 
-0.605,0.785 -0.461,1.912 0.324,2.517 0.784,0.605 1.912,0.461 2.518,-0.323 l 2.93,-3.795 1.084,-1.403 c 
0.29,-0.366 0.442,-0.841 0.379,-1.341 -0.064,-0.496 -0.324,-0.915 -0.69,-1.196 z M 17.591,32.677 c 
-1.427,0.185 -2.734,-0.824 -2.918,-2.253 -0.183,-1.429 0.827,-2.735 2.253,-2.918 1.429,-0.184 2.736,0.824 
2.919,2.253 0.183,1.427 -0.825,2.734 -2.254,2.918 z"
+         id="path13"
+         inkscape:connector-curvature="0"
+         style="fill:#6b6b6a" /></g></g></svg>
\ No newline at end of file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]