From 5f2dc379753e2f562f2619fa5ee4b144d74532c0 Mon Sep 17 00:00:00 2001 From: lenemter Date: Tue, 28 Oct 2025 20:17:08 +0300 Subject: [PATCH] DiskBar: Increase minimum partition percentage --- src/Views/PartitioningView.vala | 46 +++++++++++++++++++++++++++++++++ src/Widgets/DiskBar.vala | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/Views/PartitioningView.vala b/src/Views/PartitioningView.vala index 1f2e9abe7..c3aeffdad 100644 --- a/src/Views/PartitioningView.vala +++ b/src/Views/PartitioningView.vala @@ -589,6 +589,52 @@ public class Installer.PartitioningView : AbstractInstallerView { partitions = {partitions_13, partitions_14} }; + var partitions_15 = InstallerDaemon.Partition () { + device_path = "/dev/nvme0n2p1", + filesystem = InstallerDaemon.FileSystem.FAT32, + start_sector = 4096, + end_sector = 542966, + sectors_used = InstallerDaemon.PartitionUsage () { + tag = 1, + value = 35376 + }, + current_lvm_volume_group = "" + }; + + var partitions_16 = InstallerDaemon.Partition () { + device_path = "/dev/nvme0n2p2", + filesystem = InstallerDaemon.FileSystem.EXT4, + start_sector = 544768, + end_sector = 537415679, + sectors_used = InstallerDaemon.PartitionUsage () { + tag = 1, + value = 10641584 + }, + current_lvm_volume_group = "" + }; + + var partitions_17 = InstallerDaemon.Partition () { + device_path = "/dev/nvme0n2p3", + filesystem = InstallerDaemon.FileSystem.EXT4, + start_sector = 537415680, + end_sector = 1611156503, + sectors_used = InstallerDaemon.PartitionUsage () { + tag = 1, + value = 19087560 + }, + current_lvm_volume_group = "" + }; + + physical_disks += InstallerDaemon.Disk () { + name = "WDC PC SN5000S SDEPNSJ-1T00-1032", + device_path = "/dev/nvme0n2", + sectors = 2000409264, + sector_size = 512, + rotational = false, + removable = false, + partitions = {partitions_15, partitions_16, partitions_17} + }; + return InstallerDaemon.DiskInfo () { physical_disks = physical_disks, logical_disks = logical_disks diff --git a/src/Widgets/DiskBar.vala b/src/Widgets/DiskBar.vala index 4d82986f7..ae5b33024 100644 --- a/src/Widgets/DiskBar.vala +++ b/src/Widgets/DiskBar.vala @@ -154,7 +154,7 @@ public class Installer.DiskBar: Gtk.Box { // Also make sure percentage is never 0, otherwise we can assertion error: // gtk_constraint_expression_new_subject: assertion failed: (!G_APPROX_VALUE (term->coefficient, 0.0, 0.001)) // Also we assume partitions.size is less than 100 - percentage = ((int) (percentage * 100) / 100.0).clamp (0.01, 1.0 - partitions.size / 100.0); + percentage = ((int) (percentage * 100) / 100.0).clamp (0.1, 1.0 - partitions.size / 100.0); widget.set_parent (this);