-
-
Notifications
You must be signed in to change notification settings - Fork 99
Fix UI bugs #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix UI bugs #96
Conversation
- Emptied default.qss to allow system dark and light modes to apply properly. - Ensures compatibility with Cleanlooks theme in PyQt6.
- Added .idea/ to .gitignore to prevent JetBrains IDE configuration files from being tracked. - Helps keep the repository clean and focused on source code.
- Corrected typos in the configuration file. - Updated default width and height values for better display of the window.
…_.py - Added exception handling to manage cases where syscall files do not exist for specific architectures (e.g., Generic). - Display a PyQt6 QMessageBox with the exception message to inform the user.
- Added is_dark_mode function to check if the current palette is in dark mode. - Uses QPalette to determine if the window color value is less than 128.
- Changed column width from 60 to 80 in RegisterWidget class. - Improves the display of register names and values in the table.
- Increased column widths to 120 for better display in MemoryMappingWidget. - Set fixed width of MemoryMapTableWidget to 350. - Corrected typo in permission checkbox label from 'eXecute' to 'Execute'.
- Enhanced CommandWidget to show tooltips when hovering over QPushButtons. - Tooltips provide additional context for each button's functionality.
- Wrapped self.setup() method in try-except to handle exceptions gracefully. - Added QMessageBox to display error messages when setup fails. - Removed unnecessary reassignment of self.codelines in reset method to prevent crashes. - Modified next_instruction method to return Optional, returning None when no instructions remain instead of raising an exception.
- Increased fixed width of AssemblyView from 140 to 230 for better display. - Removed background color stylesheet for better harmony in dark mode. - Fixed bug in update_assembly_code_pane method to correctly handle line returns on Windows by using '\n' instead of os.linesep.
…highlighter.py - Organized imports for better readability and maintenance. - Removed unneeded return statements at the end of None type methods.
…arious bugs in cemu/ui/main.py - Enhanced dock widget positions for better user experience in CEmuWindow class. - Implemented StartInFullScreen with global settings stored in ini file. - Changed default window width and height to 800x600 instead of 1600x800. - Fixed bug in Architecture menu for proper switching between x86 AT&T and Intel syntax in different bits (16, 32, 64). - Fixed bug in showShortcutPopup method with incorrect string format syntax. - Fixed crash in EmulationRunner class method run when no instructions remain.
- Add various functions for ui dark mode in cemu/ui/utils.py - Improve syntax highlighting for ui dark mode in cemu/ui/highlighter.py
- Added new screenshots for GUI
Looks epic, thanks @LuLuKitty1998 ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor things to change but really looks good
I tried to provide suggestions to make the changes easier.
cemu/arch/__init__.py
Outdated
msgbox = QMessageBox() | ||
msgbox.setIcon(QMessageBox.Icon.Critical) | ||
msgbox.setWindowTitle("No Syscall File Error") | ||
msgbox.setText(str(e)) | ||
msgbox.exec() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use cemu.ui.popup
to make this a bit smaller
cemu/arch/__init__.py
Outdated
msgbox.setWindowTitle("No Syscall File Error") | ||
msgbox.setText(str(e)) | ||
msgbox.exec() | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass | |
return {} |
cemu/emulator.py
Outdated
msgbox = QMessageBox() | ||
msgbox.setIcon(QMessageBox.Icon.Critical) | ||
msgbox.setWindowTitle("Emulator setup error") | ||
msgbox.setText(str(e)) | ||
msgbox.exec() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use popup
here too
cemu/ui/codeeditor.py
Outdated
@@ -16,12 +16,11 @@ | |||
) | |||
|
|||
import cemu.core | |||
from build.lib.cemu.const import DEFAULT_CODE_VIEW_FONT, DEFAULT_CODE_VIEW_FONT_SIZE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's build.lib
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think PyCharm IDE optimized imports by mistake :) instead of import from cemu.const imported from different directory
cemu/ui/codeeditor.py
Outdated
@@ -34,30 +33,22 @@ | |||
|
|||
|
|||
class CodeEdit(QTextEdit): | |||
def __init__(self, parent): | |||
def __init__(self, parent=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add type hints too?
def __init__(self, parent=None): | |
def __init__(self, parent: Optional[QtWidget] = None): |
cemu/ui/utils.py
Outdated
return palette.color(QPalette.ColorRole.Window).value() < 128 | ||
|
||
|
||
def brighten_color(hex_color: str, percent: float): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def brighten_color(hex_color: str, percent: float): | |
def brighten_color(hex_color: str, percent: float) -> str: |
cemu/ui/utils.py
Outdated
return f'{r:02x}{g:02x}{b:02x}' | ||
|
||
|
||
def hex_to_rgb(hex_color: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def hex_to_rgb(hex_color: str): | |
def hex_to_rgb(hex_color: str) -> tuple[int, int, int]: |
cemu/ui/utils.py
Outdated
return tuple(int(hex_color[i:i + 2], 16) for i in (0, 2, 4)) | ||
|
||
|
||
def is_red(hex_color: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def is_red(hex_color: str): | |
def is_red(hex_color: str) -> bool: |
cemu/ui/utils.py
Outdated
return r > g and r > b | ||
|
||
|
||
def is_green(hex_color: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def is_green(hex_color: str): | |
def is_green(hex_color: str) -> bool: |
cemu/ui/utils.py
Outdated
return g > r and g > b | ||
|
||
|
||
def is_blue(hex_color: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def is_blue(hex_color: str): | |
def is_blue(hex_color: str) -> bool: |
FWIW the packaging system has changed making CI fail. You can ignore the CI failures |
Awesome PR, merged! |
Fix UI Bugs and Improve GUI
Description/Motivation/Screenshots
This patch addresses several UI bugs and crashes in the CEmu GUI, making it more stable and user-friendly. The changes include:Checklist