Skip to content
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

Allow theme based on system #807

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions angrmanagement/ui/dialogs/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
from PySide6.QtWidgets import QDialog, QVBoxLayout, QHBoxLayout, QListWidget, QListView, QStackedWidget, QWidget, \
QGroupBox, QLabel, QCheckBox, QPushButton, QLineEdit, QListWidgetItem, QScrollArea, QFrame, QComboBox, \
QSizePolicy, QDialogButtonBox
from PySide6.QtCore import QSize

from PySide6.QtCore import QSize
from darkdetect import isDark
from ..widgets.qcolor_option import QColorOption
from ...config.config_manager import ENTRIES
from ...config.color_schemes import COLOR_SCHEMES
Expand Down Expand Up @@ -143,9 +144,13 @@ def _init_widgets(self):
self.setLayout(page_layout)

def _load_color_scheme(self, name):
for prop, value in COLOR_SCHEMES[name].items():
row = self._to_save[prop][1]
row.set_color(value)
if name in COLOR_SCHEMES:
for prop, value in COLOR_SCHEMES[name].items():
row = self._to_save[prop][1]
row.set_color(value)
else:
name = "Dark" if isDark() else "Light"
self._load_color_scheme(name)

def _on_load_scheme_clicked(self):
self._load_color_scheme(self._schemes_combo.currentText())
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ install_requires =
pyqodeng >= 0.0.6
qtterm
getmac
darkdetect
QtAwesome
pyobjc-framework-Cocoa; platform_system == "Darwin"

Expand Down