diff --git a/data/Application.css b/data/Application.css index 74f90a78..7e700375 100644 --- a/data/Application.css +++ b/data/Application.css @@ -14,6 +14,14 @@ border-width: 0; } +.green { + background-color: alpha(@LIME_300, 0.6); +} + +.blue { + background-color: alpha(@BLUEBERRY_300, 0.6); +} + /* .vertical-label, .vertical-label:hover, .vertical-label:selected, @@ -84,15 +92,15 @@ } .core_badge-mild-warning { - background-color: @BANANA_100; + background-color: alpha(@BANANA_100, 0.7); color: @BANANA_900; - border: 1px solid @BANANA_300; + border: 1px solid alpha(@BANANA_300, 0.7); } .core_badge-strong-warning { - background-color: @ORANGE_100; + background-color: alpha(@ORANGE_100, 0.7); color: @ORANGE_900; - border: 1px solid @ORANGE_300; + border: 1px solid alpha(@ORANGE_300, 0.7); } .core_badge-critical-warning { diff --git a/src/Views/SystemView/SystemNetworkView.vala b/src/Views/SystemView/SystemNetworkView.vala index fb8266d8..a6d0e8f5 100644 --- a/src/Views/SystemView/SystemNetworkView.vala +++ b/src/Views/SystemView/SystemNetworkView.vala @@ -16,14 +16,21 @@ public class Monitor.SystemNetworkView : Gtk.Grid { network = _network; network_name_label = new LabelH4 (_("Network")); + network_download_label = new LabelRoundy (_("DOWN")); network_download_label.val.set_width_chars (7); + network_download_label.set_color ("blue"); + network_upload_label = new LabelRoundy (_("UP")); network_upload_label.val.set_width_chars (7); + network_upload_label.set_color ("green"); network_chart = new Chart (2); network_chart.config.y_axis.fixed_max = null; + network_chart.set_serie_color(0, { 155/255.0, 219/255.0, 77/255.0, 1.0 }); + network_chart.set_serie_color(1, { 100/255.0, 186/255.0, 255/255.0, 1.0 }); + var labels_grid = new Gtk.Grid (); labels_grid.row_spacing = 6; labels_grid.column_spacing = 6; diff --git a/src/Views/SystemView/SystemStorageView.vala b/src/Views/SystemView/SystemStorageView.vala index 496a83cd..271b64bf 100644 --- a/src/Views/SystemView/SystemStorageView.vala +++ b/src/Views/SystemView/SystemStorageView.vala @@ -16,13 +16,19 @@ public class Monitor.SystemStorageView : Gtk.Grid { storage = _storage; storage_name_label = new LabelH4 (_("Storage")); + storage_write_label = new LabelRoundy (_("WRITE")); storage_write_label.val.set_width_chars (7); + storage_write_label.set_color ("blue"); + storage_read_label = new LabelRoundy (_("READ")); storage_read_label.val.set_width_chars (7); + storage_read_label.set_color ("green"); storage_chart = new Chart (2); storage_chart.config.y_axis.fixed_max = null; + storage_chart.set_serie_color(0, { 155/255.0, 219/255.0, 77/255.0, 1.0 }); + storage_chart.set_serie_color(1, { 100/255.0, 186/255.0, 255/255.0, 1.0 }); var labels_grid = new Gtk.Grid (); labels_grid.row_spacing = 6; diff --git a/src/Widgets/Chart/Chart.vala b/src/Widgets/Chart/Chart.vala index faa7246c..389c6f3e 100644 --- a/src/Widgets/Chart/Chart.vala +++ b/src/Widgets/Chart/Chart.vala @@ -42,6 +42,14 @@ public class Monitor.Chart : Gtk.Box { add (live_chart); } + public void set_serie_color(int serie_number, Gdk.RGBA color) { + try { + live_chart.series[serie_number].line.color = color; + } catch (LiveChart.ChartError e) { + error (e.message); + } + } + public void update (int serie_number, double value) { try { live_chart.series[serie_number].add (value); diff --git a/src/Widgets/Labels/LabelRoundy.vala b/src/Widgets/Labels/LabelRoundy.vala index 067a2aae..49af0598 100644 --- a/src/Widgets/Labels/LabelRoundy.vala +++ b/src/Widgets/Labels/LabelRoundy.vala @@ -13,6 +13,10 @@ public class Monitor.LabelRoundy : Gtk.Fixed { put (desc, 6, 0); } + public void set_color (string colorname) { + val.get_style_context ().add_class (colorname); + } + public void set_text (string text) { val.set_text (text); }