disk: fix no partition row sensitivity

This commit is contained in:
Peter Eisenmann
2022-03-26 13:28:50 +01:00
parent 761f254aee
commit d98745fa46
2 changed files with 4 additions and 7 deletions

View File

@@ -2,16 +2,16 @@
<interface>
<requires lib="gtk" version="4.0"/>
<template class="NoPartitionsRow" parent="GtkListBoxRow">
<property name="name">no_efi</property>
<property name="activatable">0</property>
<property name="focusable">1</property>
<property name="selectable">0</property>
<property name="child">
<object class="GtkBox">
<property name="margin-start">6</property>
<property name="margin-end">6</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="spacing">6</property>
<property name="spacing">12</property>
<child>
<object class="GtkImage">
<property name="icon-name">dialog-information-symbolic</property>

View File

@@ -85,13 +85,10 @@ class DiskPage(Gtk.Box, Page):
partition_rows = []
disk_uefi_okay = not is_booted_with_uefi() or disk_info.efi_partition
if disk_uefi_okay and len(disk_info.partitions) > 0:
self.partition_list.set_sensitive(True)
for partition_info in disk_info.partitions:
too_small = partition_info.size < self.minimum_disk_size
partition_rows.append(DeviceRow(partition_info, too_small))
else:
self.partition_list.set_sensitive(False)
partition_rows = [NoPartitionsRow()]
n_items = self.partition_list_model.get_n_items()