[chronojump] RunEncoder graph widht/height depending on viewport size
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] RunEncoder graph widht/height depending on viewport size
- Date: Thu, 19 Sep 2019 09:20:12 +0000 (UTC)
commit a2c5f15773ab2633d2a58739dca826eaca3fb6b2
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Sep 19 11:19:56 2019 +0200
RunEncoder graph widht/height depending on viewport size
glade/app1.glade | 173 +++++++-------------------------------------------
src/gui/chronojump.cs | 2 -
src/gui/runEncoder.cs | 19 +++---
3 files changed, 30 insertions(+), 164 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index dae15ea5..d28d3ca1 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -11567,129 +11567,6 @@ Inverted values</property>
<property name="position">2</property>
</packing>
</child>
- <child>
- <widget class="GtkVBox"
id="vbox_run_encoder_width_height">
- <property name="can_focus">False</property>
- <property name="spacing">4</property>
- <child>
- <widget class="GtkHBox" id="hbox168">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">4</property>
- <child>
- <widget class="GtkLabel" id="label51">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label"
translatable="yes">Width</property>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton"
id="race_analyzer_spinbutton_graph_width">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property
name="invisible_char_set">True</property>
- <property
name="primary_icon_activatable">False</property>
- <property
name="secondary_icon_activatable">False</property>
- <property
name="primary_icon_sensitive">True</property>
- <property
name="secondary_icon_sensitive">True</property>
- <property name="adjustment">1440 400 16000 1 10
0</property>
- <property name="climb_rate">1</property>
- <property name="numeric">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label401">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label">px</property>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox288">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">4</property>
- <child>
- <widget class="GtkLabel" id="label399">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label"
translatable="yes">Height</property>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton"
id="race_analyzer_spinbutton_graph_height">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property
name="invisible_char_set">True</property>
- <property
name="primary_icon_activatable">False</property>
- <property
name="secondary_icon_activatable">False</property>
- <property
name="primary_icon_sensitive">True</property>
- <property
name="secondary_icon_sensitive">True</property>
- <property name="adjustment">900 400 8000 1 10
0</property>
- <property name="climb_rate">1</property>
- <property name="numeric">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label400">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label">px</property>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -22009,6 +21886,9 @@ Concentric</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -22173,21 +22053,9 @@ Concentric</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox138">
+ <widget class="GtkVBox" id="vbox138_run_encoder">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <child>
- <widget class="GtkLabel" id="label394">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label">race encoder</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow9">
<property name="visible">True</property>
@@ -22196,7 +22064,7 @@ Concentric</property>
<property
name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
- <widget class="GtkViewport"
id="viewport_race_encoder_graph">
+ <widget class="GtkViewport"
id="viewport_run_encoder_graph">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
@@ -22205,7 +22073,7 @@ Concentric</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <widget class="GtkImage"
id="image_race_encoder_graph">
+ <widget class="GtkImage"
id="image_run_encoder_graph">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property
name="stock">gtk-missing-image</property>
@@ -22224,7 +22092,7 @@ Concentric</property>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -23969,18 +23837,6 @@ Concentric</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel"
id="label_video_encoder_tests_will_be_filmed">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Tests
will be filmed</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<widget class="GtkHBox"
id="hbox_video_encoder_capturing">
<property name="can_focus">False</property>
<property name="spacing">4</property>
@@ -24017,6 +23873,18 @@ Concentric</property>
</packing>
</child>
<child>
+ <widget class="GtkLabel"
id="label_video_encoder_tests_will_be_filmed">
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Tests
will be filmed</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkHBox"
id="hbox_video_encoder_no_capturing">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -30903,6 +30771,9 @@ then click this button.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index dfd14747..828465b8 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3211,7 +3211,6 @@ public partial class ChronoJumpWindow
vbox_force_capture_feedback.Visible = false;
button_force_sensor_adjust.Visible = false;
hbox_race_analyzer_device.Visible = false;
- vbox_run_encoder_width_height.Visible = false;
//on OSX R is not installed by default. Check if it's installed. Needed for encoder and force
sensor
if(
@@ -3423,7 +3422,6 @@ public partial class ChronoJumpWindow
hbox_contacts_sup_capture_analyze_two_buttons.Visible = true;
button_threshold.Visible = false;
hbox_race_analyzer_device.Visible = true;
- vbox_run_encoder_width_height.Visible = true;
//notebook_capture_analyze.GetNthPage(2).Hide(); //hide jumpsProfile on other tests
hbox_results_legend.Visible = false;
diff --git a/src/gui/runEncoder.cs b/src/gui/runEncoder.cs
index b919e9d6..a8cf8599 100644
--- a/src/gui/runEncoder.cs
+++ b/src/gui/runEncoder.cs
@@ -40,21 +40,17 @@ public partial class ChronoJumpWindow
[Widget] Gtk.ComboBox combo_run_encoder_exercise;
[Widget] Gtk.SpinButton race_analyzer_spinbutton_distance;
[Widget] Gtk.SpinButton race_analyzer_spinbutton_temperature;
- [Widget] Gtk.SpinButton race_analyzer_spinbutton_graph_width;
- [Widget] Gtk.SpinButton race_analyzer_spinbutton_graph_height;
[Widget] Gtk.TextView textview_race_analyzer_comment;
[Widget] Gtk.HBox hbox_race_analyzer_device;
- [Widget] Gtk.VBox vbox_run_encoder_width_height;
[Widget] Gtk.RadioButton race_analyzer_radio_device_manual;
[Widget] Gtk.RadioButton race_analyzer_radio_device_other; //resisted
- [Widget] Gtk.Image image_race_encoder_graph;
+ [Widget] Gtk.Image image_run_encoder_graph;
[Widget] Gtk.Button button_run_encoder_recalculate;
[Widget] Gtk.Button button_race_analyzer_save_comment;
+ [Widget] Gtk.Viewport viewport_run_encoder_graph;
int race_analyzer_distance;
int race_analyzer_temperature;
- int race_analyzer_graph_width;
- int race_analyzer_graph_height;
RunEncoder.Devices race_analyzer_device;
@@ -265,8 +261,6 @@ public partial class ChronoJumpWindow
{
race_analyzer_distance = Convert.ToInt32(race_analyzer_spinbutton_distance.Value);
race_analyzer_temperature = Convert.ToInt32(race_analyzer_spinbutton_temperature.Value);
- race_analyzer_graph_width = Convert.ToInt32(race_analyzer_spinbutton_graph_width.Value);
- race_analyzer_graph_height = Convert.ToInt32(race_analyzer_spinbutton_graph_height.Value);
if(race_analyzer_radio_device_manual.Active)
race_analyzer_device = RunEncoder.Devices.MANUAL;
@@ -785,6 +779,9 @@ public partial class ChronoJumpWindow
private void raceEncoderCaptureGraphDo()
{
+ int imageWidth = UtilGtk.WidgetWidth(viewport_run_encoder_graph);
+ int imageHeight = UtilGtk.WidgetHeight(viewport_run_encoder_graph);
+
//create graph
RunEncoderGraph reg = new RunEncoderGraph(
race_analyzer_distance,
@@ -793,7 +790,7 @@ public partial class ChronoJumpWindow
race_analyzer_temperature,
race_analyzer_device);
- reg.CallR(race_analyzer_graph_width, race_analyzer_graph_height);
+ reg.CallR(imageWidth, imageHeight);
DateTime runEncoderGraphStarted = DateTime.Now;
//TODO: check better if png is saved and have a cancel button
@@ -1040,9 +1037,9 @@ LogB.Information(" fc R ");
void runEncoderAnalyzeOpenImage()
{
string imagePath = UtilEncoder.GetSprintEncoderImage();
- image_race_encoder_graph = UtilGtk.OpenImageSafe(
+ image_run_encoder_graph = UtilGtk.OpenImageSafe(
imagePath,
- image_race_encoder_graph);
+ image_run_encoder_graph);
}
private void on_menuitem_race_encoder_open_folder_activate (object o, EventArgs args)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]