[chronojump] CairoPaintBarsPreRunSimple with title



commit 4a1f041d7ee80c2e2f692da161f12a7f500d6f96
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Aug 26 12:10:20 2021 +0200

    CairoPaintBarsPreRunSimple with title

 src/gui/app1/run.cs     |  9 ++++++++-
 src/gui/eventExecute.cs | 20 ++++++++++++++++++--
 2 files changed, 26 insertions(+), 3 deletions(-)
---
diff --git a/src/gui/app1/run.cs b/src/gui/app1/run.cs
index 4ef618e82..b44167e45 100644
--- a/src/gui/app1/run.cs
+++ b/src/gui/app1/run.cs
@@ -206,8 +206,15 @@ public partial class ChronoJumpWindow
                
                //if(eventGraph.personMAXAtSQLAllSessions > 0 || eventGraph.runsAtSQL.Count > 0)
                //      PrepareRunSimpleGraph(eventGraph, false); //don't animate
+
+               string personStr = "";
+               if(! radio_contacts_graph_allPersons.Active)
+                       personStr = currentPerson.Name;
+
                cairoPaintBarsPre = new CairoPaintBarsPreRunSimple (
-                               event_execute_drawingarea_cairo, preferences.fontType.ToString(), 
current_mode, "title runs");
+                               event_execute_drawingarea_cairo, preferences.fontType.ToString(), 
current_mode,
+                               typeTemp, personStr);
+
                cairoPaintBarsPre.StoreEventGraphRuns (eventGraph);
                PrepareRunSimpleGraph(cairoPaintBarsPre.eventGraphRunsStored, false);
        }
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 5769aa9e1..d6d47e644 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -3219,6 +3219,22 @@ public abstract class CairoPaintBarsPre
        protected abstract bool haveDataToPlot ();
        protected abstract void paintSpecific();
 
+       protected string generateTitle (string testName, string personName)
+       {
+               string titleStr = "";
+               string sep = "";
+               if(testName != "")
+               {
+                       titleStr = testName;
+                       sep = " - ";
+               }
+               if(personName != "")
+                       titleStr += sep + personName;
+
+               return titleStr;
+       }
+
+
        //TODO: this is repeated on this file, think also if move it to gui/cairo/bars.cs
        protected int calculateMaxRowsForTextCairo (List<Event> events, int longestWordSize, bool allJumps, 
bool runsPrintTime)
        {
@@ -3533,9 +3549,9 @@ public class CairoPaintBarsPreJumpSimple : CairoPaintBarsPre
 
 public class CairoPaintBarsPreRunSimple : CairoPaintBarsPre
 {
-       public CairoPaintBarsPreRunSimple (DrawingArea darea, string fontStr, Constants.Modes mode, string 
title)
+       public CairoPaintBarsPreRunSimple (DrawingArea darea, string fontStr, Constants.Modes mode, string 
testName, string personName)
        {
-               initialize (darea, fontStr, mode, title);
+               initialize (darea, fontStr, mode, generateTitle(testName, personName));
        }
 
        public override void StoreEventGraphRuns (PrepareEventGraphRunSimple eventGraph)


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