public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible
@ 2023-11-21 15:10 Maximiliano Sandoval
  2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 1/7] gui: move create_basic_grid subroutine definition up Maximiliano Sandoval
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: Maximiliano Sandoval @ 2023-11-21 15:10 UTC (permalink / raw)
  To: pve-devel

We replace the use of nested boxes with grids when possible to ensure correct
margins and alignment of widgets.

At the end we also remove trailing spaces and colons from labels preceding an
input widget, e.g. we replace `DNS Server: ` with `DNS Server`.

Differences from v1:
  - Rebased on top of master

Maximiliano Sandoval (7):
  gui: move create_basic_grid subroutine definition up
  gui: expand ip address Gtk3::Entry
  gui: use basic grid in password panel
  gui: use basic grid in country/timezone panel
  gui: change margins in create_basic_grid
  gui: use basic grid in the network panel
  gui: remove trailing spaces and colons

 proxinstall | 153 +++++++++++++++++++++++-----------------------------
 1 file changed, 66 insertions(+), 87 deletions(-)

-- 
2.39.2





^ permalink raw reply	[flat|nested] 18+ messages in thread

* [pve-devel] [PATCH installer v2 1/7] gui: move create_basic_grid subroutine definition up
  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 ` Maximiliano Sandoval
  2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 2/7] gui: expand ip address Gtk3::Entry Maximiliano Sandoval
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Maximiliano Sandoval @ 2023-11-21 15:10 UTC (permalink / raw)
  To: pve-devel

This will be used in future commits to create grids so we need it to be defined.

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

diff --git a/proxinstall b/proxinstall
index 01d4cfe..8f40234 100755
--- a/proxinstall
+++ b/proxinstall
@@ -325,6 +325,21 @@ sub create_cidr_inputs {
 
 my $ipconf_first_view = 1;
 
+my $create_basic_grid = sub {
+    my $grid =  Gtk3::Grid->new();
+    $grid->set_visible(1);
+    $grid->set_column_spacing(10);
+    $grid->set_row_spacing(10);
+    $grid->set_hexpand(1);
+
+    $grid->set_margin_start(10);
+    $grid->set_margin_end(20);
+    $grid->set_margin_top(5);
+    $grid->set_margin_bottom(5);
+
+    return $grid;
+};
+
 sub create_ipconf_view {
 
     cleanup_view();
@@ -941,21 +956,6 @@ my $target_hd_label;
 
 my $hdoption_first_setup = 1;
 
-my $create_basic_grid = sub {
-    my $grid =  Gtk3::Grid->new();
-    $grid->set_visible(1);
-    $grid->set_column_spacing(10);
-    $grid->set_row_spacing(10);
-    $grid->set_hexpand(1);
-
-    $grid->set_margin_start(10);
-    $grid->set_margin_end(20);
-    $grid->set_margin_top(5);
-    $grid->set_margin_bottom(5);
-
-    return $grid;
-};
-
 # takes an array ref of rows with [$label_text, $widget, $suffix_label] array refs as columns
 # $suffix_label is optional
 my $create_label_widget_grid = sub {
-- 
2.39.2





^ permalink raw reply	[flat|nested] 18+ messages in thread

* [pve-devel] [PATCH installer v2 2/7] gui: expand ip address Gtk3::Entry
  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 ` Maximiliano Sandoval
  2023-12-15 12:06   ` Christoph Heiss
  2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 3/7] gui: use basic grid in password panel Maximiliano Sandoval
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: Maximiliano Sandoval @ 2023-11-21 15:10 UTC (permalink / raw)
  To: pve-devel

This accounts for the different layout set in the previous commit.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 proxinstall | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxinstall b/proxinstall
index 8f40234..a5de06c 100755
--- a/proxinstall
+++ b/proxinstall
@@ -308,7 +308,7 @@ sub create_cidr_inputs {
 
     my $ip_el = Gtk3::Entry->new();
     $ip_el->set_width_chars(28);
-    $hbox->pack_start($ip_el, 0, 0, 0);
+    $hbox->pack_start($ip_el, 1, 1, 0);
     $ip_el->set_text($default_ip);
 
     $label = Gtk3::Label->new('/');
-- 
2.39.2





^ permalink raw reply	[flat|nested] 18+ messages in thread

* [pve-devel] [PATCH installer v2 3/7] gui: use basic grid in password panel
  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-11-21 15:10 ` Maximiliano Sandoval
  2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 4/7] gui: use basic grid in country/timezone panel Maximiliano Sandoval
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Maximiliano Sandoval @ 2023-11-21 15:10 UTC (permalink / raw)
  To: pve-devel

The extra 10px margin on the email row was added to account for the
removed line:

    $vbox->pack_start($hbox3, 0, 0, 15);

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

diff --git a/proxinstall b/proxinstall
index a5de06c..69c48b4 100755
--- a/proxinstall
+++ b/proxinstall
@@ -688,47 +688,40 @@ sub create_password_view {
 
     my $password = Proxmox::Install::Config::get_password();
 
-    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 $hbox1 = Gtk3::Box->new('horizontal', 0);
     my $label = Gtk3::Label->new("Password");
     $label->set_size_request(150, -1);
     $label->set_xalign(1.0);
-    $hbox1->pack_start($label, 0, 0, 10);
+    $grid->attach($label, 0, 0, 1, 1);
     my $pwe1 = Gtk3::Entry->new();
     $pwe1->set_visibility(0);
     $pwe1->set_text($password) if $password;
     $pwe1->set_size_request(200, -1);
-    $hbox1->pack_start($pwe1, 0, 0, 0);
+    $grid->attach($pwe1, 1, 0, 1, 1);
 
-    my $hbox2 = Gtk3::Box->new('horizontal', 0);
     $label = Gtk3::Label->new("Confirm");
     $label->set_size_request(150, -1);
     $label->set_xalign(1.0);
-    $hbox2->pack_start($label, 0, 0, 10);
+    $grid->attach($label, 0, 1, 1, 1);
     my $pwe2 = Gtk3::Entry->new();
     $pwe2->set_visibility(0);
     $pwe2->set_text($password) if $password;
     $pwe2->set_size_request(200, -1);
-    $hbox2->pack_start($pwe2, 0, 0, 0);
+    $grid->attach($pwe2, 1, 1, 1, 1);
 
-    my $hbox3 = Gtk3::Box->new('horizontal', 0);
     $label = Gtk3::Label->new("Email");
     $label->set_size_request(150, -1);
     $label->set_xalign(1.0);
-    $hbox3->pack_start($label, 0, 0, 10);
+    $label->set_margin_top(10);
+    $grid->attach($label, 0, 2, 1, 1);
+
     my $eme = Gtk3::Entry->new();
     $eme->set_size_request(200, -1);
     $eme->set_text(Proxmox::Install::Config::get_mailto());
-    $hbox3->pack_start($eme, 0, 0, 0);
-
-
-    $vbox->pack_start($hbox1, 0, 0, 5);
-    $vbox->pack_start($hbox2, 0, 0, 5);
-    $vbox->pack_start($hbox3, 0, 0, 15);
+    $eme->set_margin_top(10);
+    $grid->attach($eme, 1, 2, 1, 1);
 
     $gtk_state->{inbox}->show_all;
 
-- 
2.39.2





^ permalink raw reply	[flat|nested] 18+ messages in thread

* [pve-devel] [PATCH installer v2 4/7] gui: use basic grid in country/timezone panel
  2023-11-21 15:10 [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
                   ` (2 preceding siblings ...)
  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
  2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 5/7] gui: change margins in create_basic_grid Maximiliano Sandoval
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Maximiliano Sandoval @ 2023-11-21 15:10 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply	[flat|nested] 18+ messages in thread

* [pve-devel] [PATCH installer v2 5/7] gui: change margins in create_basic_grid
  2023-11-21 15:10 [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
                   ` (3 preceding siblings ...)
  2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 4/7] gui: use basic grid in country/timezone panel Maximiliano Sandoval
@ 2023-11-21 15:10 ` Maximiliano Sandoval
  2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 6/7] gui: use basic grid in the network panel Maximiliano Sandoval
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Maximiliano Sandoval @ 2023-11-21 15:10 UTC (permalink / raw)
  To: pve-devel

Previously the grids were inserted in a succession of boxes each with
its own set of margins and spacing. We define the margins now
exclusively in the grid and account for previous values.

Note that we match the top and bottom margins of the 'Target Harddisk'
panel which does not need to use a grid.

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

diff --git a/proxinstall b/proxinstall
index bdff22d..87e81fd 100755
--- a/proxinstall
+++ b/proxinstall
@@ -332,10 +332,10 @@ my $create_basic_grid = sub {
     $grid->set_row_spacing(10);
     $grid->set_hexpand(1);
 
-    $grid->set_margin_start(10);
+    $grid->set_margin_start(20);
     $grid->set_margin_end(20);
-    $grid->set_margin_top(5);
-    $grid->set_margin_bottom(5);
+    $grid->set_margin_top(10);
+    $grid->set_margin_bottom(10);
 
     return $grid;
 };
-- 
2.39.2





^ permalink raw reply	[flat|nested] 18+ messages in thread

* [pve-devel] [PATCH installer v2 6/7] gui: use basic grid in the network panel
  2023-11-21 15:10 [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
                   ` (4 preceding siblings ...)
  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 ` Maximiliano Sandoval
  2023-11-21 15:10 ` [pve-devel] [PATCH installer v2 7/7] gui: remove trailing spaces and colons Maximiliano Sandoval
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Maximiliano Sandoval @ 2023-11-21 15:10 UTC (permalink / raw)
  To: pve-devel

Using boxes causes the labels to not align correctly in certain
circumstances. In the following commits we replace the use of boxes with
grids and set the margins and spacing directly on the respective grid.

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

diff --git a/proxinstall b/proxinstall
index 87e81fd..9551a89 100755
--- a/proxinstall
+++ b/proxinstall
@@ -281,18 +281,14 @@ sub check_number {
 sub create_text_input {
     my ($default, $text) = @_;
 
-    my $hbox = Gtk3::Box->new('horizontal', 0);
-
     my $label = Gtk3::Label->new($text);
     $label->set_size_request(150, -1);
     $label->set_xalign(1.0);
-    $hbox->pack_start($label, 0, 0, 10);
     my $e1 = Gtk3::Entry->new();
     $e1->set_width_chars(35);
-    $hbox->pack_start($e1, 0, 0, 0);
     $e1->set_text($default);
 
-    return ($hbox, $e1);
+    return ($label, $e1);
 }
 sub create_cidr_inputs {
     my ($cidr) = @_;
@@ -304,23 +300,22 @@ sub create_cidr_inputs {
     my $label = Gtk3::Label->new('IP Address (CIDR)');
     $label->set_size_request(150, -1);
     $label->set_xalign(1.0);
-    $hbox->pack_start($label, 0, 0, 10);
 
     my $ip_el = Gtk3::Entry->new();
     $ip_el->set_width_chars(28);
     $hbox->pack_start($ip_el, 1, 1, 0);
     $ip_el->set_text($default_ip);
 
-    $label = Gtk3::Label->new('/');
-    $label->set_size_request(10, -1);
-    $hbox->pack_start($label, 0, 0, 2);
+    my $dash_label = Gtk3::Label->new('/');
+    $dash_label->set_size_request(10, -1);
+    $hbox->pack_start($dash_label, 0, 0, 2);
 
     my $cidr_el = Gtk3::Entry->new();
     $cidr_el->set_width_chars(3);
     $hbox->pack_start($cidr_el, 0, 0, 0);
     $cidr_el->set_text($default_mask);
 
-    return ($hbox, $ip_el, $cidr_el);
+    return ($label, $hbox, $ip_el, $cidr_el);
 }
 
 my $ipconf_first_view = 1;
@@ -345,16 +340,15 @@ sub create_ipconf_view {
     cleanup_view();
     Proxmox::UI::display_html('ipconf.htm');
 
-    my $vcontainer = Gtk3::Box->new('vertical', 0);
-    $gtk_state->{inbox}->pack_start($vcontainer, 1, 0, 0);
-    my $hcontainer =  Gtk3::Box->new('horizontal', 0);
-    $vcontainer->pack_start($hcontainer, 0, 0, 10);
-    my $vbox =  Gtk3::Box->new('vertical', 0);
-    $hcontainer->add($vbox);
+    my $grid = &$create_basic_grid();
+    $grid->set_row_spacing(10);
+    $grid->set_column_spacing(10);
+
+    $gtk_state->{inbox}->pack_start($grid, 0, 0, 0);
 
     my $cidr = Proxmox::Install::Config::get_cidr() // '192.168.100.2/24';
 
-    my ($cidr_box, $ipconf_entry_addr, $ipconf_entry_mask) = create_cidr_inputs($cidr);
+    my ($cidr_label, $cidr_box, $ipconf_entry_addr, $ipconf_entry_mask) = create_cidr_inputs($cidr);
 
     my $device_model = Gtk3::ListStore->new('Glib::String', 'Glib::String');
     my $device_cb = Gtk3::ComboBox->new_with_model($device_model);
@@ -422,37 +416,39 @@ sub create_ipconf_view {
 	$device_cb->set_active(0);
     }
 
-    my $devicebox = Gtk3::Box->new('horizontal', 0);
     my $label = Gtk3::Label->new("Management Interface:");
     $label->set_size_request(150, -1);
     $label->set_xalign(1.0);
-    $devicebox->pack_start($label, 0, 0, 10);
-    $devicebox->pack_start($device_cb, 0, 0, 0);
 
-    $vbox->pack_start($devicebox, 0, 0, 2);
+    $grid->attach($label, 0, 0, 1, 1);
+    $grid->attach($device_cb, 1, 0, 1, 1);
 
     my $fqdn = Proxmox::Install::Config::get_fqdn();
     my $hostname = $run_env->{network}->{hostname} || $iso_env->{product};
     my $domain = $ipconf->{domain} || "example.invalid";
     $fqdn //= "$hostname.$domain";
 
-    my ($hostbox, $hostentry) = create_text_input($fqdn, 'Hostname (FQDN):');
-    $vbox->pack_start($hostbox, 0, 0, 2);
+    my ($host_label, $hostentry) = create_text_input($fqdn, 'Hostname (FQDN):');
+    $grid->attach($host_label, 0, 1, 1, 1);
+    $grid->attach($hostentry, 1, 1, 1, 1);
 
-    $vbox->pack_start($cidr_box, 0, 0, 2);
+    $grid->attach($cidr_label, 0, 2, 1, 1);
+    $grid->attach($cidr_box, 1, 2, 1, 1);
 
     my $cfg_gateway = Proxmox::Install::Config::get_gateway();
     my $gateway = $cfg_gateway // $ipconf->{gateway} || '192.168.100.1';
 
-    my ($gwbox, $ipconf_entry_gw) = create_text_input($gateway, 'Gateway:');
-    $vbox->pack_start($gwbox, 0, 0, 2);
+    my ($gw_label, $ipconf_entry_gw) = create_text_input($gateway, 'Gateway:');
+    $grid->attach($gw_label, 0, 3, 1, 1);
+    $grid->attach($ipconf_entry_gw, 1, 3, 1, 1);
 
     my $cfg_dns = Proxmox::Install::Config::get_dns();
     my $dnsserver = $cfg_dns // $ipconf->{dnsserver} || $gateway;
 
-    my ($dnsbox, $ipconf_entry_dns) = create_text_input($dnsserver, 'DNS Server:');
+    my ($dns_label, $ipconf_entry_dns) = create_text_input($dnsserver, 'DNS Server:');
 
-    $vbox->pack_start($dnsbox, 0, 0, 0);
+    $grid->attach($dns_label, 0, 4, 1, 1);
+    $grid->attach($ipconf_entry_dns, 1, 4, 1, 1);
 
     $gtk_state->{inbox}->show_all;
     set_next(undef, sub {
-- 
2.39.2





^ permalink raw reply	[flat|nested] 18+ messages in thread

* [pve-devel] [PATCH installer v2 7/7] gui: remove trailing spaces and colons
  2023-11-21 15:10 [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
                   ` (5 preceding siblings ...)
  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 ` Maximiliano Sandoval
  2023-12-14 13:58 ` [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Maximiliano Sandoval @ 2023-11-21 15:10 UTC (permalink / raw)
  To: pve-devel

For consistency sake, all colons and trailing spaces in labels that were
followed with an entry were removed, this matches other panels such as
the password and country/timezone panels.

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

diff --git a/proxinstall b/proxinstall
index 9551a89..015cf7b 100755
--- a/proxinstall
+++ b/proxinstall
@@ -416,7 +416,7 @@ sub create_ipconf_view {
 	$device_cb->set_active(0);
     }
 
-    my $label = Gtk3::Label->new("Management Interface:");
+    my $label = Gtk3::Label->new("Management Interface");
     $label->set_size_request(150, -1);
     $label->set_xalign(1.0);
 
@@ -428,7 +428,7 @@ sub create_ipconf_view {
     my $domain = $ipconf->{domain} || "example.invalid";
     $fqdn //= "$hostname.$domain";
 
-    my ($host_label, $hostentry) = create_text_input($fqdn, 'Hostname (FQDN):');
+    my ($host_label, $hostentry) = create_text_input($fqdn, 'Hostname (FQDN)');
     $grid->attach($host_label, 0, 1, 1, 1);
     $grid->attach($hostentry, 1, 1, 1, 1);
 
@@ -438,14 +438,14 @@ sub create_ipconf_view {
     my $cfg_gateway = Proxmox::Install::Config::get_gateway();
     my $gateway = $cfg_gateway // $ipconf->{gateway} || '192.168.100.1';
 
-    my ($gw_label, $ipconf_entry_gw) = create_text_input($gateway, 'Gateway:');
+    my ($gw_label, $ipconf_entry_gw) = create_text_input($gateway, 'Gateway');
     $grid->attach($gw_label, 0, 3, 1, 1);
     $grid->attach($ipconf_entry_gw, 1, 3, 1, 1);
 
     my $cfg_dns = Proxmox::Install::Config::get_dns();
     my $dnsserver = $cfg_dns // $ipconf->{dnsserver} || $gateway;
 
-    my ($dns_label, $ipconf_entry_dns) = create_text_input($dnsserver, 'DNS Server:');
+    my ($dns_label, $ipconf_entry_dns) = create_text_input($dnsserver, 'DNS Server');
 
     $grid->attach($dns_label, 0, 4, 1, 1);
     $grid->attach($ipconf_entry_dns, 1, 4, 1, 1);
@@ -1332,7 +1332,7 @@ sub create_hdoption_view {
 	    $target_hd_label->set_text("Target: $filesys ");
 	    $options_stack->set_visible_child_name("raiddisk");
 	} else {
-	    $target_hd_label->set_text("Target Harddisk: ");
+	    $target_hd_label->set_text("Target Harddisk");
 	}
 
 	if ($raid) {
@@ -1438,7 +1438,7 @@ sub create_hdsel_view {
 	Proxmox::Install::Config::set_target_hd($devname);
     }
 
-    $target_hd_label = Gtk3::Label->new("Target Harddisk: ");
+    $target_hd_label = Gtk3::Label->new("Target Harddisk");
     $hbox->pack_start($target_hd_label, 0, 0, 0);
 
     $target_hd_combo = Gtk3::ComboBoxText->new();
-- 
2.39.2





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible
  2023-11-21 15:10 [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
                   ` (6 preceding siblings ...)
  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 ` Maximiliano Sandoval
  2023-12-15  8:50 ` Lukas Wagner
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Maximiliano Sandoval @ 2023-12-14 13:58 UTC (permalink / raw)
  To: Maximiliano Sandoval; +Cc: pve-devel


Bump :)

--
Maximiliano




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible
  2023-11-21 15:10 [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
                   ` (7 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Lukas Wagner @ 2023-12-15  8:50 UTC (permalink / raw)
  To: Proxmox VE development discussion, Maximiliano Sandoval

Hi,

On 11/21/23 16:10, Maximiliano Sandoval wrote:
> We replace the use of nested boxes with grids when possible to ensure correct
> margins and alignment of widgets.
> 
> At the end we also remove trailing spaces and colons from labels preceding an
> input widget, e.g. we replace `DNS Server: ` with `DNS Server`.
> 

Tested these changes against the latest master branch. I did not notice 
any regressions.

Consider this:

Tested-by: Lukas Wagner <l.wagner@proxmox.com>

-- 
- Lukas




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [pve-devel] [PATCH installer v2 2/7] gui: expand ip address Gtk3::Entry
  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
  0 siblings, 1 reply; 18+ messages in thread
From: Christoph Heiss @ 2023-12-15 12:06 UTC (permalink / raw)
  To: Maximiliano Sandoval; +Cc: pve-devel


On Tue, Nov 21, 2023 at 04:10:20PM +0100, Maximiliano Sandoval wrote:
>
> This accounts for the different layout set in the previous commit.

What commit is meant here exactly? The previous patch in this series
(aka. the first) does not change any layout as it's a simple code move,
right?

>
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> ---
>  proxinstall | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/proxinstall b/proxinstall
> index 8f40234..a5de06c 100755
> --- a/proxinstall
> +++ b/proxinstall
> @@ -308,7 +308,7 @@ sub create_cidr_inputs {
>
>      my $ip_el = Gtk3::Entry->new();
>      $ip_el->set_width_chars(28);
> -    $hbox->pack_start($ip_el, 0, 0, 0);
> +    $hbox->pack_start($ip_el, 1, 1, 0);
>      $ip_el->set_text($default_ip);
>
>      $label = Gtk3::Label->new('/');
> --
> 2.39.2
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible
  2023-11-21 15:10 [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
                   ` (8 preceding siblings ...)
  2023-12-15  8:50 ` Lukas Wagner
@ 2023-12-15 12:08 ` Christoph Heiss
  2024-01-08 10:47 ` Maximiliano Sandoval
  2024-02-23 13:16 ` [pve-devel] applied: " Thomas Lamprecht
  11 siblings, 0 replies; 18+ messages in thread
From: Christoph Heiss @ 2023-12-15 12:08 UTC (permalink / raw)
  To: Maximiliano Sandoval; +Cc: pve-devel


LGTM. Tested this using latest master + ISO base. Keyboard shortcuts
also work as before.

Please consider it:

Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>

On Tue, Nov 21, 2023 at 04:10:18PM +0100, Maximiliano Sandoval wrote:
>
> We replace the use of nested boxes with grids when possible to ensure correct
> margins and alignment of widgets.
>
> At the end we also remove trailing spaces and colons from labels preceding an
> input widget, e.g. we replace `DNS Server: ` with `DNS Server`.
>
> Differences from v1:
>   - Rebased on top of master
>
> Maximiliano Sandoval (7):
>   gui: move create_basic_grid subroutine definition up
>   gui: expand ip address Gtk3::Entry
>   gui: use basic grid in password panel
>   gui: use basic grid in country/timezone panel
>   gui: change margins in create_basic_grid
>   gui: use basic grid in the network panel
>   gui: remove trailing spaces and colons
>
>  proxinstall | 153 +++++++++++++++++++++++-----------------------------
>  1 file changed, 66 insertions(+), 87 deletions(-)
>
> --
> 2.39.2
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [pve-devel] [PATCH installer v2 2/7] gui: expand ip address Gtk3::Entry
  2023-12-15 12:06   ` Christoph Heiss
@ 2023-12-15 14:08     ` Maximiliano Sandoval
  2023-12-20  9:40       ` Christoph Heiss
  0 siblings, 1 reply; 18+ messages in thread
From: Maximiliano Sandoval @ 2023-12-15 14:08 UTC (permalink / raw)
  To: Christoph Heiss; +Cc: pve-devel


Christoph Heiss <c.heiss@proxmox.com> writes:

> On Tue, Nov 21, 2023 at 04:10:20PM +0100, Maximiliano Sandoval wrote:
>>
>> This accounts for the different layout set in the previous commit.
>
> What commit is meant here exactly? The previous patch in this series
> (aka. the first) does not change any layout as it's a simple code move,
> right?
>

Good catch, in v1 this commit went directly after the commit

gui: use basic grid in the network panel

which contains the mentioned changes. Should this require a v3?

--
Maximiliano




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [pve-devel] [PATCH installer v2 2/7] gui: expand ip address Gtk3::Entry
  2023-12-15 14:08     ` Maximiliano Sandoval
@ 2023-12-20  9:40       ` Christoph Heiss
  0 siblings, 0 replies; 18+ messages in thread
From: Christoph Heiss @ 2023-12-20  9:40 UTC (permalink / raw)
  To: Maximiliano Sandoval; +Cc: pve-devel


On Fri, Dec 15, 2023 at 03:08:48PM +0100, Maximiliano Sandoval wrote:
>
>
> Christoph Heiss <c.heiss@proxmox.com> writes:
>
> > On Tue, Nov 21, 2023 at 04:10:20PM +0100, Maximiliano Sandoval wrote:
> >>
> >> This accounts for the different layout set in the previous commit.
> >
> > What commit is meant here exactly? The previous patch in this series
> > (aka. the first) does not change any layout as it's a simple code move,
> > right?
> >
>
> Good catch, in v1 this commit went directly after the commit
>
> gui: use basic grid in the network panel

Makes sense then, I figured that.

>
> which contains the mentioned changes. Should this require a v3?

From my side, no, if nothing else comes up. If really needed it could be
fixed up when committing at the very latest.

>
> --
> Maximiliano




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible
  2023-11-21 15:10 [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
                   ` (9 preceding siblings ...)
  2023-12-15 12:08 ` Christoph Heiss
@ 2024-01-08 10:47 ` Maximiliano Sandoval
  2024-02-14 13:32   ` Maximiliano Sandoval
  2024-02-23 13:16 ` [pve-devel] applied: " Thomas Lamprecht
  11 siblings, 1 reply; 18+ messages in thread
From: Maximiliano Sandoval @ 2024-01-08 10:47 UTC (permalink / raw)
  To: Maximiliano Sandoval; +Cc: pve-devel

ping

Maximiliano Sandoval <m.sandoval@proxmox.com> writes:

> We replace the use of nested boxes with grids when possible to ensure correct
> margins and alignment of widgets.
>
> At the end we also remove trailing spaces and colons from labels preceding an
> input widget, e.g. we replace `DNS Server: ` with `DNS Server`.
>
> Differences from v1:
>   - Rebased on top of master
>
> Maximiliano Sandoval (7):
>   gui: move create_basic_grid subroutine definition up
>   gui: expand ip address Gtk3::Entry
>   gui: use basic grid in password panel
>   gui: use basic grid in country/timezone panel
>   gui: change margins in create_basic_grid
>   gui: use basic grid in the network panel
>   gui: remove trailing spaces and colons
>
>  proxinstall | 153 +++++++++++++++++++++++-----------------------------
>  1 file changed, 66 insertions(+), 87 deletions(-)


--
Maximiliano




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible
  2024-01-08 10:47 ` Maximiliano Sandoval
@ 2024-02-14 13:32   ` Maximiliano Sandoval
  2024-02-22 13:31     ` Maximiliano Sandoval
  0 siblings, 1 reply; 18+ messages in thread
From: Maximiliano Sandoval @ 2024-02-14 13:32 UTC (permalink / raw)
  To: Maximiliano Sandoval; +Cc: pve-devel


ping 👻

Maximiliano Sandoval <m.sandoval@proxmox.com> writes:

> ping
>
> Maximiliano Sandoval <m.sandoval@proxmox.com> writes:

--
Maximiliano




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible
  2024-02-14 13:32   ` Maximiliano Sandoval
@ 2024-02-22 13:31     ` Maximiliano Sandoval
  0 siblings, 0 replies; 18+ messages in thread
From: Maximiliano Sandoval @ 2024-02-22 13:31 UTC (permalink / raw)
  To: Maximiliano Sandoval; +Cc: pve-devel


ping, still applies.

Maximiliano Sandoval <m.sandoval@proxmox.com> writes:

> ping 👻
>
> Maximiliano Sandoval <m.sandoval@proxmox.com> writes:
>
>> ping
>>
>> Maximiliano Sandoval <m.sandoval@proxmox.com> writes:


--
Maximiliano




^ permalink raw reply	[flat|nested] 18+ messages in thread

* [pve-devel] applied: [PATCH installer v2 0/7] gui: use gtk grids when possible
  2023-11-21 15:10 [pve-devel] [PATCH installer v2 0/7] gui: use gtk grids when possible Maximiliano Sandoval
                   ` (10 preceding siblings ...)
  2024-01-08 10:47 ` Maximiliano Sandoval
@ 2024-02-23 13:16 ` Thomas Lamprecht
  11 siblings, 0 replies; 18+ messages in thread
From: Thomas Lamprecht @ 2024-02-23 13:16 UTC (permalink / raw)
  To: Proxmox VE development discussion, Maximiliano Sandoval

Am 21/11/2023 um 16:10 schrieb Maximiliano Sandoval:
> We replace the use of nested boxes with grids when possible to ensure correct
> margins and alignment of widgets.
> 
> At the end we also remove trailing spaces and colons from labels preceding an
> input widget, e.g. we replace `DNS Server: ` with `DNS Server`.
> 
> Differences from v1:
>   - Rebased on top of master
> 
> Maximiliano Sandoval (7):
>   gui: move create_basic_grid subroutine definition up
>   gui: expand ip address Gtk3::Entry
>   gui: use basic grid in password panel
>   gui: use basic grid in country/timezone panel
>   gui: change margins in create_basic_grid
>   gui: use basic grid in the network panel
>   gui: remove trailing spaces and colons
> 
>  proxinstall | 153 +++++++++++++++++++++++-----------------------------
>  1 file changed, 66 insertions(+), 87 deletions(-)
> 


applied series, with Lukas' T-b and Christoph's R-b and T-b, thanks!




^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-02-23 13:16 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [pve-devel] [PATCH installer v2 4/7] gui: use basic grid in country/timezone panel Maximiliano Sandoval
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

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