From 56e64d007662bc7815202decd7b4802bcb320357 Mon Sep 17 00:00:00 2001 From: Eudald Gubert i Roldan Date: Mon, 27 Jul 2020 17:56:08 +0000 Subject: [PATCH] Definitive fix lint & build --- src/Application.vala | 4 ++-- src/Layouts/HeaderBar.vala | 36 ++++++++++++++++++------------------ src/Layouts/Popover.vala | 4 ++-- src/Layouts/Stack.vala | 18 +++++++++--------- src/MainWindow.vala | 6 +++--- src/Views/Main.vala | 4 ++-- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/Application.vala b/src/Application.vala index f9591c6..84b209a 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -11,8 +11,8 @@ public class Elements : Gtk.Application { var provider = new Gtk.CssProvider (); provider.load_from_resource ("/com/github/eudaldgr/elements/stylesheet.css"); Gtk.StyleContext.add_provider_for_screen ( - Gdk.Screen.get_default (), - provider, + Gdk.Screen.get_default (), + provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION ); diff --git a/src/Layouts/HeaderBar.vala b/src/Layouts/HeaderBar.vala index ad4775b..2724c8e 100644 --- a/src/Layouts/HeaderBar.vala +++ b/src/Layouts/HeaderBar.vala @@ -5,16 +5,16 @@ public class HeaderBar : Gtk.HeaderBar { Popover popover = Popover.get_instance (); public Gtk.Button info_button = new Gtk.Button.from_icon_name ("help-contents-symbolic"); - public ModeButton periodicView_mode = new Granite.Widgets.ModeButton (); + public Granite.Widgets.ModeButton periodic_view_mode = new Granite.Widgets.ModeButton (); HeaderBar () { this.get_style_context ().add_class ("flat"); - generateInfoButton (); - generatePeriodicViewMode (); + generate_info_button (); + generate_periodic_view_mode (); this.show_close_button = true; - this.custom_title = periodicView_mode; + this.custom_title = periodic_view_mode; this.pack_end (info_button); } @@ -25,19 +25,19 @@ public class HeaderBar : Gtk.HeaderBar { return instance; } - generatePeriodicViewMode () { + private void generate_periodic_view_mode () { var label1 = new Gtk.Label (_("Main")); var label2 = new Gtk.Label (_("Electronegativity")); label1.name = "main_view"; label2.name = "electronegativity_view"; - periodicView_mode.append (label1); - periodicView_mode.append (label2); - periodicView_mode.notify["selected"].connect (on_periodicView_mode_changed); + periodic_view_mode.append (label1); + periodic_view_mode.append (label2); + periodic_view_mode.notify["selected"].connect (on_periodic_view_mode_changed); } - generateInfoButton () { + private void generate_info_button () { var pop = new Gtk.Popover (info_button); pop.add (popover); @@ -47,25 +47,25 @@ public class HeaderBar : Gtk.HeaderBar { }); } - showPeriodicViewMode (bool answer) { - periodicView_mode.visible = answer; + public void show_periodic_view_mode (bool answer) { + periodic_view_mode.visible = answer; } - showInfoButton (bool answer) { + public void show_info_button (bool answer) { info_button.visible = answer; } - setSelectedPeriodicViewMode (int answer) { - periodicView_mode.selected = answer; + public void set_selected_periodic_view_mode (int answer) { + periodic_view_mode.selected = answer; } - on_periodicView_mode_changed () { - switch (periodicView_mode.selected) { + private void on_periodic_view_mode_changed () { + switch (periodic_view_mode.selected) { case 1: - stack.getStack ().visible_child_name = "electronegativity_view"; + stack.get_stack ().visible_child_name = "electronegativity_view"; break; default: - stack.getStack ().visible_child_name = "main_view"; + stack.get_stack ().visible_child_name = "main_view"; break; } } diff --git a/src/Layouts/Popover.vala b/src/Layouts/Popover.vala index fe67db1..4f717eb 100644 --- a/src/Layouts/Popover.vala +++ b/src/Layouts/Popover.vala @@ -14,7 +14,7 @@ public class Popover : Gtk.Grid { this.margin = 5; this.row_spacing = 5; - stack.getStack ().notify["visible-child"].connect ( () => { + stack.get_stack ().notify["visible-child"].connect ( () => { this.remove_column (0); for (int i = 0; i <= TYPES.NAME[1,i].length; i++) { @@ -24,7 +24,7 @@ public class Popover : Gtk.Grid { this.add (button); - switch (stack.getStack ().get_visible_child_name ()) { + switch (stack.get_stack ().get_visible_child_name ()) { case "electronegativity_view": button.label = TYPES.NAME[i,1]; button.get_style_context ().add_class (TYPES.CSS_TAG[i,1]); diff --git a/src/Layouts/Stack.vala b/src/Layouts/Stack.vala index 6d703fa..c8fda46 100644 --- a/src/Layouts/Stack.vala +++ b/src/Layouts/Stack.vala @@ -16,11 +16,11 @@ public class Stack : Object { return instance; } - public Gtk.Stack getStack () { + public Gtk.Stack get_stack () { return this.stack; } - public void loadViews (Gtk.Window window) { + public void load_views (Gtk.Window window) { var main_view = new PeriodicView ("main_view"); var electro_view = new PeriodicView ("electronegativity_view"); @@ -28,18 +28,18 @@ public class Stack : Object { stack.add_titled (electro_view, "electronegativity_view", _("Electronegativity")); stack.notify["visible-child"].connect ( () => { - var headerBar = HeaderBar.get_instance (); + var header_bar = HeaderBar.get_instance (); if (stack.get_visible_child_name () == "main_view") { - headerBar.showInfoButton (true); - headerBar.showPeriodicViewMode (true); - headerBar.setSelectedPeriodicViewMode (0); + header_bar.show_info_button (true); + header_bar.show_periodic_view_mode (true); + header_bar.set_selected_periodic_view_mode (0); } if (stack.get_visible_child_name () == "electronegativity_view") { - headerBar.showInfoButton (true); - headerBar.showPeriodicViewMode (true); - headerBar.setSelectedPeriodicViewMode (1); + header_bar.show_info_button (true); + header_bar.show_periodic_view_mode (true); + header_bar.set_selected_periodic_view_mode (1); } }); diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 3952ea8..9a9504a 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -3,16 +3,16 @@ public class MainWindow : Gtk.ApplicationWindow { private uint configure_id; private Stack stack = Stack.get_instance (); - private HeaderBar headerBar = HeaderBar.get_instance (); + private HeaderBar header_bar = HeaderBar.get_instance (); public MainWindow (Gtk.Application application) { Object (application: application, icon_name: "com.github.eudaldgr.elements"); this.show_all (); - this.set_titlebar (headerBar); + this.set_titlebar (header_bar); - stack.loadViews (this); + stack.load_views (this); settings = new Settings ("com.github.eudaldgr.elements"); diff --git a/src/Views/Main.vala b/src/Views/Main.vala index 379efb8..e617009 100644 --- a/src/Views/Main.vala +++ b/src/Views/Main.vala @@ -1,5 +1,5 @@ public class PeriodicView : Gtk.Grid { - public static headerBar = HeaderBar.get_instance (); + HeaderBar header_bar = HeaderBar.get_instance (); static PeriodicView? instance; @@ -11,7 +11,7 @@ public class PeriodicView : Gtk.Grid { } public PeriodicView (string id) { - headerBar.showPeriodicViewMode (true); + header_bar.show_periodic_view_mode (true); this.row_spacing = 3; this.column_spacing = 3;