From dabe4f012be7f566a08bc34ef286c7ce65e9ec11 Mon Sep 17 00:00:00 2001 From: Nathan Bonnemains Date: Sat, 30 May 2020 19:31:03 +0200 Subject: [PATCH 1/4] Fix margin_left deprecation --- src/HelpBox.vala | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/HelpBox.vala b/src/HelpBox.vala index 948f1d9..c83959b 100644 --- a/src/HelpBox.vala +++ b/src/HelpBox.vala @@ -85,7 +85,7 @@ public class HelpBox : Gtk.Box { var detail_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); headline = new Gtk.Label (""); headline.margin_top = 10; - headline.margin_left = 10; + headline.margin_start = 10; headline.halign = Gtk.Align.START; headline.set_alignment (0, 0); headline.use_markup = true; @@ -94,7 +94,7 @@ public class HelpBox : Gtk.Box { name_label = new Gtk.Label (""); name_label.margin_top = 8; - name_label.margin_left = 10; + name_label.margin_start = 10; name_label.halign = Gtk.Align.START; name_label.use_markup = true; name_label.wrap = true; @@ -102,14 +102,14 @@ public class HelpBox : Gtk.Box { arg_label = new Gtk.Label (""); arg_label.margin_top = 8; - arg_label.margin_left = 10; + arg_label.margin_start = 10; arg_label.halign = Gtk.Align.START; arg_label.use_markup = true; arg_label.wrap = true; arg_list_label = new Gtk.Label (""); arg_list_label.margin_top = 10; - arg_list_label.margin_left = 20; + arg_list_label.margin_start = 20; arg_list_label.halign = Gtk.Align.START; arg_list_label.use_markup = true; arg_list_label.wrap = true; @@ -117,7 +117,7 @@ public class HelpBox : Gtk.Box { desc_label = new Gtk.Label (""); desc_label.margin_top = 10; - desc_label.margin_left = 10; + desc_label.margin_start = 10; desc_label.halign = Gtk.Align.START; desc_label.use_markup = true; desc_label.wrap = true; @@ -138,7 +138,7 @@ public class HelpBox : Gtk.Box { var amath_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); var a_headline = new Gtk.Label (""); a_headline.margin_top = 10; - a_headline.margin_left = 10; + a_headline.margin_start = 10; a_headline.halign = Gtk.Align.START; a_headline.set_alignment (0, 0); a_headline.use_markup = true; @@ -148,7 +148,7 @@ public class HelpBox : Gtk.Box { var a_desc_label = new Gtk.Label (""); a_desc_label.margin_top = 10; - a_desc_label.margin_left = 10; + a_desc_label.margin_start = 10; a_desc_label.halign = Gtk.Align.START; a_desc_label.use_markup = true; a_desc_label.wrap = true; @@ -158,7 +158,7 @@ public class HelpBox : Gtk.Box { var a_switch = new Gtk.Switch (); a_switch.margin_top = 10; - a_switch.margin_left = 10; + a_switch.margin_start = 10; a_switch.halign = Gtk.Align.START; a_switch.set_active (NascSettings.get_instance ().advanced_mode); a_switch.notify["active"].connect (() => { From 91bac0f0c3e57019908c73157dff924bd6a4bb5d Mon Sep 17 00:00:00 2001 From: Nathan Bonnemains Date: Sat, 30 May 2020 19:42:48 +0200 Subject: [PATCH 2/4] Fix forward deprecation --- src/InputView.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InputView.vala b/src/InputView.vala index c7b7b0c..d45ba20 100644 --- a/src/InputView.vala +++ b/src/InputView.vala @@ -411,7 +411,7 @@ public class InputView : Gtk.Box { int[] line_array = {}; int delta = 0; - while (search.forward (start_iter, out start_iter, out end_iter)) { + while (search.forward2 (start_iter, out start_iter, out end_iter)) { MatchInfo info; var text = source_view.buffer.get_text (start_iter, end_iter, false); digit_regex.match (text, 0, out info); From 6409d042b9d12bae5cddfcd6b37b130f05d7ce24 Mon Sep 17 00:00:00 2001 From: Nathan Bonnemains Date: Sat, 30 May 2020 19:44:39 +0200 Subject: [PATCH 3/4] Fix missing arg --- src/InputView.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/InputView.vala b/src/InputView.vala index d45ba20..74eded7 100644 --- a/src/InputView.vala +++ b/src/InputView.vala @@ -403,6 +403,7 @@ public class InputView : Gtk.Box { skip_change = true; int cursor_pos; Gtk.TextIter start_iter, end_iter, cursor; + bool has_wrapped_around; source_view.buffer.get_iter_at_offset (out cursor, source_view.buffer.cursor_position); cursor_pos = cursor.get_offset (); source_view.buffer.get_iter_at_offset (out start_iter, 0); @@ -411,7 +412,7 @@ public class InputView : Gtk.Box { int[] line_array = {}; int delta = 0; - while (search.forward2 (start_iter, out start_iter, out end_iter)) { + while (search.forward2 (start_iter, out start_iter, out end_iter, out has_wrapped_around)) { MatchInfo info; var text = source_view.buffer.get_text (start_iter, end_iter, false); digit_regex.match (text, 0, out info); From b26970c7ce0d120c3c7d9ba4ae8f8f3dc4a382a4 Mon Sep 17 00:00:00 2001 From: Nathan Bonnemains Date: Sat, 30 May 2020 19:51:50 +0200 Subject: [PATCH 4/4] Fix Gdk.Screen deprecations --- src/MainWindow.vala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/MainWindow.vala b/src/MainWindow.vala index de51021..05b8d17 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -49,8 +49,14 @@ namespace Nasc { if (x != -1 && y != -1) { move (x, y); } else { - x = (Gdk.Screen.width () - default_width) / 2; - y = (Gdk.Screen.height () - default_height) / 2; + var display = Gdk.Display.get_default (); + var monitor = display.get_primary_monitor (); + var geometry = monitor.get_geometry (); + var scale_factor = monitor.get_scale_factor (); + var width = scale_factor * geometry.width; + var height = scale_factor * geometry.height; + x = (width - default_width) / 2; + y = (height - default_height) / 2; move (x, y); }