[longomatch] Try to use the same name for panels everywhere.



commit 0e1d98fce2b36bafab785e5ff92d1707959b6002
Author: Julien Moutte <julien fluendo com>
Date:   Tue Sep 9 20:56:05 2014 +0200

    Try to use the same name for panels everywhere.

 LongoMatch.GUI/Gui/Panel/SportsTemplatesPanel.cs   |    2 +-
 LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs    |    2 +-
 LongoMatch.GUI/Gui/Panel/WelcomePanel.cs           |   72 ++++++-------------
 .../gtk-gui/LongoMatch.Gui.MainWindow.cs           |    8 +-
 4 files changed, 29 insertions(+), 55 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Panel/SportsTemplatesPanel.cs 
b/LongoMatch.GUI/Gui/Panel/SportsTemplatesPanel.cs
index 842e57e..1012033 100644
--- a/LongoMatch.GUI/Gui/Panel/SportsTemplatesPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/SportsTemplatesPanel.cs
@@ -48,7 +48,7 @@ namespace LongoMatch.Gui.Panel
 
                        // Assign images
                        panelheader1.ApplyVisible = false;
-                       panelheader1.Title = "ANALYSIS DASHBOARD EDITOR";
+                       panelheader1.Title = "ANALYSIS DASHBOARDS MANAGER";
                        panelheader1.BackClicked += (sender, o) => {
                                if (BackEvent != null)
                                        BackEvent();
diff --git a/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs b/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs
index 1b98810..0b05b68 100644
--- a/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs
@@ -98,7 +98,7 @@ namespace LongoMatch.Gui.Panel
                        teamtemplateeditor1.TemplateSaved += (s, e) => {SaveLoadedTeam ();};
 
                        panelheader1.ApplyVisible = false;
-                       panelheader1.Title = "TEAM EDITOR";
+                       panelheader1.Title = "TEAMS MANAGER";
                        panelheader1.BackClicked += (sender, o) => {
                                PromptSave ();
                                if (BackEvent != null)
diff --git a/LongoMatch.GUI/Gui/Panel/WelcomePanel.cs b/LongoMatch.GUI/Gui/Panel/WelcomePanel.cs
index 2e54b96..5c0b8c5 100644
--- a/LongoMatch.GUI/Gui/Panel/WelcomePanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/WelcomePanel.cs
@@ -39,9 +39,9 @@ namespace LongoMatch.Gui.Panel
                                           new Action (() => Config.EventsBroker.EmitImportProject ())),
                        new WelcomeButton ("longomatch-project", Catalog.GetString ("Projects\nmanager"),
                                           new Action (() => Config.EventsBroker.EmitManageProjects ())),
-                       new WelcomeButton ("longomatch-template-config", Catalog.GetString 
("Analysis\nmanager"),
+                       new WelcomeButton ("longomatch-template-config", Catalog.GetString 
("Analysis\nDashboards\nmanager"),
                                           new Action (() => Config.EventsBroker.EmitManageCategories ())),
-                       new WelcomeButton ("longomatch-team-config", Catalog.GetString ("Team\nmanager"),
+                       new WelcomeButton ("longomatch-team-config", Catalog.GetString ("Teams\nmanager"),
                                           new Action (() => Config.EventsBroker.EmitManageTeams ())),
                                           
                };
@@ -51,8 +51,7 @@ namespace LongoMatch.Gui.Panel
                public WelcomePanel ()
                {
                        this.Build ();
-                       HeightRequest = MinHeight;
-                       WidthRequest = MinWidth;
+
                        buttonWidgets = new List<Widget>();
                        hbox1.BorderWidth = StyleConf.WelcomeBorder;
                        preferencesbutton.Clicked += HandlePreferencesClicked;
@@ -60,37 +59,9 @@ namespace LongoMatch.Gui.Panel
                        Name = "WelcomePanel";
                }
 
-               int MinWidth {
-                       get {
-                               return Math.Max (StyleConf.WelcomeLogoWidth,
-                                                StyleConf.WelcomeIconSize * 3 +
-                                                StyleConf.WelcomeIconsHSpacing * 2) +
-                                       StyleConf.WelcomeMinWidthBorder;
-                       }
-               }
-               
-               int MinHeight {
-                       get {
-                               return  HeaderHeight + StyleConf.WelcomeLogoHeight +
-                                       (IconHeight + StyleConf.WelcomeIconsVSpacing) * NRows + 20;
-                       }
-               }
-               
-               int IconHeight {
+               uint NRows {
                        get {
-                               return StyleConf.WelcomeLogoHeight + StyleConf.WelcomeIconsTextSpacing +
-                                       StyleConf.WelcomeTextHeight;
-                       }
-               }
-               
-               int HeaderHeight {
-                       get {
-                               return StyleConf.WelcomeBorder * 2 + StyleConf.WelcomeIconSize;
-                       }
-               }
-               int NRows {
-                       get {
-                               return (int)Math.Ceiling ((float)buttons.Length / 
StyleConf.WelcomeIconsPerRow);
+                               return (uint) (buttons.Length / StyleConf.WelcomeIconsPerRow);
                        }
                }
                
@@ -101,7 +72,9 @@ namespace LongoMatch.Gui.Panel
 
                void Create ()
                {
-                       int padding;
+                       // One extra row for our logo
+                       tablewidget.NRows = (uint) NRows + 1;
+                       tablewidget.NColumns = StyleConf.WelcomeIconsPerRow;
 
                        Gtk.Image prefImage = new Gtk.Image (
                                Helpers.Misc.LoadIcon ("longomatch-preferences",
@@ -110,34 +83,33 @@ namespace LongoMatch.Gui.Panel
                        preferencesbutton.WidthRequest = StyleConf.WelcomeIconSize;
                        preferencesbutton.HeightRequest = StyleConf.WelcomeIconSize;
 
+                       // Our logo
                        logoImage = new Gtk.Image ();
                        logoImage.Pixbuf = Gdk.Pixbuf.LoadFromResource ("longomatch-dark-bg.svg");
                        logoImage.WidthRequest = StyleConf.WelcomeLogoWidth;
                        logoImage.HeightRequest = StyleConf.WelcomeLogoHeight;
-                       fixedwidget.Put (logoImage, 0, 0);
+                       tablewidget.Attach (logoImage, 0, StyleConf.WelcomeIconsPerRow, 0, 1,
+                                           AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | 
AttachOptions.Fill, 0, StyleConf.WelcomeIconsVSpacing / 2);
 
-                       padding = StyleConf.WelcomeLogoHeight + StyleConf.WelcomeIconsVSpacing;
-                       for (int i=0; i < buttons.Length; i++) {
+                       for (uint i=0; i < buttons.Length; i++) {
                                Widget b;
-                               int x, y;
-                               
-                               x = (StyleConf.WelcomeIconsHSpacing + StyleConf.WelcomeIconSize) *
-                                       (i % StyleConf.WelcomeIconsPerRow);
-                               y = (StyleConf.WelcomeIconsVSpacing + StyleConf.WelcomeIconSize) *
-                                       (i / StyleConf.WelcomeIconsPerRow);
+                               uint c, l;
+
+                               c = i % StyleConf.WelcomeIconsPerRow;
+                               l = i / StyleConf.WelcomeIconsPerRow + 1;
 
                                b = CreateButton (buttons[i]);
-                               fixedwidget.Put (b, x, y + padding);
+                               tablewidget.Attach (b, c, c + 1, l, l + 1,
+                                                   AttachOptions.Expand | AttachOptions.Fill, 
AttachOptions.Expand | AttachOptions.Fill, 0, StyleConf.WelcomeIconsVSpacing / 2);
                                buttonWidgets.Add (b);
                        }
-                       fixedwidget.HeightRequest = StyleConf.WelcomeLogoHeight +
-                                       (IconHeight + StyleConf.WelcomeIconsVSpacing) * NRows; 
                }
                
                Widget CreateButton (WelcomeButton b) {
                        Button button;
                        VBox box;
                        Gtk.Image image;
+                       Gtk.Alignment alignment;
                        Label label;
                        
                        image = new Gtk.Image (
@@ -149,15 +121,17 @@ namespace LongoMatch.Gui.Panel
                        button.WidthRequest = StyleConf.WelcomeIconSize;
                        button.Add (image);
 
+                       alignment = new Alignment (0.5f, 0.5f, 0.0f, 0.0f);
+                       alignment.Add (button);
+
                        label = new Label (b.text);
                        label.LineWrap = true;
                        label.LineWrapMode = Pango.WrapMode.Word;
                        label.Justify = Justification.Center;
 
                        box = new VBox (false, StyleConf.WelcomeIconsTextSpacing);
-                       box.PackStart (button, false, false, 0);
+                       box.PackStart (alignment, false, false, 0);
                        box.PackStart (label, false, false, 0);
-                       box.HeightRequest = IconHeight;
                        box.ShowAll ();
                        box.Name = b.name + "roundedbutton";
                        return box;
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
index d0ba227..d3114d5 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -69,8 +69,8 @@ namespace LongoMatch.Gui
                        this.ProjectsManagerAction = new global::Gtk.Action ("ProjectsManagerAction", 
global::Mono.Unix.Catalog.GetString ("Projects Manager"), null, null);
                        this.ProjectsManagerAction.ShortLabel = global::Mono.Unix.Catalog.GetString 
("Database Manager");
                        w1.Add (this.ProjectsManagerAction, null);
-                       this.CategoriesTemplatesManagerAction = new global::Gtk.Action 
("CategoriesTemplatesManagerAction", global::Mono.Unix.Catalog.GetString ("Categories Templates Manager"), 
null, null);
-                       this.CategoriesTemplatesManagerAction.ShortLabel = 
global::Mono.Unix.Catalog.GetString ("Templates Manager");
+                       this.CategoriesTemplatesManagerAction = new global::Gtk.Action 
("CategoriesTemplatesManagerAction", global::Mono.Unix.Catalog.GetString ("Analysis Dashboards Manager"), 
null, null);
+                       this.CategoriesTemplatesManagerAction.ShortLabel = 
global::Mono.Unix.Catalog.GetString ("Dashboards Manager");
                        w1.Add (this.CategoriesTemplatesManagerAction, null);
                        this.ViewAction = new global::Gtk.Action ("ViewAction", 
global::Mono.Unix.Catalog.GetString ("_View"), null, null);
                        this.ViewAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_View");
@@ -93,8 +93,8 @@ namespace LongoMatch.Gui
                        this.ExportProjectToCSVFileAction.ShortLabel = global::Mono.Unix.Catalog.GetString 
("Export Project To CSV File");
                        this.ExportProjectToCSVFileAction.Visible = false;
                        w1.Add (this.ExportProjectToCSVFileAction, null);
-                       this.TeamsTemplatesManagerAction = new global::Gtk.Action 
("TeamsTemplatesManagerAction", global::Mono.Unix.Catalog.GetString ("Teams Templates Manager"), null, null);
-                       this.TeamsTemplatesManagerAction.ShortLabel = global::Mono.Unix.Catalog.GetString 
("Teams Templates Manager");
+                       this.TeamsTemplatesManagerAction = new global::Gtk.Action 
("TeamsTemplatesManagerAction", global::Mono.Unix.Catalog.GetString ("Teams Manager"), null, null);
+                       this.TeamsTemplatesManagerAction.ShortLabel = global::Mono.Unix.Catalog.GetString 
("Teams Manager");
                        w1.Add (this.TeamsTemplatesManagerAction, null);
                        this.HelpAction1 = new global::Gtk.Action ("HelpAction1", 
global::Mono.Unix.Catalog.GetString ("_Help"), null, "gtk-help");
                        this.HelpAction1.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Help");


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