[chronojump] encoder rest time (persons at top) is yellow is background is dark
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] encoder rest time (persons at top) is yellow is background is dark
- Date: Mon, 6 Apr 2020 12:00:30 +0000 (UTC)
commit f2e3aa72d008876736057ceaeb8a9c8664778ba8
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Apr 6 13:59:52 2020 +0200
encoder rest time (persons at top) is yellow is background is dark
glade/app1.glade | 27 ++++++++++++++++++++++-----
src/gui/app1/chronojump.cs | 9 +++++++++
src/gui/app1/icons.cs | 6 ++++--
src/gui/restTime.cs | 6 +++++-
src/utilGtk.cs | 4 ++--
5 files changed, 42 insertions(+), 10 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index ac9bf370..595e5cc2 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -25774,15 +25774,32 @@ Concentric</property>
</packing>
</child>
<child>
- <placeholder/>
- </child>
- <child>
- <widget class="GtkImage"
id="image_encoder_rest_time">
+ <widget class="GtkHBox"
id="hbox_encoder_rest_time">
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkImage"
id="image_encoder_rest_time_dark_blue">
+ <property name="can_focus">False</property>
+ <property
name="stock">gtk-missing-image</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkImage"
id="image_encoder_rest_time_clear_yellow">
<property name="can_focus">False</property>
<property
name="stock">gtk-missing-image</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 55eebce8..70db6e8a 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -753,6 +753,15 @@ public partial class ChronoJumpWindow
}
UtilGtk.ContrastLabelsNotebook (viewport_hpaned_contacts_main, app1s_notebook);
+
+ if(UtilGtk.ColorIsDark(viewport_hpaned_contacts_main.Style.Background(StateType.Normal)))
+ {
+ image_encoder_rest_time_dark_blue.Visible = false;
+ image_encoder_rest_time_clear_yellow.Visible = true;
+ } else {
+ image_encoder_rest_time_dark_blue.Visible = true;
+ image_encoder_rest_time_clear_yellow.Visible = false;
+ }
}
private void testNewStuff()
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index 24fdffd8..a7da4599 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -164,7 +164,6 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Image image_encoder_analyze_image_compujump_send_email_image;
[Widget] Gtk.Image image_encoder_analyze_image_compujump_send_email_send;
[Widget] Gtk.Image image_encoder_analyze_check;
- [Widget] Gtk.Image image_encoder_rest_time;
//force sensor
[Widget] Gtk.Image image_selector_start_force_sensor;
@@ -478,7 +477,10 @@ public partial class ChronoJumpWindow
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_rest.png");
image_rest.Pixbuf = pixbuf;
image_encoder_rhythm_rest.Pixbuf = pixbuf;
- image_encoder_rest_time.Pixbuf = pixbuf;
+ image_encoder_rest_time_dark_blue.Pixbuf = pixbuf;
+
+ pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_rest_yellow.png");
+ image_encoder_rest_time_clear_yellow.Pixbuf = pixbuf;
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "folder_check.png");
image_all_persons_events.Pixbuf = pixbuf;
diff --git a/src/gui/restTime.cs b/src/gui/restTime.cs
index 2b1421fe..f287fdf8 100644
--- a/src/gui/restTime.cs
+++ b/src/gui/restTime.cs
@@ -29,6 +29,10 @@ using System.Collections.Generic; //List
public partial class ChronoJumpWindow
{
+ [Widget] Gtk.HBox hbox_encoder_rest_time;
+ [Widget] Gtk.Image image_encoder_rest_time_dark_blue;
+ [Widget] Gtk.Image image_encoder_rest_time_clear_yellow;
+
[Widget] Gtk.Label label_contacts_rest_time_1_name;
[Widget] Gtk.Label label_contacts_rest_time_2_name;
[Widget] Gtk.Label label_contacts_rest_time_3_name;
@@ -124,7 +128,7 @@ public partial class ChronoJumpWindow
{
labels_rest_time_encoder_clean();
List<LastTestTime> listLastMin = restTime.LastMinList();
- image_encoder_rest_time.Visible = (listLastMin.Count > 0);
+ hbox_encoder_rest_time.Visible = (listLastMin.Count > 0);
int count = 0;
foreach(LastTestTime ltt in listLastMin)
{
diff --git a/src/utilGtk.cs b/src/utilGtk.cs
index 845513de..ef5b0603 100644
--- a/src/utilGtk.cs
+++ b/src/utilGtk.cs
@@ -624,7 +624,7 @@ public class UtilGtk
foreach(Gtk.Widget w in container.Children)
{
if(w.GetType() == typeof(Gtk.Label))
- LabelDoContrastColor (v, (Gtk.Label) w);
+ labelDoContrastColor (v, (Gtk.Label) w);
else if(w.GetType() == typeof(Gtk.Alignment))
{
@@ -649,7 +649,7 @@ public class UtilGtk
);
}
- public static void LabelDoContrastColor (Gtk.Viewport v, Gtk.Label l)
+ private static void labelDoContrastColor (Gtk.Viewport v, Gtk.Label l)
{
if(ColorIsDark(v.Style.Background(StateType.Normal)))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]