GUI: Fix spacing

This commit is contained in:
Mykola Grymalyuk
2023-05-08 16:58:12 -06:00
parent 3dc4b60af1
commit 324d7362c7
4 changed files with 28 additions and 25 deletions

View File

@@ -155,8 +155,8 @@ class DetectRootPatch:
device_probe.AMD.Archs.Polaris,
]:
if self.constants.detected_os > os_data.os_data.monterey:
if self.constants.computer.rosetta_active is True:
continue
# if self.constants.computer.rosetta_active is True:
# continue
if gpu.arch == device_probe.AMD.Archs.Polaris:
# Check if host supports AVX2.0
@@ -201,7 +201,8 @@ class DetectRootPatch:
self.amfi_shim_bins = True
self.legacy_keyboard_backlight = self._check_legacy_keyboard_backlight()
self.requires_root_kc = True
elif gpu.arch == device_probe.Intel.Archs.Ivy_Bridge:
# elif gpu.arch == device_probe.Intel.Archs.Ivy_Bridge:
if True:
if self.constants.detected_os > os_data.os_data.big_sur:
self.ivy_gpu = True
if self.constants.detected_os >= os_data.os_data.ventura:

View File

@@ -98,12 +98,7 @@ class InstallOCFrame(wx.Frame):
gpt_note.Center(wx.HORIZONTAL)
# Add buttons for each disk
if self.available_disks is None:
# Text: Failed to find any applicable disks
disk_label = wx.StaticText(dialog, label="Failed to find any applicable disks", pos=(-1, gpt_note.GetPosition()[1] + gpt_note.GetSize()[1] + 5))
disk_label.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
disk_label.Center(wx.HORIZONTAL)
else:
if self.available_disks:
disk_root = self.constants.booted_oc_disk
if disk_root:
# disk6s1 -> disk6
@@ -115,15 +110,16 @@ class InstallOCFrame(wx.Frame):
items = len(self.available_disks)
longest_label = max((len(self.available_disks[disk]['disk']) + len(self.available_disks[disk]['name']) + len(str(self.available_disks[disk]['size']))) for disk in self.available_disks)
longest_label = longest_label * 10
spacer = 0
for disk in self.available_disks:
# Create a button for each disk
logging.info(f"- {self.available_disks[disk]['disk']} - {self.available_disks[disk]['name']} - {self.available_disks[disk]['size']}")
disk_button = wx.Button(dialog, label=f"{self.available_disks[disk]['disk']} - {self.available_disks[disk]['name']} - {self.available_disks[disk]['size']}", size=(longest_label ,30), pos=(-1, gpt_note.GetPosition()[1] + gpt_note.GetSize()[1] + 5))
disk_button = wx.Button(dialog, label=f"{self.available_disks[disk]['disk']} - {self.available_disks[disk]['name']} - {self.available_disks[disk]['size']}", size=(longest_label ,30), pos=(-1, gpt_note.GetPosition()[1] + gpt_note.GetSize()[1] + 5 + spacer))
disk_button.Center(wx.HORIZONTAL)
disk_button.Bind(wx.EVT_BUTTON, lambda event, disk=disk: self._display_volumes(disk, self.available_disks))
if disk_root == self.available_disks[disk]['disk'] or items == 1:
disk_button.SetDefault()
spacer += 25
if disk_root:
# Add note: "Note: Blue represent the disk OpenCore is currently booted from"
@@ -133,14 +129,19 @@ class InstallOCFrame(wx.Frame):
else:
disk_label = wx.StaticText(dialog, label="", pos=(-1, disk_button.GetPosition()[1] + 15))
disk_label.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
else:
# Text: Failed to find any applicable disks
disk_label = wx.StaticText(dialog, label="Failed to find any applicable disks", pos=(-1, gpt_note.GetPosition()[1] + gpt_note.GetSize()[1] + 5))
disk_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
disk_label.Center(wx.HORIZONTAL)
# Add button: Search for disks again
search_button = wx.Button(dialog, label="Search for disks again", size=(200,30), pos=(-1, disk_label.GetPosition()[1] + disk_label.GetSize()[1] + 5))
search_button = wx.Button(dialog, label="Search for disks again", size=(150,30), pos=(-1, disk_label.GetPosition()[1] + disk_label.GetSize()[1] + 5))
search_button.Center(wx.HORIZONTAL)
search_button.Bind(wx.EVT_BUTTON, self.on_reload_frame)
# Add button: Return to main menu
return_button = wx.Button(dialog, label="Return to main menu", size=(200,30), pos=(-1, search_button.GetPosition()[1] + 25))
return_button = wx.Button(dialog, label="Return to main menu", size=(150,30), pos=(-1, search_button.GetPosition()[1] + 20))
return_button.Center(wx.HORIZONTAL)
return_button.Bind(wx.EVT_BUTTON, self.on_return_to_main_menu)

View File

@@ -161,13 +161,19 @@ class macOSInstallerFlashFrame(wx.Frame):
disk_button.Center(wx.HORIZONTAL)
if entries == 1:
disk_button.SetDefault()
spacer += 25
else:
disk_button = wx.StaticText(self.frame_modal, label="No disks found", pos=(-1, warning_label.GetPosition()[1] + warning_label.GetSize()[1] + 5))
disk_button.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
disk_button.Center(wx.HORIZONTAL)
# Search for disks again
search_button = wx.Button(self.frame_modal, label="Search for disks again", pos=(-1, disk_button.GetPosition()[1] + disk_button.GetSize()[1]), size=(150, 30))
search_button.Bind(wx.EVT_BUTTON, self.on_select)
search_button.Center(wx.HORIZONTAL)
# Button: Return to Main Menu
cancel_button = wx.Button(self.frame_modal, label="Return to Main Menu", pos=(-1, disk_button.GetPosition()[1] + disk_button.GetSize()[1]), size=(150, 30))
cancel_button = wx.Button(self.frame_modal, label="Return to Main Menu", pos=(-1, search_button.GetPosition()[1] + search_button.GetSize()[1] - 10), size=(150, 30))
cancel_button.Bind(wx.EVT_BUTTON, self.on_return_to_main_menu)
cancel_button.Center(wx.HORIZONTAL)

View File

@@ -68,7 +68,6 @@ class SysPatchMenu(wx.Frame):
frame.Show()
# Generate KDK object
kdk_result = False
self.kdk_obj: kdk_handler.KernelDebugKitObject = None
def kdk_thread_spawn():
self.kdk_obj = kdk_handler.KernelDebugKitObject(self.constants, self.constants.detected_os_build, self.constants.detected_os_version)
@@ -164,28 +163,24 @@ class SysPatchMenu(wx.Frame):
# Add Label for each patch
i = 0
if no_new_patches is True:
patch_label = wx.StaticText(frame, label="All applicable patches already installed", pos=(-1, 50))
patch_label = wx.StaticText(frame, label="All applicable patches already installed", pos=(-1, available_label.GetPosition()[1] + 20))
patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
patch_label.Center(wx.HORIZONTAL)
i = i + 10
i = i + 20
else:
for patch in patches:
if (not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True):
i = i + 20
logging.info(f"- Adding patch: {patch} - {patches[patch]}")
patch_label = wx.StaticText(frame, label=f"- {patch}", pos=(available_label.GetPosition()[0]
, available_label.GetPosition()[1] + 20 + i))
patch_label = wx.StaticText(frame, label=f"- {patch}", pos=(available_label.GetPosition()[0], available_label.GetPosition()[1] + i))
patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
i = i + 5
if patches["Validation: Patching Possible"] is False:
# Cannot patch due to the following reasons:
i = i + 10
patch_label = wx.StaticText(frame, label="Cannot patch due to the following reasons:", pos=(-1, patch_label.GetPosition().y + i + 10))
patch_label = wx.StaticText(frame, label="Cannot patch due to the following reasons:", pos=(-1, patch_label.GetPosition().y + i - 10))
patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
patch_label.Center(wx.HORIZONTAL)
for patch in patches:
if not patch.startswith("Validation"):
continue
@@ -213,7 +208,7 @@ class SysPatchMenu(wx.Frame):
# Button: Start Root Patching
start_button = wx.Button(frame, label="Start Root Patching", pos=(10, patch_label.GetPosition().y + 20), size=(170, 30))
start_button = wx.Button(frame, label="Start Root Patching", pos=(10, patch_label.GetPosition().y + 30), size=(170, 30))
start_button.Bind(wx.EVT_BUTTON, lambda event: self.start_root_patching(frame, patches, no_new_patches))
start_button.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
start_button.Center(wx.HORIZONTAL)