public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer v2 4/7] gui: use basic grid in country/timezone panel
Date: Tue, 21 Nov 2023 16:10:22 +0100	[thread overview]
Message-ID: <20231121151025.233224-5-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20231121151025.233224-1-m.sandoval@proxmox.com>

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 proxinstall | 34 ++++++++++++----------------------
 1 file changed, 12 insertions(+), 22 deletions(-)

diff --git a/proxinstall b/proxinstall
index 69c48b4..bdff22d 100755
--- a/proxinstall
+++ b/proxinstall
@@ -648,12 +648,12 @@ sub update_layout {
 
 my $lastzonecb;
 sub update_zonelist {
-    my ($box, $cc) = @_;
+    my ($grid, $cc) = @_;
 
     my $sel = Proxmox::Install::Config::get_timezone(); # initial default
     if ($lastzonecb) {
 	$sel = $lastzonecb->get_active_text();
-	$box->remove($lastzonecb);
+	$grid->remove($lastzonecb);
     }
 
     my $cb = $lastzonecb = Gtk3::ComboBoxText->new();
@@ -679,7 +679,7 @@ sub update_zonelist {
     $cb->set_active($selected_index || 0);
 
     $cb->show;
-    $box->pack_start($cb, 0, 0, 0);
+    $grid->attach($cb, 1, 1, 1, 1);
 }
 
 sub create_password_view {
@@ -775,10 +775,8 @@ sub create_country_view {
 
     my $locales = $iso_env->{locales};
 
-    my $vbox2 =  Gtk3::Box->new('vertical', 0);
-    $gtk_state->{inbox}->pack_start($vbox2, 1, 0, 0);
-    my $vbox =  Gtk3::Box->new('vertical', 0);
-    $vbox2->pack_start($vbox, 0, 0, 10);
+    my $grid = &$create_basic_grid();
+    $gtk_state->{inbox}->pack_start($grid, 0, 0, 0);
 
     my $w = Gtk3::Entry->new();
     $w->set_size_request(200, -1);
@@ -789,18 +787,16 @@ sub create_country_view {
     $c->set_popup_set_width(1);
     $c->set_inline_completion(1);
 
-    my $hbox2 = Gtk3::Box->new('horizontal', 0);
     my $label = Gtk3::Label->new("Time zone");
     $label->set_size_request(150, -1);
     $label->set_xalign(1.0);
-    $hbox2->pack_start($label, 0, 0, 10);
-    update_zonelist ($hbox2);
+    $grid->attach($label, 0, 1, 1, 1);
+    update_zonelist ($grid);
 
-    my $hbox3 = Gtk3::Box->new('horizontal', 0);
     $label = Gtk3::Label->new("Keyboard Layout");
     $label->set_size_request(150, -1);
     $label->set_xalign(1.0);
-    $hbox3->pack_start($label, 0, 0, 10);
+    $grid->attach($label, 0, 2, 1, 1);
 
     my $kmapcb = Gtk3::ComboBoxText->new();
     $kmapcb->set_size_request (200, -1);
@@ -809,7 +805,7 @@ sub create_country_view {
     }
 
     update_layout($kmapcb);
-    $hbox3->pack_start ($kmapcb, 0, 0, 0);
+    $grid->attach($kmapcb, 1, 2, 1, 1);
 
     $kmapcb->signal_connect ('changed' => sub {
 	my $sel = $kmapcb->get_active_text();
@@ -846,7 +842,7 @@ sub create_country_view {
 	my $text = $entry->get_text;
 
 	if (my $cc = $locales->{countryhash}->{lc($text)}) {
-	    update_zonelist($hbox2, $cc);
+	    update_zonelist($grid, $cc);
 	    my $kmap = $locales->{country}->{$cc}->{kmap} || 'en-us';
 	    update_layout($kmapcb, $kmap);
 	}
@@ -906,17 +902,11 @@ sub create_country_view {
 
     $w->set_completion ($c);
 
-    my $hbox =  Gtk3::Box->new('horizontal', 0);
-
     $label = Gtk3::Label->new("Country");
     $label->set_xalign(1.0);
     $label->set_size_request(150, -1);
-    $hbox->pack_start($label, 0, 0, 10);
-    $hbox->pack_start($w, 0, 0, 0);
-
-    $vbox->pack_start($hbox, 0, 0, 5);
-    $vbox->pack_start($hbox2, 0, 0, 5);
-    $vbox->pack_start($hbox3, 0, 0, 5);
+    $grid->attach($label, 0, 0, 1, 1);
+    $grid->attach($w, 1, 0, 1, 1);
 
     my $country = Proxmox::Install::Config::get_country();
     if ($country && (my $entry = $locales->{country}->{$country})) {
-- 
2.39.2





  parent reply	other threads:[~2023-11-21 15:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 15:10 [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 1/7] gui: move create_basic_grid subroutine definition up Maximiliano Sandoval
2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 2/7] gui: expand ip address Gtk3::Entry Maximiliano Sandoval
2023-12-15 12:06   ` Christoph Heiss
2023-12-15 14:08     ` Maximiliano Sandoval
2023-12-20  9:40       ` Christoph Heiss
2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 3/7] gui: use basic grid in password panel Maximiliano Sandoval
2023-11-21 15:10 ` Maximiliano Sandoval [this message]
2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 5/7] gui: change margins in create_basic_grid Maximiliano Sandoval
2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 6/7] gui: use basic grid in the network panel Maximiliano Sandoval
2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 7/7] gui: remove trailing spaces and colons Maximiliano Sandoval
2023-12-14 13:58 ` [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
2023-12-15  8:50 ` Lukas Wagner
2023-12-15 12:08 ` Christoph Heiss
2024-01-08 10:47 ` Maximiliano Sandoval
2024-02-14 13:32   ` Maximiliano Sandoval
2024-02-22 13:31     ` Maximiliano Sandoval
2024-02-23 13:16 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231121151025.233224-5-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal