[chronojump] If device is not found, device button surround is colorized
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] If device is not found, device button surround is colorized
- Date: Thu, 15 Feb 2018 12:51:44 +0000 (UTC)
commit 2d78a81627e995160834ab020f80389231f936ce
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Feb 14 21:48:56 2018 +0100
If device is not found, device button surround is colorized
glade/app1.glade | 26 ++++++++++++++++++++++++++
src/gui/chronojump.cs | 3 +++
src/gui/chronojumpIcons.cs | 7 ++++++-
src/gui/encoder.cs | 5 ++++-
src/utilGtk.cs | 14 ++++++++++++++
5 files changed, 53 insertions(+), 2 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 0ca7110..524d0ce 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1589,6 +1589,9 @@
<placeholder/>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
<widget class="GtkLabel"
id="label_start_selector_jumps">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -5601,6 +5604,14 @@ EncoderInertialCapture</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
+ <widget class="GtkAlignment" id="alignment35">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">2</property>
+ <property name="bottom_padding">2</property>
+ <property name="left_padding">6</property>
+ <property name="right_padding">6</property>
+ <child>
<widget class="GtkButton"
id="button_activate_chronopics">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -5645,6 +5656,8 @@ EncoderInertialCapture</property>
</widget>
</child>
</widget>
+ </child>
+ </widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -17396,6 +17409,14 @@ Concentric</property>
</packing>
</child>
<child>
+ <widget class="GtkAlignment" id="alignment34">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">2</property>
+ <property name="bottom_padding">2</property>
+ <property name="left_padding">6</property>
+ <property name="right_padding">6</property>
+ <child>
<widget class="GtkButton"
id="button_activate_chronopics_encoder">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -17438,6 +17459,8 @@ Concentric</property>
</widget>
</child>
</widget>
+ </child>
+ </widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -22937,6 +22960,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 f824bd6..3215e20 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -270,6 +270,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Box vbox_execute_test;
[Widget] Gtk.Button button_execute_test;
[Widget] Gtk.Viewport viewport_chronopics;
+ [Widget] Gtk.Viewport viewport_chronopic_encoder;
//[Widget] Gtk.Label label_chronopic_encoder;
//[Widget] Gtk.Image image_chronopic_encoder_no;
//[Widget] Gtk.Image image_chronopic_encoder_yes;
@@ -3860,10 +3861,12 @@ public partial class ChronoJumpWindow
//simulated tests are only allowed on SIMULATED session
if(currentSession.Name != Constants.SessionSimulatedName) {
new DialogMessage(Constants.MessageTypes.WARNING,
Constants.SimulatedTestsNotAllowed);
+ UtilGtk.DeviceColors(viewport_chronopics, false);
return;
}
on_button_execute_test_accepted();
}
+ UtilGtk.DeviceColors(viewport_chronopics, true);
}
void on_button_execute_test_accepted ()
diff --git a/src/gui/chronojumpIcons.cs b/src/gui/chronojumpIcons.cs
index 098d1ab..4e81bd9 100644
--- a/src/gui/chronojumpIcons.cs
+++ b/src/gui/chronojumpIcons.cs
@@ -454,7 +454,12 @@ public partial class ChronoJumpWindow
image_reaction_times_zoom.Pixbuf = pixbuf;
image_pulses_zoom.Pixbuf = pixbuf;
image_multi_chronopic_zoom.Pixbuf = pixbuf;
-
+
+
+ //white background in chronopic viewports
+ UtilGtk.DeviceColors(viewport_chronopics, true);
+ UtilGtk.DeviceColors(viewport_chronopic_encoder, true);
+
//encoder
UtilGtk.ColorsRadio(viewport_chronopics, radiobutton_encoder_analyze_powerbars);
UtilGtk.ColorsRadio(viewport_chronopics, radiobutton_encoder_analyze_cross);
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index e4e0caf..ef690d5 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -681,14 +681,17 @@ public partial class ChronoJumpWindow
int numEncoders = chronopicRegister.NumConnectedOfType(ChronopicRegisterPort.Types.ENCODER);
LogB.Information("numEncoders: " + numEncoders);
if(numEncoders == 0) {
- new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Encoder is not
connected"));
+ new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Device is not
connected"));
+ UtilGtk.DeviceColors(viewport_chronopic_encoder, false);
return false;
}
if(numEncoders > 1) {
new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("More than 1
encoders are connected"));
+ UtilGtk.DeviceColors(viewport_chronopic_encoder, false);
return false;
}
+ UtilGtk.DeviceColors(viewport_chronopic_encoder, true);
return true;
}
diff --git a/src/utilGtk.cs b/src/utilGtk.cs
index c91aab3..96a1c83 100644
--- a/src/utilGtk.cs
+++ b/src/utilGtk.cs
@@ -513,6 +513,20 @@ public class UtilGtk
private static Gdk.Color chronopicViewportDefaultBg;
private static Gdk.Color chronopicLabelsDefaultFg;
+ public static void DeviceColors(Gtk.Viewport v, bool connected)
+ {
+ if(! v.Style.Background(StateType.Normal).Equal(v.Style.Background(StateType.Selected)))
+ chronopicViewportDefaultBg = v.Style.Background(StateType.Normal);
+
+ if(connected) {
+ //v.ModifyBg(StateType.Normal, chronopicViewportDefaultBg);
+ v.ModifyBg(StateType.Normal, WHITE);
+ } else {
+ //v.ModifyBg(StateType.Normal, BLUE);
+ v.ModifyBg(StateType.Normal, v.Style.Background(StateType.Selected));
+ }
+ }
+
public static void ChronopicColors(Gtk.Viewport v, Gtk.Label l1, Gtk.Label l2, bool connected) {
//if(! v.Style.Background(StateType.Normal).Equal(BLUE))
if(! v.Style.Background(StateType.Normal).Equal(v.Style.Background(StateType.Selected)))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]