[gnome-usage] Open curly braces at the end of the row



commit 6f002c692204bd081e17ceedcf4c143317e111ad
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon Nov 22 11:31:25 2021 +0100

    Open curly braces at the end of the row
    
    Rather than opening them in a dedicated new row. This makes the coding
    style more consistent.

 src/animated-scrolled-window.vala  | 24 ++++++------------
 src/app-item.vala                  |  9 +++----
 src/application.vala               | 40 +++++++++---------------------
 src/color-rectangle.vala           | 21 ++++++----------
 src/cpu-graph.vala                 | 24 ++++++------------
 src/cpu-monitor.vala               | 24 ++++++------------
 src/cpu-sub-view.vala              | 12 +++------
 src/gnome-usage.vala               |  3 +--
 src/graph-box.vala                 |  3 +--
 src/graph-stack-switcher.vala      | 30 ++++++++--------------
 src/graph-stacked-renderer.vala    |  9 +++----
 src/graph-switcher-button.vala     | 18 +++++---------
 src/memory-graph.vala              | 15 ++++-------
 src/memory-monitor.vala            | 24 ++++++------------
 src/memory-speedometer.vala        |  6 ++---
 src/memory-sub-view.vala           | 12 +++------
 src/monitor.vala                   |  3 +--
 src/no-results-found-view.vala     |  3 +--
 src/performance-view.vala          | 15 ++++-------
 src/pie-chart.vala                 | 24 ++++++------------
 src/process-list-box.vala          | 15 ++++-------
 src/process-row.vala               | 39 ++++++++++-------------------
 src/process.vala                   | 21 ++++++----------
 src/quit-process-dialog.vala       | 15 ++++-------
 src/settings.vala                  |  9 +++----
 src/speedometer.vala               | 21 ++++++----------
 src/storage/storage-actionbar.vala |  6 ++---
 src/storage/storage-graph.vala     | 27 +++++++-------------
 src/swap-speedometer.vala          |  6 ++---
 src/system-monitor.vala            | 33 ++++++++----------------
 src/utils.vala                     | 33 ++++++++----------------
 src/view.vala                      |  9 +++----
 src/window.vala                    | 51 +++++++++++++-------------------------
 vapi/libgtop-2.0.vapi              |  6 ++---
 34 files changed, 202 insertions(+), 408 deletions(-)
---
diff --git a/src/animated-scrolled-window.vala b/src/animated-scrolled-window.vala
index fd7879b..5660cf9 100644
--- a/src/animated-scrolled-window.vala
+++ b/src/animated-scrolled-window.vala
@@ -1,9 +1,7 @@
 using Gtk;
 
-namespace Usage
-{
-    public class AnimatedScrolledWindow : Gtk.ScrolledWindow
-    {
+namespace Usage {
+    public class AnimatedScrolledWindow : Gtk.ScrolledWindow {
         public signal void scroll_changed(double y);
         private const uint DURATION = 400;
 
@@ -13,8 +11,7 @@ namespace Usage
             });
         }
 
-        public void animated_scroll_vertically(int y)
-        {
+        public void animated_scroll_vertically(int y) {
             var clock = get_frame_clock();
             int64 start_time = clock.get_frame_time();
             int64 end_time = start_time + 1000 * DURATION;
@@ -25,8 +22,7 @@ namespace Usage
             tick_id = clock.update.connect(() => {
                 int64 now = clock.get_frame_time();
 
-                if (!animate_step (now, start_time, end_time, source, target))
-                {
+                if (!animate_step (now, start_time, end_time, source, target)) {
                     clock.disconnect(tick_id);
                     tick_id = 0;
                     clock.end_updating();
@@ -35,24 +31,20 @@ namespace Usage
             clock.begin_updating();
         }
 
-        private bool animate_step (int64 now, int64 start_time, int64 end_time, double source, double target)
-        {
-            if (now < end_time)
-            {
+        private bool animate_step (int64 now, int64 start_time, int64 end_time, double source, double 
target) {
+            if (now < end_time) {
                 double t = (now - start_time) / (double) (end_time - start_time);
                 t = ease_out_cubic (t);
                 vadjustment.set_value(source + t * (target - source));
                 return true;
             }
-            else
-            {
+            else {
                 vadjustment.set_value(target);
                 return false;
             }
         }
 
-        private double ease_out_cubic (double t)
-        {
+        private double ease_out_cubic (double t) {
             double p = t - 1;
             return p * p * p + 1;
         }
diff --git a/src/app-item.vala b/src/app-item.vala
index 09be64e..6753c29 100644
--- a/src/app-item.vala
+++ b/src/app-item.vala
@@ -1,7 +1,5 @@
-namespace Usage
-{
-    public class AppItem : Object
-    {
+namespace Usage {
+    public class AppItem : Object {
         public HashTable<Pid?, Process>? processes { get; set; }
         public string display_name { get; private set; }
         public string representative_cmdline { get; private set; }
@@ -164,8 +162,7 @@ namespace Usage
             return processes.contains(pid);
         }
 
-        public Icon get_icon()
-        {
+        public Icon get_icon() {
             var app_icon = (app_info == null) ? null : app_info.get_icon();
 
             if (app_info == null || app_icon == null)
diff --git a/src/application.vala b/src/application.vala
index a017787..81c7ed6 100644
--- a/src/application.vala
+++ b/src/application.vala
@@ -20,32 +20,22 @@
 
 using Gtk;
 
-namespace Usage
-{
-    public class Application : Gtk.Application
-    {
+namespace Usage {
+    public class Application : Gtk.Application {
         private Window window;
 
-        private const GLib.ActionEntry app_entries[] =
-        {
-          { "about", on_about },
-          { "search", on_search },
-          { "quit", on_quit },
-          { "filter-processes", on_activate_radio, "s", "'group-system'", change_filter_processes_state }
+        private const GLib.ActionEntry app_entries[] = { { "about", on_about }, { "search", on_search }, { 
"quit", on_quit }, { "filter-processes", on_activate_radio, "s", "'group-system'", 
change_filter_processes_state }
         };
 
-        public Application ()
-        {
+        public Application () {
             application_id = Config.APPLICATION_ID;
         }
 
-        public Window? get_window()
-        {
+        public Window? get_window() {
             return window;
         }
 
-        public override void activate()
-        {
+        public override void activate() {
             if (window != null)
                 return;
 
@@ -56,8 +46,7 @@ namespace Usage
             window.show();
         }
 
-        protected override void startup()
-        {
+        protected override void startup() {
             base.startup();
 
             Hdy.init();
@@ -69,8 +58,7 @@ namespace Usage
             icon_theme.add_resource_path ("/org/gnome/Usage/icons/hicolor");
         }
 
-        private void on_about(GLib.SimpleAction action, GLib.Variant? parameter)
-        {
+        private void on_about(GLib.SimpleAction action, GLib.Variant? parameter) {
             string[] authors = {
                 "Petr Štětka <pstetka redhat com>"
             };
@@ -93,23 +81,19 @@ namespace Usage
                 license_type: License.GPL_3_0);
         }
 
-        private void on_quit(GLib.SimpleAction action, GLib.Variant? parameter)
-        {
+        private void on_quit(GLib.SimpleAction action, GLib.Variant? parameter) {
             window.destroy();
         }
 
-        private void on_search(GLib.SimpleAction action, GLib.Variant? parameter)
-        {
+        private void on_search(GLib.SimpleAction action, GLib.Variant? parameter) {
             window.action_on_search();
         }
 
-        private void on_activate_radio (GLib.SimpleAction action, GLib.Variant? state)
-        {
+        private void on_activate_radio (GLib.SimpleAction action, GLib.Variant? state) {
             action.change_state(state);
         }
 
-        private void change_filter_processes_state(GLib.SimpleAction action, GLib.Variant? state)
-        {
+        private void change_filter_processes_state(GLib.SimpleAction action, GLib.Variant? state) {
             action.set_state(state);
             SystemMonitor.get_default().group_system_apps = state.get_string() == "group-system" ? true : 
false;
         }
diff --git a/src/color-rectangle.vala b/src/color-rectangle.vala
index f1812cc..1252b6b 100644
--- a/src/color-rectangle.vala
+++ b/src/color-rectangle.vala
@@ -22,22 +22,18 @@ using Gtk;
 
 namespace Usage {
 
-    public class ColorRectangle : Gtk.DrawingArea
-    {
+    public class ColorRectangle : Gtk.DrawingArea {
         public Gdk.RGBA color { get; set; }
 
-        class construct
-        {
+        class construct {
             set_css_name("ColorRectangle");
         }
 
-        construct
-        {
+        construct {
             this.height_request = 17;
             this.width_request = 17;
             this.valign = Gtk.Align.CENTER;
-            this.draw.connect ((context) =>
-            {
+            this.draw.connect ((context) => {
                 int height = this.get_allocated_height ();
                 int width = this.get_allocated_width ();
 
@@ -59,19 +55,16 @@ namespace Usage {
             });
         }
 
-        public ColorRectangle.new_from_rgba(Gdk.RGBA color)
-        {
+        public ColorRectangle.new_from_rgba(Gdk.RGBA color) {
             this.color = color;
             queue_draw_area(0, 0, this.get_allocated_width(), this.get_allocated_height());
         }
 
-        public ColorRectangle.new_from_css(string css_class)
-        {
+        public ColorRectangle.new_from_css(string css_class) {
             set_color_from_css(css_class);
         }
 
-        public void set_color_from_css(string css_class)
-        {
+        public void set_color_from_css(string css_class) {
             get_style_context().add_class(css_class);
             color = get_style_context().get_color(get_style_context().get_state());
             queue_draw_area(0, 0, this.get_allocated_width(), this.get_allocated_height());
diff --git a/src/cpu-graph.vala b/src/cpu-graph.vala
index 4e51ebc..1718230 100644
--- a/src/cpu-graph.vala
+++ b/src/cpu-graph.vala
@@ -20,13 +20,11 @@
 
 using Dazzle;
 
-namespace Usage
-{
+namespace Usage {
     /**
      *  Graph showing most used core
     **/
-    public class CpuGraphMostUsedCore : GraphView
-    {
+    public class CpuGraphMostUsedCore : GraphView {
         private static CpuGraphModelMostUsedCore graph_model;
         private GraphStackedRenderer renderer;
         private Gdk.RGBA line_color_max;
@@ -34,13 +32,11 @@ namespace Usage
         private Gdk.RGBA color_max;
         private Gdk.RGBA color_normal;
 
-        class construct
-        {
+        class construct {
             set_css_name("rg-graph");
         }
 
-        public CpuGraphMostUsedCore ()
-        {
+        public CpuGraphMostUsedCore () {
             get_style_context().add_class("line_max");
             line_color_max = get_style_context().get_color(get_style_context().get_state());
             get_style_context().remove_class("line_max");
@@ -80,20 +76,17 @@ namespace Usage
     /**
      *  Graph showing all processor cores.
     **/
-    public class CpuGraph : GraphView
-    {
+    public class CpuGraph : GraphView {
         private static CpuGraphModel graph_model;
         private GraphLineRenderer[] renderers;
         private Gdk.RGBA line_color_max;
         private Gdk.RGBA line_color_normal;
 
-        class construct
-        {
+        class construct {
             set_css_name("rg-graph");
         }
 
-        public CpuGraph()
-        {
+        public CpuGraph() {
             get_style_context().add_class("line_max");
             line_color_max = get_style_context().get_color(get_style_context().get_state());
             get_style_context().remove_class("line_max");
@@ -108,8 +101,7 @@ namespace Usage
             set_model(graph_model);
 
             renderers = new GraphLineRenderer[get_num_processors()];
-            for(int i = 0; i < get_num_processors(); i++)
-            {
+            for(int i = 0; i < get_num_processors(); i++) {
                 renderers[i] = new GraphLineRenderer();
                 renderers[i].column = i;
                 renderers[i].stroke_color_rgba = line_color_normal;
diff --git a/src/cpu-monitor.vala b/src/cpu-monitor.vala
index ec3fdcf..7cfa0b8 100644
--- a/src/cpu-monitor.vala
+++ b/src/cpu-monitor.vala
@@ -18,10 +18,8 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public class CpuMonitor : Monitor
-    {
+namespace Usage {
+    public class CpuMonitor : Monitor {
         private double cpu_load;
         private double[] x_cpu_load;
         private uint64 cpu_last_used = 0;
@@ -30,15 +28,13 @@ namespace Usage
         private uint64[] x_cpu_last_used;
         private uint64[] x_cpu_last_total;
 
-        public CpuMonitor()
-        {
+        public CpuMonitor() {
             x_cpu_load = new double[get_num_processors()];
             x_cpu_last_used = new uint64[get_num_processors()];
             x_cpu_last_total = new uint64[get_num_processors()];
         }
 
-        public void update()
-        {
+        public void update() {
             GTop.Cpu cpu_data;
             GTop.get_cpu (out cpu_data);
             var used = cpu_data.user + cpu_data.nice + cpu_data.sys;
@@ -46,8 +42,7 @@ namespace Usage
             cpu_last_total_step = cpu_data.total - cpu_last_total;
 
             var x_cpu_used = new uint64[get_num_processors()];
-            for (int i = 0; i < x_cpu_load.length; i++)
-            {
+            for (int i = 0; i < x_cpu_load.length; i++) {
                 x_cpu_used[i] = cpu_data.xcpu_user[i] + cpu_data.xcpu_nice[i] + cpu_data.xcpu_sys[i];
                 x_cpu_load[i] = (((double) (x_cpu_used[i] - x_cpu_last_used[i])) / (cpu_data.xcpu_total[i] - 
x_cpu_last_total[i])) * 100;
             }
@@ -58,18 +53,15 @@ namespace Usage
             x_cpu_last_total = cpu_data.xcpu_total;
         }
 
-        public double get_cpu_load()
-        {
+        public double get_cpu_load() {
             return cpu_load;
         }
 
-        public double[] get_x_cpu_load()
-        {
+        public double[] get_x_cpu_load() {
             return x_cpu_load;
         }
 
-        public void update_process(ref Process process)
-        {
+        public void update_process(ref Process process) {
             GTop.ProcTime proc_time;
             GTop.ProcState proc_state;
 
diff --git a/src/cpu-sub-view.vala b/src/cpu-sub-view.vala
index 9e1fbcc..a7bcce1 100644
--- a/src/cpu-sub-view.vala
+++ b/src/cpu-sub-view.vala
@@ -18,15 +18,12 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public class ProcessorSubView : View, SubView
-    {
+namespace Usage {
+    public class ProcessorSubView : View, SubView {
         private ProcessListBox process_list_box;
         private NoResultsFoundView no_process_view;
 
-        public ProcessorSubView()
-        {
+        public ProcessorSubView() {
             name = "PROCESSOR";
 
             var label = new Gtk.Label("<span font_desc=\"14.0\">" + _("Processor") + "</span>");
@@ -79,8 +76,7 @@ namespace Usage
             this.no_process_view.hide();
         }
 
-        public void search_in_processes(string text)
-        {
+        public void search_in_processes(string text) {
             process_list_box.search_text = text;
         }
     }
diff --git a/src/gnome-usage.vala b/src/gnome-usage.vala
index b5b61fc..167ffa1 100644
--- a/src/gnome-usage.vala
+++ b/src/gnome-usage.vala
@@ -18,8 +18,7 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-public static int main (string[] args)
-{
+public static int main (string[] args) {
     Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.GNOMELOCALEDIR);
     Intl.setlocale(LocaleCategory.ALL, "");
     Intl.textdomain(Config.GETTEXT_PACKAGE);
diff --git a/src/graph-box.vala b/src/graph-box.vala
index ab0e35f..78fe4a6 100644
--- a/src/graph-box.vala
+++ b/src/graph-box.vala
@@ -24,8 +24,7 @@ namespace Usage {
 
     public class GraphBox : Gtk.Box {
 
-        class construct
-        {
+        class construct {
             set_css_name("graph-box");
         }
 
diff --git a/src/graph-stack-switcher.vala b/src/graph-stack-switcher.vala
index d0ced06..0c28e70 100644
--- a/src/graph-stack-switcher.vala
+++ b/src/graph-stack-switcher.vala
@@ -18,22 +18,18 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public class GraphStackSwitcher : Gtk.Box
-    {
+namespace Usage {
+    public class GraphStackSwitcher : Gtk.Box {
         View[] sub_views;
         AnimatedScrolledWindow scrolled_window;
 
         GraphSwitcherButton[] buttons;
 
-        class construct
-        {
+        class construct {
             set_css_name("graph-stack-switcher");
         }
 
-        public GraphStackSwitcher(AnimatedScrolledWindow scrolled_window, View[] sub_views)
-        {
+        public GraphStackSwitcher(AnimatedScrolledWindow scrolled_window, View[] sub_views) {
             Object(orientation: Gtk.Orientation.VERTICAL, spacing: 0);
 
             this.sub_views = sub_views;
@@ -46,8 +42,7 @@ namespace Usage
                 new GraphSwitcherButton.memory(_("Memory"))
             };
 
-            foreach(GraphSwitcherButton button in buttons)
-            {
+            foreach(GraphSwitcherButton button in buttons) {
                 this.pack_start(button, false, true, 0);
 
                 button.button_release_event.connect(() => {
@@ -59,10 +54,8 @@ namespace Usage
             }
         }
 
-        private int get_button_number(Gtk.Button button)
-        {
-            for(int i = 0; i < buttons.length; i++)
-            {
+        private int get_button_number(Gtk.Button button) {
+            for(int i = 0; i < buttons.length; i++) {
                 if(buttons[i] == button)
                     return i;
             }
@@ -70,21 +63,18 @@ namespace Usage
             return 0;
         }
 
-        private void scroll_to_view(int button_number)
-        {
+        private void scroll_to_view(int button_number) {
             Gtk.Allocation alloc;
 
             this.sub_views[button_number].get_allocation(out alloc);
             scrolled_window.animated_scroll_vertically(alloc.y);
         }
 
-        private void on_scroll_changed(double y)
-        {
+        private void on_scroll_changed(double y) {
             Gtk.Allocation alloc;
 
             var button_number = 0;
-            for(int i = 1; i < buttons.length; i++)
-            {
+            for(int i = 1; i < buttons.length; i++) {
                 this.sub_views[i].get_allocation(out alloc);
                 if(y < alloc.y)
                     break;
diff --git a/src/graph-stacked-renderer.vala b/src/graph-stacked-renderer.vala
index 48915e7..f7befe5 100644
--- a/src/graph-stacked-renderer.vala
+++ b/src/graph-stacked-renderer.vala
@@ -41,8 +41,7 @@ namespace Usage {
 
                 cr.move_to (last_x, area.height);
 
-                while (GraphModel.iter_next (ref iter))
-                {
+                while (GraphModel.iter_next (ref iter)) {
                     double x = calc_x (iter, x_begin, x_end, area.width);
                     double y = calc_y (iter, y_begin, y_end, area.height, column);
 
@@ -67,8 +66,7 @@ namespace Usage {
 
                 cr.move_to (last_x, last_y);
 
-                while (GraphModel.iter_next (ref iter))
-                {
+                while (GraphModel.iter_next (ref iter)) {
                     double x = calc_x (iter, x_begin, x_end, area.width);
                     double y = calc_y (iter, y_begin, y_end, area.height, column);
 
@@ -94,8 +92,7 @@ namespace Usage {
             double y;
 
             var val = GraphModel.iter_get_value(iter, column);
-            switch (val.type())
-            {
+            switch (val.type()) {
                 case Type.DOUBLE:
                     y = val.get_double();
                     break;
diff --git a/src/graph-switcher-button.vala b/src/graph-switcher-button.vala
index f0863c4..5669f27 100644
--- a/src/graph-switcher-button.vala
+++ b/src/graph-switcher-button.vala
@@ -18,26 +18,21 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public class GraphSwitcherButton : Gtk.RadioButton
-    {
+namespace Usage {
+    public class GraphSwitcherButton : Gtk.RadioButton {
         private static Gtk.RadioButton? _group = null;
 
-        public GraphSwitcherButton.processor(string label)
-        {
+        public GraphSwitcherButton.processor(string label) {
             var processor_graph = new CpuGraphMostUsedCore();
             child = createContent(processor_graph, label);
         }
 
-        public GraphSwitcherButton.memory(string label)
-        {
+        public GraphSwitcherButton.memory(string label) {
             var memory_graph = new MemoryGraph();
             child = createContent(memory_graph, label);
         }
 
-        private Gtk.Box createContent(Dazzle.GraphView graph, string label_text)
-        {
+        private Gtk.Box createContent(Dazzle.GraphView graph, string label_text) {
             graph.height_request = 80;
             graph.hexpand = true;
             var graph_box = new GraphBox(graph);
@@ -56,8 +51,7 @@ namespace Usage
             return box;
         }
 
-        construct
-        {
+        construct {
             if(_group == null)
                 _group = this;
             else
diff --git a/src/memory-graph.vala b/src/memory-graph.vala
index b4f88f9..7f43a33 100644
--- a/src/memory-graph.vala
+++ b/src/memory-graph.vala
@@ -20,23 +20,19 @@
 
 using Dazzle;
 
-namespace Usage
-{
-    public class MemoryGraph : GraphView
-    {
+namespace Usage {
+    public class MemoryGraph : GraphView {
         private static MemoryGraphModel graph_model;
         private Gdk.RGBA line_color_max;
         private Gdk.RGBA line_color_normal;
         private Gdk.RGBA color_max;
         private Gdk.RGBA color_normal;
 
-        class construct
-        {
+        class construct {
             set_css_name("rg-graph");
         }
 
-        public MemoryGraph ()
-        {
+        public MemoryGraph () {
             get_style_context().add_class("line_max");
             line_color_max = get_style_context().get_color(get_style_context().get_state());
             get_style_context().remove_class("line_max");
@@ -50,8 +46,7 @@ namespace Usage
             color_normal = get_style_context().get_color(get_style_context().get_state());
             get_style_context().remove_class("stacked");
 
-            if(graph_model == null)
-            {
+            if(graph_model == null) {
                 graph_model = new MemoryGraphModel();
                 set_model(graph_model);
             }
diff --git a/src/memory-monitor.vala b/src/memory-monitor.vala
index 204e776..c906d84 100644
--- a/src/memory-monitor.vala
+++ b/src/memory-monitor.vala
@@ -18,17 +18,14 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public class MemoryMonitor : Monitor
-    {
+namespace Usage {
+    public class MemoryMonitor : Monitor {
         private uint64 ram_usage;
         private uint64 ram_total;
         private uint64 swap_usage;
         private uint64 swap_total;
 
-        public void update()
-        {
+        public void update() {
             /* Memory */
             GTop.Mem mem;
             GTop.get_mem (out mem);
@@ -42,25 +39,20 @@ namespace Usage
             swap_total = swap.total;
         }
 
-        public uint64 get_ram_usage()
-        {
+        public uint64 get_ram_usage() {
             return ram_usage;
         }
-        public uint64 get_swap_usage()
-        {
+        public uint64 get_swap_usage() {
             return swap_usage;
         }
-        public uint64 get_ram_total()
-        {
+        public uint64 get_ram_total() {
             return ram_total;
         }
-        public uint64 get_swap_total()
-        {
+        public uint64 get_swap_total() {
             return swap_total;
         }
 
-        public void update_process(ref Process process)
-        {
+        public void update_process(ref Process process) {
             GTop.Mem mem;
             GTop.ProcMem proc_mem;
 
diff --git a/src/memory-speedometer.vala b/src/memory-speedometer.vala
index 65a6ab6..1d841ad 100644
--- a/src/memory-speedometer.vala
+++ b/src/memory-speedometer.vala
@@ -20,11 +20,9 @@
 
 using Gtk;
 
-namespace Usage
-{
+namespace Usage {
     [GtkTemplate (ui = "/org/gnome/Usage/ui/memory-speedometer.ui")]
-    public class MemorySpeedometer : Gtk.Bin
-    {
+    public class MemorySpeedometer : Gtk.Bin {
         [GtkChild]
         private unowned Usage.Speedometer speedometer;
 
diff --git a/src/memory-sub-view.vala b/src/memory-sub-view.vala
index 3a1e07b..6b18fc6 100644
--- a/src/memory-sub-view.vala
+++ b/src/memory-sub-view.vala
@@ -18,15 +18,12 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public class MemorySubView : View, SubView
-    {
+namespace Usage {
+    public class MemorySubView : View, SubView {
         private ProcessListBox process_list_box;
         private NoResultsFoundView no_process_view;
 
-        public MemorySubView()
-        {
+        public MemorySubView() {
             name = "MEMORY";
 
             var label = new Gtk.Label("<span font_desc=\"14.0\">" + _("Memory") + "</span>");
@@ -81,8 +78,7 @@ namespace Usage
             this.no_process_view.hide();
         }
 
-        public void search_in_processes(string text)
-        {
+        public void search_in_processes(string text) {
             process_list_box.search_text = text;
         }
     }
diff --git a/src/monitor.vala b/src/monitor.vala
index 2cdf32d..afb21cb 100644
--- a/src/monitor.vala
+++ b/src/monitor.vala
@@ -18,8 +18,7 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-public interface Monitor
-{
+public interface Monitor {
     public abstract void update ();
     public abstract void update_process (ref Usage.Process process);
 }
diff --git a/src/no-results-found-view.vala b/src/no-results-found-view.vala
index f40ce51..b50c43f 100644
--- a/src/no-results-found-view.vala
+++ b/src/no-results-found-view.vala
@@ -16,8 +16,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-namespace Usage
-{
+namespace Usage {
     [GtkTemplate (ui = "/org/gnome/Usage/ui/no-results-found-view.ui")]
     public class NoResultsFoundView : View { }
 }
diff --git a/src/performance-view.vala b/src/performance-view.vala
index 3b476da..0302724 100644
--- a/src/performance-view.vala
+++ b/src/performance-view.vala
@@ -20,11 +20,9 @@
 
 using Gtk;
 
-namespace Usage
-{
+namespace Usage {
     [GtkTemplate (ui = "/org/gnome/Usage/ui/performance-view.ui")]
-    public class PerformanceView : View
-    {
+    public class PerformanceView : View {
         [GtkChild]
         private unowned Gtk.Box switcher_box;
 
@@ -42,14 +40,12 @@ namespace Usage
 
         View[] sub_views;
 
-        public PerformanceView ()
-        {
+        public PerformanceView () {
             name = "PERFORMANCE";
             title = _("Performance");
             icon_name = "speedometer-symbolic";
 
-            sub_views = new View[]
-            {
+            sub_views = new View[] {
                 new ProcessorSubView(),
                 new MemorySubView()
             };
@@ -69,8 +65,7 @@ namespace Usage
                 ((SubView) sub_view).search_in_processes(search_entry.get_text());
         }
 
-        public void set_search_mode(bool enable)
-        {
+        public void set_search_mode(bool enable) {
             search_bar.set_search_mode(enable);
         }
     }
diff --git a/src/pie-chart.vala b/src/pie-chart.vala
index d2a6500..e65d95c 100644
--- a/src/pie-chart.vala
+++ b/src/pie-chart.vala
@@ -22,25 +22,21 @@ using Gtk;
 
 namespace Usage {
 
-    public class PieChart : Gtk.DrawingArea
-    {
+    public class PieChart : Gtk.DrawingArea {
         int used_percentages = 0;
         int other_percentages = 0;
         Gdk.RGBA used_color;
         Gdk.RGBA others_color;
         Gdk.RGBA available;
 
-        class construct
-        {
+        class construct {
             set_css_name("PieChart");
         }
 
-        public PieChart()
-        {
+        public PieChart() {
             set_styles();
 
-            this.draw.connect ((context) =>
-            {
+            this.draw.connect ((context) => {
                 int height = this.get_allocated_height ();
                 int width = this.get_allocated_width ();
 
@@ -51,8 +47,7 @@ namespace Usage {
                 double ratio;
                 double angle2 = - Math.PI / 2.0;
 
-                if(used_percentages > 0)
-                {
+                if(used_percentages > 0) {
                     angle1 = - Math.PI / 2.0;
                     ratio = (double) used_percentages / 100;
                     angle2 = ratio * 2 * Math.PI - Math.PI / 2.0;
@@ -62,8 +57,7 @@ namespace Usage {
                     context.fill();
                 }
 
-                if(other_percentages > 0)
-                {
+                if(other_percentages > 0) {
                     angle1 = angle2;
                     ratio = (double) other_percentages / 100;
                     angle2 = ratio * 2 * Math.PI - Math.PI / 2.0;
@@ -83,8 +77,7 @@ namespace Usage {
             });
         }
 
-        private void set_styles()
-        {
+        private void set_styles() {
             var context = get_style_context();
             context.add_class("used");
             used_color = context.get_color(context.get_state());
@@ -94,8 +87,7 @@ namespace Usage {
             available = context.get_color(context.get_state());
         }
 
-        public void update(int used_percentages, int other_percentages)
-        {
+        public void update(int used_percentages, int other_percentages) {
             this.used_percentages = used_percentages;
             this.other_percentages = used_percentages + other_percentages;
             this.queue_draw();
diff --git a/src/process-list-box.vala b/src/process-list-box.vala
index 7579406..3e07328 100644
--- a/src/process-list-box.vala
+++ b/src/process-list-box.vala
@@ -18,15 +18,13 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
+namespace Usage {
     public enum ProcessListBoxType {
         PROCESSOR,
         MEMORY
     }
 
-    public class ProcessListBox : Gtk.ListBox
-    {
+    public class ProcessListBox : Gtk.ListBox {
         public bool empty { get; set; default = true; }
         public string search_text { get; set; default = ""; }
 
@@ -35,8 +33,7 @@ namespace Usage
         private ListStore model;
         private ProcessListBoxType type;
 
-        public ProcessListBox(ProcessListBoxType type)
-        {
+        public ProcessListBox(ProcessListBoxType type) {
             set_selection_mode (Gtk.SelectionMode.NONE);
             set_header_func (update_header);
 
@@ -65,8 +62,7 @@ namespace Usage
             bind_property ("empty", this, "visible", BindingFlags.INVERT_BOOLEAN);
         }
 
-        private bool update()
-        {
+        private bool update() {
             model.remove_all();
 
             CompareDataFunc<AppItem> app_cmp = (a, b) => {
@@ -84,8 +80,7 @@ namespace Usage
 
             var system_monitor = SystemMonitor.get_default();
             if(search_text == "") {
-                switch(type)
-                {
+                switch(type) {
                     default:
                     case ProcessListBoxType.PROCESSOR:
                         foreach(unowned AppItem app in system_monitor.get_apps()) {
diff --git a/src/process-row.vala b/src/process-row.vala
index 3c4cab8..86aa7fa 100644
--- a/src/process-row.vala
+++ b/src/process-row.vala
@@ -18,11 +18,9 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
+namespace Usage {
     [GtkTemplate (ui = "/org/gnome/Usage/ui/process-row.ui")]
-    public class ProcessRow : Gtk.ListBoxRow
-    {
+    public class ProcessRow : Gtk.ListBoxRow {
         public AppItem app { get; private set; }
         public bool max_usage { get; private set; }
 
@@ -50,8 +48,7 @@ namespace Usage
 
         private ProcessListBoxType type;
 
-        public ProcessRow(AppItem app, ProcessListBoxType type)
-        {
+        public ProcessRow(AppItem app, ProcessListBoxType type) {
             this.type = type;
             this.app = app;
             this.icon.gicon = app.get_icon();
@@ -59,18 +56,15 @@ namespace Usage
             update();
         }
 
-        private void update()
-        {
+        private void update() {
             update_load_label();
             update_user_tag();
 
             title_label.label = app.display_name;
         }
 
-        private void update_load_label()
-        {
-            switch(type)
-            {
+        private void update_load_label() {
+            switch(type) {
                 case ProcessListBoxType.PROCESSOR:
                     load_label.label = ((int) app.cpu_load).to_string() + " %";
                     break;
@@ -80,8 +74,7 @@ namespace Usage
             }
         }
 
-        private void update_user_tag()
-        {
+        private void update_user_tag() {
             if (app.user == null)
                 return;
 
@@ -89,27 +82,22 @@ namespace Usage
             create_user_tag();
         }
 
-        private void remove_user_tag()
-        {
+        private void remove_user_tag() {
             user_tag_box.visible = false;
             user_tag_box.get_style_context().remove_class(CSS_TAG_USER);
             user_tag_box.get_style_context().remove_class(CSS_TAG_ROOT);
             user_tag_box.get_style_context().remove_class(CSS_TAG_SYSTEM);
         }
 
-        private void create_user_tag()
-        {
+        private void create_user_tag() {
             string class_name = "";
-            if(app.user.LocalAccount)
-            {
+            if(app.user.LocalAccount) {
                 class_name = CSS_TAG_USER;
             }
-            else if(app.user.AccountType == UserAccountType.ADMINISTRATOR)
-            {
+            else if(app.user.AccountType == UserAccountType.ADMINISTRATOR) {
                 class_name = CSS_TAG_ROOT;
             }
-            else if(app.user.SystemAccount)
-            {
+            else if(app.user.SystemAccount) {
                 class_name = CSS_TAG_SYSTEM;
             }
 
@@ -122,8 +110,7 @@ namespace Usage
             return app.user.UserName == GLib.Environment.get_user_name();
         }
 
-        public new void activate()
-        {
+        public new void activate() {
             var settings = Settings.get_default();
             if (app.representative_cmdline in settings.get_strv ("unkillable-processes"))
                 return;
diff --git a/src/process.vala b/src/process.vala
index e3ccea9..7bdb4e8 100644
--- a/src/process.vala
+++ b/src/process.vala
@@ -18,10 +18,8 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public class Process : Object
-    {
+namespace Usage {
+    public class Process : Object {
         public Pid pid { get; private set; }
         public string cmdline { get; private set; }
         public uint uid { get; private set; }
@@ -43,20 +41,17 @@ namespace Usage
         private string? _app_id = null;
         private bool _app_id_checked = false;
 
-        public Process(Pid pid)
-        {
+        public Process(Pid pid) {
             this.pid = pid;
             this.cmdline = get_full_process_cmd (pid);
             this.uid = _get_uid();
         }
 
-        public void update_status ()
-        {
+        public void update_status () {
             GTop.ProcState proc_state;
             GTop.get_proc_state (out proc_state, pid);
 
-            switch(proc_state.state)
-            {
+            switch(proc_state.state) {
                 case GTop.PROCESS_RUNNING:
                 case GTop.PROCESS_UNINTERRUPTIBLE:
                     status = ProcessStatus.RUNNING;
@@ -79,8 +74,7 @@ namespace Usage
             mark_as_updated = true;
         }
 
-        private uint _get_uid()
-        {
+        private uint _get_uid() {
             GTop.ProcUid procUid;
             GTop.get_proc_uid(out procUid, pid);
             return procUid.uid;
@@ -245,8 +239,7 @@ namespace Usage
         }
     }
 
-    public enum ProcessStatus
-    {
+    public enum ProcessStatus {
         RUNNING,
         SLEEPING,
         DEAD
diff --git a/src/quit-process-dialog.vala b/src/quit-process-dialog.vala
index 6008e15..9225097 100644
--- a/src/quit-process-dialog.vala
+++ b/src/quit-process-dialog.vala
@@ -21,29 +21,24 @@
 
 using Gtk;
 
-namespace Usage
-{
+namespace Usage {
     [GtkTemplate (ui = "/org/gnome/Usage/ui/quit-process-dialog.ui")]
-    public class QuitProcessDialog : Gtk.MessageDialog
-    {
+    public class QuitProcessDialog : Gtk.MessageDialog {
         private AppItem app;
 
-        public QuitProcessDialog(AppItem app)
-        {
+        public QuitProcessDialog(AppItem app) {
             this.app = app;
             this.text = this.text.printf(app.display_name);
         }
 
         [GtkCallback]
-        private void on_force_quit_button_clicked ()
-        {
+        private void on_force_quit_button_clicked () {
             app.kill();
             this.destroy();
         }
 
         [GtkCallback]
-        public void cancel ()
-        {
+        public void cancel () {
             /* FIXME: For some reason we are not able to connect to the
              * destroy signal right from the .ui file. */
             this.destroy();
diff --git a/src/settings.vala b/src/settings.vala
index f82e7b8..e459659 100644
--- a/src/settings.vala
+++ b/src/settings.vala
@@ -22,8 +22,7 @@ using Gtk;
 
 namespace Usage {
 
-    public class Settings : GLib.Settings
-    {
+    public class Settings : GLib.Settings {
         public uint graph_timespan { get; set; default = 15000;}
         public uint graph_max_samples { get; set; default = 20; }
         public uint graph_update_interval { get { return 1000; }}
@@ -33,16 +32,14 @@ namespace Usage {
 
         private static Settings settings;
 
-        public static Settings get_default()
-        {
+        public static Settings get_default() {
             if (settings == null)
                 settings = new Settings ();
 
             return settings;
         }
 
-        public Settings()
-        {
+        public Settings() {
             Object(schema_id: Config.APPLICATION_ID);
         }
     }
diff --git a/src/speedometer.vala b/src/speedometer.vala
index 66a8646..2fb98bd 100644
--- a/src/speedometer.vala
+++ b/src/speedometer.vala
@@ -20,11 +20,9 @@
 
 using Gtk;
 
-namespace Usage
-{
+namespace Usage {
     [GtkTemplate (ui = "/org/gnome/Usage/ui/speedometer.ui")]
-    public class Speedometer : Buildable, Gtk.Bin
-    {
+    public class Speedometer : Buildable, Gtk.Bin {
         [GtkChild]
         private unowned Gtk.Box inner;
 
@@ -54,16 +52,14 @@ namespace Usage
             bind_property("height-request", content_area, "height-request", BindingFlags.BIDIRECTIONAL);
         }
 
-        private void on_percentage_changed(int new_value)
-        {
+        private void on_percentage_changed(int new_value) {
             if (new_value <= 0 && new_value >= 100)
                 return;
 
             double new_angle = 90 + (360 * (new_value/100.0));
             var filling_color = "@theme_base_color";
 
-            if (new_value > 50)
-            {
+            if (new_value > 50) {
                 new_angle -= 180;
                 filling_color = "@theme_selected_bg_color";
             }
@@ -74,18 +70,15 @@ namespace Usage
                             linear-gradient(90deg, @theme_base_color 50%, transparent 50%);
             }";
 
-            try
-            {
+            try {
                 css_provider.load_from_data(css);
             }
-            catch (GLib.Error error)
-            {
+            catch (GLib.Error error) {
                 warning("Failed to animate speedometer: %s", error.message);
             }
         }
 
-        public void add_child(Builder builder, Object child, string? type)
-        {
+        public void add_child(Builder builder, Object child, string? type) {
             /* This is a Vala bug. It will cause a "warning".
             (content_area as Buildable).add_child(builder, child, type);*/
             if (child is Gtk.Label) {
diff --git a/src/storage/storage-actionbar.vala b/src/storage/storage-actionbar.vala
index ac2539f..e21f702 100644
--- a/src/storage/storage-actionbar.vala
+++ b/src/storage/storage-actionbar.vala
@@ -18,11 +18,9 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
+namespace Usage {
     [GtkTemplate (ui = "/org/gnome/Usage/ui/storage-actionbar.ui")]
-    public class StorageActionBar : Gtk.ActionBar
-    {
+    public class StorageActionBar : Gtk.ActionBar {
         private unowned List<StorageViewItem> selected_items;
 
         [GtkChild]
diff --git a/src/storage/storage-graph.vala b/src/storage/storage-graph.vala
index 3ba067b..6140aff 100644
--- a/src/storage/storage-graph.vala
+++ b/src/storage/storage-graph.vala
@@ -20,10 +20,8 @@
 
 using Gtk;
 
-namespace Usage
-{
-    public class StorageGraph : Gtk.DrawingArea
-    {
+namespace Usage {
+    public class StorageGraph : Gtk.DrawingArea {
         private unowned List<StorageViewItem> selected_items;
         private unowned GLib.ListStore _model;
         private uint64 selected_size = 0;
@@ -36,8 +34,7 @@ namespace Usage
                 this.queue_draw ();
                 root = false;
 
-                for(int i = 0; i < value.get_n_items(); i++)
-                {
+                for(int i = 0; i < value.get_n_items(); i++) {
                     var item = model.get_item(i) as StorageViewItem;
                     if(item.custom_type == StorageViewType.OS) {
                         root = true;
@@ -50,13 +47,11 @@ namespace Usage
 
         public uint min_percentage_shown_files { set; get; }
 
-        class construct
-        {
+        class construct {
             set_css_name("StorageGraph");
         }
 
-        public enum Circle
-        {
+        public enum Circle {
             HOME,
             ROOT,
             BASE
@@ -73,8 +68,7 @@ namespace Usage
             this.queue_draw();
         }
 
-        private void draw_circle(Cairo.Context context, double x, double y, double radius, int section, 
Circle circle)
-        {
+        private void draw_circle(Cairo.Context context, double x, double y, double radius, int section, 
Circle circle) {
             double start_angle = 0;
             double final_angle = - Math.PI / 2.0;
             double ratio = 0;
@@ -98,8 +92,7 @@ namespace Usage
                 if(shown_items_number < 3)
                     shown_items_number = 3;
 
-                for(int i = 0; i < model.get_n_items(); i++)
-                {
+                for(int i = 0; i < model.get_n_items(); i++) {
                     var item = model.get_item(i) as StorageViewItem;
                     var item_radius = radius;
                     if(item.custom_type == StorageViewType.UP_FOLDER || item.size == 0)
@@ -156,8 +149,7 @@ namespace Usage
             }
         }
 
-        private bool draw_storage_graph(Cairo.Context context)
-        {
+        private bool draw_storage_graph(Cairo.Context context) {
             int height = this.get_allocated_height ();
             int width = this.get_allocated_width ();
 
@@ -176,8 +168,7 @@ namespace Usage
             return true;
         }
 
-        private void draw_selected_size_text(Cairo.Context context)
-        {
+        private void draw_selected_size_text(Cairo.Context context) {
             if(selected_size == 0)
                 return;
 
diff --git a/src/swap-speedometer.vala b/src/swap-speedometer.vala
index 0672729..7db466f 100644
--- a/src/swap-speedometer.vala
+++ b/src/swap-speedometer.vala
@@ -20,11 +20,9 @@
 
 using Gtk;
 
-namespace Usage
-{
+namespace Usage {
     [GtkTemplate (ui = "/org/gnome/Usage/ui/swap-speedometer.ui")]
-    public class SwapSpeedometer : Gtk.Bin
-    {
+    public class SwapSpeedometer : Gtk.Bin {
         [GtkChild]
         private unowned Usage.Speedometer speedometer;
 
diff --git a/src/system-monitor.vala b/src/system-monitor.vala
index aa8cd88..6bd38b4 100644
--- a/src/system-monitor.vala
+++ b/src/system-monitor.vala
@@ -18,10 +18,8 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public class SystemMonitor : Object
-    {
+namespace Usage {
+    public class SystemMonitor : Object {
         public bool process_list_ready { get; private set; default = false; }
         public double cpu_load { get; private set; }
         public double[] x_cpu_load { get; private set; }
@@ -40,26 +38,22 @@ namespace Usage
         private int process_mode = GTop.KERN_PROC_ALL;
         private static SystemMonitor system_monitor;
 
-        public static SystemMonitor get_default()
-        {
+        public static SystemMonitor get_default() {
             if (system_monitor == null)
                 system_monitor = new SystemMonitor ();
 
             return system_monitor;
         }
 
-        public List<unowned AppItem> get_apps()
-        {
+        public List<unowned AppItem> get_apps() {
             return app_table.get_values();
         }
 
-        public unowned AppItem get_app_by_name(string name)
-        {
+        public unowned AppItem get_app_by_name(string name) {
             return app_table.get(name);
         }
 
-        public SystemMonitor()
-        {
+        public SystemMonitor() {
             GTop.init();
             AppItem.init();
 
@@ -79,8 +73,7 @@ namespace Usage
             Timeout.add(settings.data_update_interval, update_data);
         }
 
-        private void init()
-        {
+        private void init() {
             var settings = Settings.get_default();
             app_table.remove_all();
             process_list_ready = false;
@@ -95,15 +88,13 @@ namespace Usage
             }
 
             update_data();
-            Timeout.add(settings.data_update_interval, () =>
-            {
+            Timeout.add(settings.data_update_interval, () => {
                 process_list_ready = true;
                 return false;
             });
         }
 
-        private bool update_data()
-        {
+        private bool update_data() {
             cpu_monitor.update();
             memory_monitor.update();
 
@@ -237,16 +228,14 @@ namespace Usage
             return p.cmdline;
         }
 
-        private void update_process(ref Process process)
-        {
+        private void update_process(ref Process process) {
             cpu_monitor.update_process(ref process);
             memory_monitor.update_process(ref process);
             process.update_status();
             process.gamemode = gamemode_pids.contains((int) process.pid);
         }
 
-        public static void sort_pids (void *pids, size_t elm, size_t length)
-        {
+        public static void sort_pids (void *pids, size_t elm, size_t length) {
             Posix.qsort (pids, length, elm, (a, b) => {
                     return (*(GLib.Pid *) a) - (* (GLib.Pid *) b);
                 });
diff --git a/src/utils.vala b/src/utils.vala
index 0a16a1e..6b5f0c0 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -18,12 +18,9 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public class Utils
-    {
-        public static string format_size_values(uint64 value)
-        {
+namespace Usage {
+    public class Utils {
+        public static string format_size_values(uint64 value) {
             if(value >= 1000000000000)
                 return "%.3f TB".printf((double) value / 1000000000000d);
             else if(value >= 1000000000)
@@ -36,8 +33,7 @@ namespace Usage
                 return value.to_string() + " B";
         }
 
-        public static string format_size_speed_values(uint64 value)
-        {
+        public static string format_size_speed_values(uint64 value) {
             if(value >= 1000000000000)
                 return "%.3f TB/s".printf((double) value / 1000000000000d);
             else if(value >= 1000000000)
@@ -50,24 +46,21 @@ namespace Usage
                 return value.to_string() + " B/s";
         }
 
-        public static Gdk.RGBA generate_color(Gdk.RGBA default_color, uint order, uint all_count, bool 
reverse = false)
-        {
+        public static Gdk.RGBA generate_color(Gdk.RGBA default_color, uint order, uint all_count, bool 
reverse = false) {
             double step = 100 / (double) all_count;
             uint half_count = all_count / 2;
 
             if(order >= all_count)
                 order = all_count - 1;
 
-            if(order > (all_count / 2))
-            {
+            if(order > (all_count / 2)) {
                 double percentage = step * (order - half_count);
                 if(reverse)
                     return Utils.color_lighter(default_color, percentage);
                 else
                     return Utils.color_darker(default_color, percentage);
             }
-            else
-            {
+            else {
                 double percentage = step * (half_count - (order-1));
                 if(reverse)
                     return Utils.color_darker(default_color, percentage);
@@ -76,8 +69,7 @@ namespace Usage
             }
         }
 
-        public static Gdk.RGBA color_darker(Gdk.RGBA color, double percentage)
-        {
+        public static Gdk.RGBA color_darker(Gdk.RGBA color, double percentage) {
             color.red = color_field_darker(color.red, percentage);
             color.green = color_field_darker(color.green, percentage);
             color.blue = color_field_darker(color.blue, percentage);
@@ -85,8 +77,7 @@ namespace Usage
             return color;
         }
 
-        public static Gdk.RGBA color_lighter(Gdk.RGBA color, double percentage)
-        {
+        public static Gdk.RGBA color_lighter(Gdk.RGBA color, double percentage) {
             color.red = color_field_lighter(color.red, percentage);
             color.green = color_field_lighter(color.green, percentage);
             color.blue = color_field_lighter(color.blue, percentage);
@@ -94,14 +85,12 @@ namespace Usage
             return color;
         }
 
-        private static double color_field_darker(double field, double percentage)
-        {
+        private static double color_field_darker(double field, double percentage) {
             field = field * 255;
             return (field - ((field / 100) * percentage)) / 255;
         }
 
-        private static double color_field_lighter(double field, double percentage)
-        {
+        private static double color_field_lighter(double field, double percentage) {
             field = field * 255;
             return (field + (((255 - field) / 100) * percentage)) / 255;
         }
diff --git a/src/view.vala b/src/view.vala
index 997197c..ed75eb8 100644
--- a/src/view.vala
+++ b/src/view.vala
@@ -18,15 +18,12 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public abstract class View : Gtk.Bin
-    {
+namespace Usage {
+    public abstract class View : Gtk.Bin {
         public string title;
         public string icon_name;
 
-        protected View ()
-        {
+        protected View () {
             visible = true;
         }
     }
diff --git a/src/window.vala b/src/window.vala
index 249b9de..b132915 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -19,23 +19,19 @@
  * Authors: Petr Štětka <pstetka redhat com>
  */
 
-namespace Usage
-{
-    public enum Views
-    {
+namespace Usage {
+    public enum Views {
         PERFORMANCE,
         STORAGE,
     }
 
-    public enum HeaderBarMode
-    {
+    public enum HeaderBarMode {
         PERFORMANCE,
         STORAGE,
     }
 
     [GtkTemplate (ui = "/org/gnome/Usage/ui/window.ui")]
-    public class Window : Hdy.ApplicationWindow
-    {
+    public class Window : Hdy.ApplicationWindow {
         [GtkChild]
         private unowned Gtk.Stack stack;
 
@@ -56,8 +52,7 @@ namespace Usage
 
         private View[] views;
 
-        public Window(Gtk.Application application)
-        {
+        public Window(Gtk.Application application) {
             GLib.Object(application : application);
 
             if(Config.PROFILE == "Devel") {
@@ -65,8 +60,7 @@ namespace Usage
             }
 
             load_css();
-            Gtk.Settings.get_for_screen(get_screen()).notify["gtk-application-prefer-dark-theme"].connect(() 
=>
-            {
+            Gtk.Settings.get_for_screen(get_screen()).notify["gtk-application-prefer-dark-theme"].connect(() 
=> {
                 load_css();
             });
 
@@ -76,8 +70,7 @@ namespace Usage
 
             set_mode(HeaderBarMode.PERFORMANCE);
 
-            views = new View[]
-            {
+            views = new View[] {
                 new PerformanceView(),
                 new StorageView(),
             };
@@ -88,10 +81,8 @@ namespace Usage
             }
         }
 
-        public void set_mode(HeaderBarMode mode)
-        {
-            switch(this.mode)
-            {
+        public void set_mode(HeaderBarMode mode) {
+            switch(this.mode) {
                 case HeaderBarMode.PERFORMANCE:
                     performance_search_revealer.reveal_child = false;
                     break;
@@ -99,8 +90,7 @@ namespace Usage
                     break;
             }
 
-            switch(mode)
-            {
+            switch(mode) {
                 case HeaderBarMode.PERFORMANCE:
                     performance_search_revealer.reveal_child = true;
                     break;
@@ -111,10 +101,8 @@ namespace Usage
             this.mode = mode;
         }
 
-        public void action_on_search()
-        {
-            switch(mode)
-            {
+        public void action_on_search() {
+            switch(mode) {
                 case HeaderBarMode.PERFORMANCE:
                     performance_search_button.set_active(!performance_search_button.get_active());
                     break;
@@ -123,13 +111,11 @@ namespace Usage
             }
         }
 
-        public View[] get_views()
-        {
+        public View[] get_views() {
             return views;
         }
 
-        private void load_css()
-        {
+        private void load_css() {
             var provider = new Gtk.CssProvider();
             Gtk.StyleContext.reset_widgets(get_screen());
             provider.load_from_resource("/org/gnome/Usage/interface/adwaita.css");
@@ -143,14 +129,11 @@ namespace Usage
         }
 
         [GtkCallback]
-        private void on_visible_child_changed()
-        {
-            if(stack.visible_child_name == views[Views.PERFORMANCE].name)
-            {
+        private void on_visible_child_changed() {
+            if(stack.visible_child_name == views[Views.PERFORMANCE].name) {
                 set_mode(HeaderBarMode.PERFORMANCE);
             }
-            else if(stack.visible_child_name == views[Views.STORAGE].name)
-            {
+            else if(stack.visible_child_name == views[Views.STORAGE].name) {
                 set_mode(HeaderBarMode.STORAGE);
             }
         }
diff --git a/vapi/libgtop-2.0.vapi b/vapi/libgtop-2.0.vapi
index d25e09a..96a0858 100644
--- a/vapi/libgtop-2.0.vapi
+++ b/vapi/libgtop-2.0.vapi
@@ -198,8 +198,7 @@ namespace GTop {
     public void get_fsusage(out FsUsage fs_usage, string mount_dir);
 
     [CCode(cname = "glibtop_mountentry", cheader_filename = "glibtop/mountlist.h", 
destroy_function="g_free")]
-    public struct MountEntry
-    {
+    public struct MountEntry {
         uint64 dev;
         char devname[80];
         char mountdir[80];
@@ -207,8 +206,7 @@ namespace GTop {
     }
 
     [CCode(cname = "glibtop_mountlist", cheader_filename = "glibtop/mountlist.h")]
-    public struct MountList
-    {
+    public struct MountList {
         uint64 flags;
         uint64 number;
         uint64 total;


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