[longomatch] Align teams button in the tagging widget



commit c0ced7a156cb2a18f3157fa0f185a668d40b42e4
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sat Nov 22 11:47:02 2014 +0100

    Align teams button in the tagging widget

 LongoMatch.Core/StyleConf.cs                       |    2 +-
 LongoMatch.Drawing/CanvasObjects/ButtonObject.cs   |    2 +-
 .../CanvasObjects/PlayersTaggerObject.cs           |   31 ++++++++++---------
 3 files changed, 18 insertions(+), 17 deletions(-)
---
diff --git a/LongoMatch.Core/StyleConf.cs b/LongoMatch.Core/StyleConf.cs
index b3a3c7a..59f087f 100644
--- a/LongoMatch.Core/StyleConf.cs
+++ b/LongoMatch.Core/StyleConf.cs
@@ -102,7 +102,7 @@ namespace LongoMatch.Core.Common
                public const int ButtonHeaderHeight = 22;
                public const int ButtonHeaderWidth = 5 + 34 + 5;
                public const int ButtonRecWidth = 40;
-               public const int ButtonLineWidth = 3;
+               public const int ButtonLineWidth = 2;
                public const int ButtonHeaderFontSize = 14;
                public const int ButtonNameFontSize = 18;
                public const int ButtonTimerFontSize = 24;
diff --git a/LongoMatch.Drawing/CanvasObjects/ButtonObject.cs 
b/LongoMatch.Drawing/CanvasObjects/ButtonObject.cs
index f322f10..1da89d1 100644
--- a/LongoMatch.Drawing/CanvasObjects/ButtonObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/ButtonObject.cs
@@ -24,7 +24,7 @@ namespace LongoMatch.Drawing.CanvasObjects
 {
        public class ButtonObject: CanvasButtonObject, IMovableObject
        {
-               const int BORDER_SIZE = 4;
+               const int BORDER_SIZE = 8;
                const int SELECTION_SIZE = 6;
                protected ISurface backBufferSurface;
 
diff --git a/LongoMatch.Drawing/CanvasObjects/PlayersTaggerObject.cs 
b/LongoMatch.Drawing/CanvasObjects/PlayersTaggerObject.cs
index ef7a87e..99e0d1d 100644
--- a/LongoMatch.Drawing/CanvasObjects/PlayersTaggerObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/PlayersTaggerObject.cs
@@ -39,8 +39,8 @@ namespace LongoMatch.Drawing.CanvasObjects
                public event PlayersSubstitutionHandler PlayersSubstitutionEvent;
                public event PlayersSelectionChangedHandler PlayersSelectionChangedEvent;
                public event TeamSelectionChangedHandler TeamSelectionChangedEvent;
-               const int SUBSTITUTION_BUTTONS_HEIGHT = 40;
-               const int SUBSTITUTION_BUTTONS_WIDTH = 60;
+               const int BUTTONS_HEIGHT = 40;
+               const int BUTTONS_WIDTH = 60;
                ButtonObject subPlayers, subInjury, homeButton, awayButton;
                TeamTemplate homeTeam, awayTeam;
                Image background;
@@ -463,13 +463,13 @@ namespace LongoMatch.Drawing.CanvasObjects
                        homeButton = new ButtonObject ();
                        homeButton.Toggle = true;
                        homeButton.ClickedEvent += HandleTeamClickedEvent;
-                       homeButton.Width = SUBSTITUTION_BUTTONS_WIDTH * 2 - 2;
-                       homeButton.Height = SUBSTITUTION_BUTTONS_HEIGHT - 1;
+                       homeButton.Width = BUTTONS_WIDTH;
+                       homeButton.Height = BUTTONS_HEIGHT;
                        homeButton.RedrawEvent += (co, area) => {EmitRedrawEvent (homeButton, area);};
                        awayButton = new ButtonObject ();
                        awayButton.Toggle = true;
-                       awayButton.Width = SUBSTITUTION_BUTTONS_WIDTH * 2 - 2;
-                       awayButton.Height = SUBSTITUTION_BUTTONS_HEIGHT - 1;
+                       awayButton.Width = BUTTONS_WIDTH;
+                       awayButton.Height = BUTTONS_HEIGHT;
                        awayButton.ClickedEvent += HandleTeamClickedEvent;
                        awayButton.RedrawEvent += (co, area) => {EmitRedrawEvent (awayButton, area);};
                }
@@ -710,28 +710,29 @@ namespace LongoMatch.Drawing.CanvasObjects
                                2 * NTeams * Config.Style.TeamTaggerBenchBorder; 
                        height = field.Height;
                        Image.ScaleFactor ((int)width, (int)height, (int)Width,
-                                          (int)Height - SUBSTITUTION_BUTTONS_HEIGHT,
+                                          (int)Height - BUTTONS_HEIGHT,
                                           out scaleX, out scaleY, out offset);
-                       offset.Y += SUBSTITUTION_BUTTONS_HEIGHT;
+                       offset.Y += BUTTONS_HEIGHT;
                        tk.Begin ();
                        tk.Clear (Config.Style.PaletteBackground);
 
                        /* Draw substitution buttons */
                        if (subPlayers.Visible) {
-                               subPlayers.Position = new Point (Width / 2 - SUBSTITUTION_BUTTONS_WIDTH / 2,
-                                                                offset.Y - SUBSTITUTION_BUTTONS_HEIGHT);
-                               subPlayers.Width = SUBSTITUTION_BUTTONS_WIDTH;
-                               subPlayers.Height = SUBSTITUTION_BUTTONS_HEIGHT;
+                               subPlayers.Position = new Point (Width / 2 - BUTTONS_WIDTH / 2,
+                                                                offset.Y - BUTTONS_HEIGHT);
+                               subPlayers.Width = BUTTONS_WIDTH;
+                               subPlayers.Height = BUTTONS_HEIGHT;
                                subPlayers.Draw (tk, area);
                        }
                        if (homeButton.Visible) {
                                /* Draw local team button */
-                               homeButton.Position = new Point (Position.X + offset.X, offset.Y - 
homeButton.Height);
+                               double x = Position.X + Config.Style.TeamTaggerBenchBorder * scaleX + 
offset.X; 
+                               homeButton.Position = new Point (x, offset.Y - homeButton.Height);
                                homeButton.Draw (tk, area);
                        }
                        if (awayButton.Visible) {
-                               awayButton.Position = new Point ((Position.X + Width - offset.X) - 
awayButton.Width,
-                                                                offset.Y - awayButton.Height);
+                               double x = (Position.X + Width - offset.X - 
Config.Style.TeamTaggerBenchBorder * scaleX) - awayButton.Width; 
+                               awayButton.Position = new Point (x, offset.Y - awayButton.Height);
                                awayButton.Draw (tk, area);
                        }
 


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