[longomatch] Implement prelight/selected/loaded in plays lists



commit fb2e45b2a09d1ebcd9844dc24fbfd654443bcc3b
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Aug 27 14:12:13 2014 +0200

    Implement prelight/selected/loaded in plays lists

 LongoMatch.Core/StyleConf.cs                       |    4 +++
 LongoMatch.Drawing/PlayslistCellRenderer.cs        |   23 ++++++++++++++-----
 .../hicolor/scalable/actions/longomatch-eye.svg    |   14 ++++++++++++
 data/theme/longomatch-dark.json                    |    1 +
 4 files changed, 36 insertions(+), 6 deletions(-)
---
diff --git a/LongoMatch.Core/StyleConf.cs b/LongoMatch.Core/StyleConf.cs
index db5f53c..77a1dd5 100644
--- a/LongoMatch.Core/StyleConf.cs
+++ b/LongoMatch.Core/StyleConf.cs
@@ -57,6 +57,8 @@ namespace LongoMatch.Common
                public const int ListCategoryHeight = 50;
                public const int ListCountRadio = 10;
                public const int ListCountWidth = 20;
+               public const int ListEyeIconOffset = 10;
+               public const string ListEyeIconPath = "hicolor/scalable/actions/longomatch-eye.svg";
 
                public const int TeamsShieldIconSize = 45;
                
@@ -101,6 +103,8 @@ namespace LongoMatch.Common
 
                public Color PaletteBackgroundDark { get; set; }
 
+               public Color PaletteBackgroundDarkBright { get; set; }
+
                public Color PaletteWidgets { get; set; }
 
                public Color PaletteSelected { get; set; }
diff --git a/LongoMatch.Drawing/PlayslistCellRenderer.cs b/LongoMatch.Drawing/PlayslistCellRenderer.cs
index 8f43f12..9d54c31 100644
--- a/LongoMatch.Drawing/PlayslistCellRenderer.cs
+++ b/LongoMatch.Drawing/PlayslistCellRenderer.cs
@@ -20,12 +20,15 @@ using LongoMatch.Interfaces.Drawing;
 using LongoMatch.Common;
 using LongoMatch.Store;
 using LongoMatch.Store.Playlists;
+using System.IO;
 
 namespace LongoMatch.Drawing
 {
        public class PlayslistCellRenderer
        {
        
+               public static ISurface EyeSurface = null;
+       
                public static void RenderSeparationLine (IDrawingToolkit tk, IContext context, Area 
backgroundArea)
                {
                        
@@ -127,8 +130,8 @@ namespace LongoMatch.Drawing
                }
                
                public static void RenderPlay (Color color, Image ss, bool selected, string desc,
-                                              int count, bool isExpanded, IDrawingToolkit tk,
-                                              IContext context, Area backgroundArea, Area cellArea, 
CellState state)
+                                            int count, bool isExpanded, IDrawingToolkit tk,
+                                            IContext context, Area backgroundArea, Area cellArea, CellState 
state)
                {
                        Point selectPoint, textPoint, imagePoint, circlePoint;
                        double textWidth;
@@ -147,9 +150,7 @@ namespace LongoMatch.Drawing
                        
                        tk.LineWidth = 0;
                        if (state.HasFlag (CellState.Prelit)) {
-                               tk.FillColor = Config.Style.PaletteBackgroundLight;
-                       } else if (state.HasFlag (CellState.Selected)) {
-                               tk.FillColor = Config.Style.PaletteBackground;
+                               tk.FillColor = Config.Style.PaletteBackgroundDarkBright;
                        } else {
                                tk.FillColor = Config.Style.PaletteBackgroundDark;
                        }
@@ -161,7 +162,8 @@ namespace LongoMatch.Drawing
                        tk.DrawRectangle (selectPoint, StyleConf.ListSelectedWidth, backgroundArea.Height);
                        tk.FillColor = Config.Style.PaletteBackgroundDark;
                        tk.DrawCircle (circlePoint, (StyleConf.ListSelectedWidth / 2) - 1); 
-                       if (selected) {
+                       if (state.HasFlag (CellState.Selected)) {
+                               tk.FillColor = Config.Style.PaletteBackground;
                                tk.FillColor = Config.Style.PaletteActive;
                                tk.DrawCircle (circlePoint, (StyleConf.ListSelectedWidth / 2) - 2); 
                        }
@@ -172,6 +174,15 @@ namespace LongoMatch.Drawing
                        tk.FontAlignment = FontAlignment.Left;
                        tk.DrawText (textPoint, textWidth, cellArea.Height, desc);
                        
+                       if (selected) {
+                               if (EyeSurface == null) {
+                                       EyeSurface = Config.DrawingToolkit.CreateSurface (
+                                               Path.Combine (Config.IconsDir, StyleConf.ListEyeIconPath));
+                               }
+                               tk.DrawSurface (EyeSurface, new Point (imagePoint.X - EyeSurface.Width - 
StyleConf.ListEyeIconOffset,
+                                                                      imagePoint.Y + backgroundArea.Height / 
2 - EyeSurface.Height /2));
+                       }
+
                        if (ss != null) {
                                tk.DrawImage (imagePoint, StyleConf.ListImageWidth, cellArea.Height, ss, 
true);
                        }
diff --git a/data/icons/hicolor/scalable/actions/longomatch-eye.svg 
b/data/icons/hicolor/scalable/actions/longomatch-eye.svg
new file mode 100644
index 0000000..ed542ef
--- /dev/null
+++ b/data/icons/hicolor/scalable/actions/longomatch-eye.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        width="36px" height="36px" viewBox="0 0 36 36" enable-background="new 0 0 36 36" 
xml:space="preserve">
+<path id="plus_12_" fill="#6A6A6A" d="M1730.626,833.451c-0.297,0-0.535-0.238-0.535-0.535v-5.23h-5.229
+       
c-0.298,0-0.537-0.239-0.537-0.534v-3.461c0-0.298,0.239-0.535,0.537-0.535h5.229v-5.23c0-0.299,0.238-0.537,0.535-0.537h3.461
+       
c0.296,0,0.536,0.238,0.536,0.537v5.23h5.229c0.298,0,0.537,0.237,0.537,0.535v3.461c0,0.295-0.239,0.534-0.537,0.534h-5.229v5.23
+       c0,0.297-0.24,0.535-0.536,0.535H1730.626z"/>
+<path id="eye" fill="#50B44B" 
d="M18,28.782c-6.549,0-12.77-3.716-17.072-10.191c-0.238-0.36-0.238-0.824,0-1.183
+       C5.229,10.932,11.452,7.218,18,7.218c6.548,0,12.772,3.714,17.072,10.19c0.239,0.359,0.239,0.823,0,1.183
+       C30.772,25.066,24.549,28.782,18,28.782z 
M18,11.529c-3.568,0-6.47,2.903-6.47,6.471c0,3.565,2.902,6.468,6.47,6.468
+       c3.565,0,6.468-2.903,6.468-6.468C24.468,14.432,21.564,11.529,18,11.529z"/>
+</svg>
diff --git a/data/theme/longomatch-dark.json b/data/theme/longomatch-dark.json
index 5ed8f3e..5f9e948 100644
--- a/data/theme/longomatch-dark.json
+++ b/data/theme/longomatch-dark.json
@@ -4,6 +4,7 @@
        'PaletteBackground': '#252627FF',
        'PaletteBackgroundLight': '#3b3b3cFF',
        'PaletteBackgroundDark': '#151a20FF',
+       'PaletteBackgroundDarkBright': '#292e33FF',
        'PaletteWidgets': '#6a6a6aFF',
        'PaletteSelected': '#f3f3f3FF',
        'PaletteActive': '#50b44dFF',


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