@@ -22,6 +22,7 @@ public class Installer.DiskBar: Gtk.Grid {
22
22
public string disk_name { get ; construct; }
23
23
public string disk_path { get ; construct; }
24
24
public uint64 size { get ; construct; }
25
+ public uint64 sector_size { get ; construct; }
25
26
public Gee . ArrayList<PartitionBar > partitions { get ; construct; }
26
27
27
28
public Gtk . Box label;
@@ -34,13 +35,15 @@ public class Installer.DiskBar: Gtk.Grid {
34
35
string model ,
35
36
string path ,
36
37
uint64 size ,
38
+ uint64 sector_size ,
37
39
Gee .ArrayList<PartitionBar > partitions
38
40
) {
39
41
Object (
40
42
disk_name: model,
41
43
disk_path: path,
42
44
partitions: partitions,
43
- size: size
45
+ size: size,
46
+ sector_size: sector_size
44
47
);
45
48
}
46
49
@@ -66,7 +69,7 @@ public class Installer.DiskBar: Gtk.Grid {
66
69
used + = partition. get_size ();
67
70
}
68
71
69
- return size - (used * 512 );
72
+ return size - (used * sector_size );
70
73
}
71
74
72
75
private void generate_legend () {
@@ -79,7 +82,7 @@ public class Installer.DiskBar: Gtk.Grid {
79
82
legend. add (legend_container);
80
83
81
84
foreach (PartitionBar p in partitions) {
82
- add_legend (p. path, p. get_size () * 512 , Distinst . strfilesys (p. filesystem), p. vg, p. menu);
85
+ add_legend (p. path, p. get_size () * sector_size , Distinst . strfilesys (p. filesystem), p. vg, p. menu);
83
86
}
84
87
85
88
if (size / 100 < unused) {
@@ -165,7 +168,7 @@ public class Installer.DiskBar: Gtk.Grid {
165
168
166
169
private void update_sector_lengths (Gee .ArrayList<PartitionBar > partitions , Gtk .Allocation alloc ) {
167
170
var alloc_width = alloc. width;
168
- var disk_sectors = this . size / 512 ;
171
+ var disk_sectors = this . size / sector_size ;
169
172
170
173
int [] lengths = {};
171
174
for (int x = 0 ; x < partitions. size; x++ ) {
0 commit comments