From 7c3d0881d2a5df77a70efdea39bd31ef8c87b0a2 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Thu, 30 Jun 2022 10:00:12 +0200 Subject: [PATCH] Adding debug print. --- src/main.vala | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main.vala b/src/main.vala index 4467ea9..7d19cec 100644 --- a/src/main.vala +++ b/src/main.vala @@ -39,7 +39,8 @@ void activate (Adw.Application app) { var scrolled_window = new Gtk.ScrolledWindow(); var main_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); var window_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); - var parties_container = new Gtk.Box (Gtk.Orientation.VERTICAL, 2); + var parties_container = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 2); + parties_container.margin_bottom = 50; scrolled_window.vexpand = true; Sqlite.Database db = get_db (); load_inital_data (db); @@ -70,16 +71,13 @@ GLib.List fill_parties_container(Sqlite.Database db, var list_inserted_widgets = new GLib.List(); var parties = list_parties (db); parties.foreach ((party) => { - var party_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 10); + var party_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 10); var party_picture = new Gtk.Picture(); var party_name_widget = new Gtk.Label (party.name); var adjustment = new Gtk.Adjustment (party.votes, 0, 50000, 1, 1, 1); var votes_widget = new Gtk.SpinButton (adjustment, 0.1, 0); party_box.hexpand = true; - votes_widget.margin_top = 75; - votes_widget.margin_bottom = 75; party_picture.height_request = 200; - party_picture.width_request = 200; party_picture.can_shrink = true; party_picture.set_filename (party.image); votes_widget.value_changed.connect (() => { @@ -87,8 +85,6 @@ GLib.List fill_parties_container(Sqlite.Database db, party.votes = (uint64) votes_widget.get_value (); modify_party_votes (db_lambda, party); }); - votes_widget.set_halign(Gtk.Align.END); - votes_widget.hexpand = true; party_box.append (party_picture); party_box.append (party_name_widget); party_box.append (votes_widget); @@ -272,6 +268,7 @@ Sqlite.Database get_db () { Sqlite.Database db; string home = GLib.Environment.get_home_dir (); string final_sqlite_path = @"$home/$SQLITE_PATH"; + print final_sqlite_path; int rc = Sqlite.Database.open (final_sqlite_path, out db); apply_migrations (db); if (rc != Sqlite.OK) {