diff --git a/data/installer.metainfo.xml.in b/data/installer.metainfo.xml.in
index 8b4a569f6..590b3e27c 100644
--- a/data/installer.metainfo.xml.in
+++ b/data/installer.metainfo.xml.in
@@ -65,6 +65,7 @@
Screen Reader ignores each view’s title text
+ Second step of VariantWidget not focused
diff --git a/po/POTFILES b/po/POTFILES
index f8584d027..c36219ab9 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -23,6 +23,6 @@ src/Widgets/DecryptMenu.vala
src/Widgets/DiskBar.vala
src/Widgets/DiskGrid.vala
src/Widgets/InstallTypeGrid.vala
-src/Widgets/PartitionBar.vala
+src/Widgets/PartitionBlock.vala
src/Widgets/PartitionMenu.vala
src/Widgets/VariantWidget.vala
diff --git a/src/Views/AbstractInstallerView.vala b/src/Views/AbstractInstallerView.vala
index 7ffb33f9e..3fc30fe14 100644
--- a/src/Views/AbstractInstallerView.vala
+++ b/src/Views/AbstractInstallerView.vala
@@ -25,13 +25,17 @@ public abstract class AbstractInstallerView : Adw.NavigationPage {
content_area = new Gtk.Box (VERTICAL, 24);
+ var content_clamp = new Adw.Clamp () {
+ child = content_area
+ };
+
var box = new Gtk.Box (HORIZONTAL, 12) {
homogeneous = true,
hexpand = true,
vexpand = true,
};
box.append (title_area);
- box.append (content_area);
+ box.append (content_clamp);
action_box_end = new Gtk.Box (HORIZONTAL, 6) {
halign = END,
diff --git a/src/Views/CheckView.vala b/src/Views/CheckView.vala
index 9f2ac71af..06d26a501 100644
--- a/src/Views/CheckView.vala
+++ b/src/Views/CheckView.vala
@@ -182,15 +182,12 @@ public class Installer.CheckView : AbstractInstallerView {
};
var title_label = new Gtk.Label (title) {
- hexpand = true,
- max_width_chars = 1,
wrap = true,
xalign = 0
};
title_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);
var description_label = new Gtk.Label (description) {
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
use_markup = true,
wrap = true,
xalign = 0
diff --git a/src/Views/DiskView.vala b/src/Views/DiskView.vala
index 6d92fa70a..4ad9bc1ee 100644
--- a/src/Views/DiskView.vala
+++ b/src/Views/DiskView.vala
@@ -50,7 +50,6 @@ public class Installer.DiskView : AbstractInstallerView {
var install_desc_label = new Gtk.Label (
_("This will erase all data on the selected drive. If you have not backed your data up, you can cancel the installation and use Demo Mode.")
) {
- max_width_chars = 45,
wrap = true,
xalign = 0
};
@@ -70,7 +69,6 @@ public class Installer.DiskView : AbstractInstallerView {
load_spinner.start ();
var load_label = new Gtk.Label (_("Getting the current configuration…")) {
- max_width_chars = 45,
wrap = true
};
load_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);
diff --git a/src/Views/DriversView.vala b/src/Views/DriversView.vala
index c5cee996f..07f9bb3b7 100644
--- a/src/Views/DriversView.vala
+++ b/src/Views/DriversView.vala
@@ -28,7 +28,6 @@
var title_label = new Gtk.Label (title);
var description_label = new Gtk.Label (_("Broadcom® Wi-Fi adapters, NVIDIA® graphics, and some virtual machines may not function properly without additional drivers. Most devices do not require additional drivers.")) {
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
diff --git a/src/Views/EncryptView.vala b/src/Views/EncryptView.vala
index 9694527c5..cc6e8af06 100644
--- a/src/Views/EncryptView.vala
+++ b/src/Views/EncryptView.vala
@@ -52,8 +52,6 @@ public class EncryptView : AbstractInstallerView {
var title_label = new Gtk.Label (title);
var details_label = new Gtk.Label (_("Encrypt this device's drive if required for added protection, but be sure you understand:")) {
- hexpand = true,
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
@@ -88,9 +86,7 @@ public class EncryptView : AbstractInstallerView {
var description = new Gtk.Label (
_("If you forget the encryption password, you will not be able to recover data. This is a unique password for this device, not the password for your user account.")
) {
- hexpand = true,
margin_bottom = 12,
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
use_markup = true,
wrap = true,
xalign = 0
@@ -278,9 +274,8 @@ public class EncryptView : AbstractInstallerView {
construct {
label_widget = new Gtk.Label (label) {
- halign = END,
+ hexpand = true,
justify = RIGHT,
- max_width_chars = 55,
use_markup = true,
wrap = true,
xalign = 1
diff --git a/src/Views/ErrorView.vala b/src/Views/ErrorView.vala
index bffdfc6bf..b66bf2fcd 100644
--- a/src/Views/ErrorView.vala
+++ b/src/Views/ErrorView.vala
@@ -34,7 +34,6 @@ public class ErrorView : AbstractInstallerView {
var description_label = new Gtk.Label (_("Installing %s failed, possibly due to a hardware error. The device may not restart properly. You can try the following:").printf (Utils.get_pretty_name ())) {
margin_bottom = 12,
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
@@ -45,7 +44,6 @@ public class ErrorView : AbstractInstallerView {
var try_label = new Gtk.Label (_("Try the installation again")) {
hexpand = true,
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
@@ -55,7 +53,6 @@ public class ErrorView : AbstractInstallerView {
};
var launch_label = new Gtk.Label (_("Use Demo Mode and try to manually recover")) {
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
@@ -65,7 +62,6 @@ public class ErrorView : AbstractInstallerView {
};
var restart_label = new Gtk.Label (_("Restart the device and boot from another drive")) {
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
diff --git a/src/Views/PartitioningView.vala b/src/Views/PartitioningView.vala
index 3b6b8d0d8..09a2e76f5 100644
--- a/src/Views/PartitioningView.vala
+++ b/src/Views/PartitioningView.vala
@@ -159,7 +159,11 @@ public class Installer.PartitioningView : AbstractInstallerView {
InstallerDaemon.DiskInfo? disks = null;
try {
- disks = yield Daemon.get_default ().get_disks (true);
+ if (!Installer.App.test_mode) {
+ disks = yield Daemon.get_default ().get_disks (true);
+ } else {
+ disks = get_test_diskinfo ();
+ }
} catch (Error e) {
critical ("Unable to get disks: %s", e.message);
load_stack.set_visible_child_name ("disk");
@@ -172,9 +176,9 @@ public class Installer.PartitioningView : AbstractInstallerView {
unowned string path = disk.device_path;
- var partitions = new Gee.ArrayList ();
+ var partitions = new Gee.ArrayList ();
foreach (unowned InstallerDaemon.Partition part in disk.partitions) {
- var partition = new PartitionBar (part, path, sector_size, false, this.set_mount, this.unset_mount, this.mount_is_set);
+ var partition = new PartitionBlock (part, path, sector_size, false, this.set_mount, this.unset_mount, this.mount_is_set);
partition.decrypted.connect (on_partition_decrypted);
partitions.add (partition);
}
@@ -225,9 +229,9 @@ public class Installer.PartitioningView : AbstractInstallerView {
unowned string path = disk.device_path;
- var partitions = new Gee.ArrayList ();
+ var partitions = new Gee.ArrayList ();
foreach (unowned InstallerDaemon.Partition part in disk.partitions) {
- var partition = new PartitionBar (part, path, sector_size, true, this.set_mount, this.unset_mount, this.mount_is_set);
+ var partition = new PartitionBlock (part, path, sector_size, true, this.set_mount, this.unset_mount, this.mount_is_set);
partition.decrypted.connect (on_partition_decrypted);
partitions.add (partition);
}
@@ -343,4 +347,54 @@ public class Installer.PartitioningView : AbstractInstallerView {
array[index] = array[array.size - 1];
return array.remove_at (array.size - 1);
}
+
+ private InstallerDaemon.DiskInfo get_test_diskinfo () {
+ InstallerDaemon.Disk[] physical_disks = {};
+ InstallerDaemon.Disk[] logical_disks = {};
+
+ InstallerDaemon.Partition[] partitions = {};
+
+ var usage_1 = Distinst.PartitionUsage () {
+ tag = 1,
+ value = 30312
+ };
+
+ partitions += InstallerDaemon.Partition () {
+ device_path = "/dev/nvme0n1p1",
+ filesystem = InstallerDaemon.FileSystem.FAT32,
+ start_sector = 4096,
+ end_sector = 542966,
+ sectors_used = usage_1,
+ current_lvm_volume_group = ""
+ };
+
+ var usage_2 = Distinst.PartitionUsage () {
+ tag = 0,
+ value = 0
+ };
+
+ partitions += InstallerDaemon.Partition () {
+ device_path = "/dev/nvme0n1p2",
+ filesystem = InstallerDaemon.FileSystem.LVM,
+ start_sector = 542968,
+ end_sector = 976769070,
+ sectors_used = usage_2,
+ current_lvm_volume_group = "data"
+ };
+
+ physical_disks += InstallerDaemon.Disk () {
+ name = "Samsung SSD 970 EVO 500GB",
+ device_path = "/dev/nvme0n1",
+ sectors = 976773168,
+ sector_size = 512,
+ rotational = false,
+ removable = false,
+ partitions = partitions
+ };
+
+ return InstallerDaemon.DiskInfo () {
+ physical_disks = physical_disks,
+ logical_disks = logical_disks
+ };
+ }
}
diff --git a/src/Views/SuccessView.vala b/src/Views/SuccessView.vala
index 8384ef50b..32d9b9770 100644
--- a/src/Views/SuccessView.vala
+++ b/src/Views/SuccessView.vala
@@ -30,15 +30,12 @@ public class SuccessView : AbstractInstallerView {
var title_label = new Gtk.Label (title);
var primary_label = new Gtk.Label (_("%s has been installed").printf (Utils.get_pretty_name ())) {
- hexpand = true,
- max_width_chars = 1,
wrap = true,
xalign = 0
};
primary_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);
secondary_label = new Gtk.Label (null) {
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
use_markup = true,
wrap = true,
xalign = 0
diff --git a/src/Widgets/DecryptMenu.vala b/src/Widgets/DecryptMenu.vala
index 43d3bf41d..5eb1b1ff9 100644
--- a/src/Widgets/DecryptMenu.vala
+++ b/src/Widgets/DecryptMenu.vala
@@ -69,7 +69,6 @@ public class Installer.DecryptMenu: Gtk.Popover {
var secondary_label = new Gtk.Label (_("Enter the partition's encryption password and set a device name for the decrypted partition."));
secondary_label.halign = Gtk.Align.START;
- secondary_label.max_width_chars = 50;
secondary_label.selectable = true;
secondary_label.wrap = true;
secondary_label.xalign = 0;
diff --git a/src/Widgets/DescriptionRow.vala b/src/Widgets/DescriptionRow.vala
index 057189132..a9ace185e 100644
--- a/src/Widgets/DescriptionRow.vala
+++ b/src/Widgets/DescriptionRow.vala
@@ -26,7 +26,6 @@ public class DescriptionRow : Gtk.Box {
var description_label = new Gtk.Label (description) {
hexpand = true,
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
use_markup = true,
wrap = true,
xalign = 0
diff --git a/src/Widgets/DiskBar.vala b/src/Widgets/DiskBar.vala
index 7ba32b902..97c3edfd2 100644
--- a/src/Widgets/DiskBar.vala
+++ b/src/Widgets/DiskBar.vala
@@ -9,9 +9,9 @@ public class Installer.DiskBar: Gtk.Box {
public string disk_name { get; construct; }
public string disk_path { get; construct; }
public uint64 size { get; construct; }
- public Gee.ArrayList partitions { get; construct; }
+ public Gee.ArrayList partitions { get; construct; }
- public DiskBar (string disk_name, string disk_path, uint64 size, Gee.ArrayList partitions) {
+ public DiskBar (string disk_name, string disk_path, uint64 size, Gee.ArrayList partitions) {
Object (
disk_name: disk_name,
disk_path: disk_path,
@@ -35,18 +35,18 @@ public class Installer.DiskBar: Gtk.Box {
halign = START
};
- foreach (PartitionBar partition_bar in partitions) {
- var legend = new Legend (partition_bar.partition);
+ foreach (PartitionBlock partition_block in partitions) {
+ var legend = new Legend (partition_block.partition);
legend_box.append (legend);
var click_gesture = new Gtk.GestureClick ();
- click_gesture.released.connect (partition_bar.menu.popup);
+ click_gesture.released.connect (partition_block.menu.popup);
legend.add_controller (click_gesture);
}
uint64 used = 0;
- foreach (PartitionBar partition in partitions) {
+ foreach (PartitionBlock partition in partitions) {
used += partition.get_partition_size ();
}
@@ -68,10 +68,10 @@ public class Installer.DiskBar: Gtk.Box {
}
private class PartitionContainer : Gtk.Widget {
- public Gee.ArrayList partitions { get; construct; }
+ public Gee.ArrayList partitions { get; construct; }
public uint64 size { get; construct; }
- public PartitionContainer (uint64 size, Gee.ArrayList partitions) {
+ public PartitionContainer (uint64 size, Gee.ArrayList partitions) {
Object (
partitions: partitions,
size: size
diff --git a/src/Widgets/InstallTypeGrid.vala b/src/Widgets/InstallTypeGrid.vala
index da04f8635..b82bfbade 100644
--- a/src/Widgets/InstallTypeGrid.vala
+++ b/src/Widgets/InstallTypeGrid.vala
@@ -44,7 +44,6 @@ public class Installer.InstallTypeButton : Gtk.CheckButton {
title_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);
var subtitle_label = new Gtk.Label (subtitle) {
- max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
diff --git a/src/Widgets/PartitionBar.vala b/src/Widgets/PartitionBlock.vala
similarity index 92%
rename from src/Widgets/PartitionBar.vala
rename to src/Widgets/PartitionBlock.vala
index d74265b46..038edc933 100644
--- a/src/Widgets/PartitionBar.vala
+++ b/src/Widgets/PartitionBlock.vala
@@ -5,7 +5,7 @@
* Authored by: Michael Aaron Murphy
*/
-public class Installer.PartitionBar : Gtk.Box {
+public class Installer.PartitionBlock : Adw.Bin {
public signal void decrypted (InstallerDaemon.LuksCredentials credential);
public Icon? icon { get; set; default = null; }
@@ -16,7 +16,7 @@ public class Installer.PartitionBar : Gtk.Box {
public Gtk.Popover menu { get; private set; }
- public PartitionBar (
+ public PartitionBlock (
InstallerDaemon.Partition partition,
string parent_path,
uint64 sector_size,
@@ -53,13 +53,11 @@ public class Installer.PartitionBar : Gtk.Box {
construct {
var image = new Gtk.Image () {
- hexpand = true,
halign = END,
valign = END
};
- append (image);
- hexpand = true;
+ child = image;
tooltip_text = partition.device_path;
add_css_class (partition.filesystem.to_string ());
diff --git a/src/Widgets/PartitionMenu.vala b/src/Widgets/PartitionMenu.vala
index 4fa4b446d..b10a319ec 100644
--- a/src/Widgets/PartitionMenu.vala
+++ b/src/Widgets/PartitionMenu.vala
@@ -38,11 +38,11 @@ public class Installer.PartitionMenu : Gtk.Popover {
private Gtk.Label custom_label;
private Gtk.Label type_label;
// A reference to the parent which owns this menu.
- private PartitionBar partition_bar;
+ private PartitionBlock partition_bar;
public PartitionMenu (string path, string parent, InstallerDaemon.FileSystem fs,
bool lvm, SetMount set_mount, UnsetMount unset_mount,
- MountSetFn mount_set, PartitionBar partition_bar) {
+ MountSetFn mount_set, PartitionBlock partition_bar) {
this.partition_bar = partition_bar;
original_filesystem = fs;
is_lvm = lvm;
diff --git a/src/meson.build b/src/meson.build
index e9dcca0cb..504555f76 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -26,7 +26,7 @@ vala_files = [
'Widgets/DiskBar.vala',
'Widgets/DiskGrid.vala',
'Widgets/InstallTypeGrid.vala',
- 'Widgets/PartitionBar.vala',
+ 'Widgets/PartitionBlock.vala',
'Widgets/PartitionMenu.vala',
'Widgets/Terminal.vala',
'Widgets/VariantWidget.vala',