Skip to content

Commit

Permalink
Merge pull request #152 from NathanBnm/fix-warnings
Browse files Browse the repository at this point in the history
Fix warnings
  • Loading branch information
parnold-x committed May 30, 2020
2 parents 024f948 + b26970c commit 34a0a40
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
16 changes: 8 additions & 8 deletions src/HelpBox.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -94,30 +94,30 @@ 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;
name_label.set_alignment (0, 0);

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;
arg_list_label.set_alignment (0, 0);

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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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 (() => {
Expand Down
3 changes: 2 additions & 1 deletion src/InputView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -411,7 +412,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, 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);
Expand Down
10 changes: 8 additions & 2 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 34a0a40

Please sign in to comment.