1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-05-10 16:52:11 +02:00

refactor(black): black 26 applied

This commit is contained in:
2026-03-06 10:25:45 +01:00
committed by Jan Wyzula
parent e157f0d7c9
commit d4e037f338
24 changed files with 88 additions and 166 deletions
+4 -8
View File
@@ -20,15 +20,13 @@ class BECLogin(QWidget):
title = QLabel("Sign in", parent=self)
title.setAlignment(Qt.AlignmentFlag.AlignCenter)
title.setStyleSheet(
"""
title.setStyleSheet("""
#QLabel
{
font-size: 18px;
font-weight: 600;
}
"""
)
""")
self.username = QLineEdit(parent=self)
self.username.setPlaceholderText("Username")
@@ -57,13 +55,11 @@ class BECLogin(QWidget):
self.username.setFocus()
self.setStyleSheet(
"""
self.setStyleSheet("""
QLineEdit {
padding: 8px;
}
"""
)
""")
def _clear_password(self):
"""Clear the password field."""
+2 -4
View File
@@ -67,15 +67,13 @@ class TutorialOverlay(QWidget):
box = QFrame(self)
app = QApplication.instance()
bg_color = app.palette().window().color()
box.setStyleSheet(
f"""
box.setStyleSheet(f"""
QFrame {{
background-color: {bg_color.name()};
border-radius: 8px;
padding: 8px;
}}
"""
)
""")
layout = QVBoxLayout(box)
# Top layout with close button (left) and step indicator (right)
+2 -4
View File
@@ -69,13 +69,11 @@ class RoundedFrame(QFrame):
"""
Update the style of the frame based on the background color.
"""
self.setStyleSheet(
f"""
self.setStyleSheet(f"""
QFrame#roundedFrame {{
border-radius: {self._radius}px;
}}
"""
)
""")
self.apply_plot_widget_style()
def apply_plot_widget_style(self, border: str = "none"):
+2 -4
View File
@@ -599,16 +599,14 @@ class ExpandableMenuAction(ToolBarAction):
button.setIcon(QIcon(self.icon_path))
button.setText(self.tooltip)
button.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup)
button.setStyleSheet(
"""
button.setStyleSheet("""
QToolButton {
font-size: 14px;
}
QMenu {
font-size: 14px;
}
"""
)
""")
menu = QMenu(button)
for action_container in self.actions.values():
action: QAction = action_container.action
+2 -4
View File
@@ -106,8 +106,7 @@ class ResizableSpacer(QWidget):
self.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
self.setStyleSheet(
"""
self.setStyleSheet("""
ResizableSpacer {
background-color: transparent;
margin: 0px;
@@ -117,8 +116,7 @@ class ResizableSpacer(QWidget):
ResizableSpacer:hover {
background-color: rgba(100, 100, 200, 80);
}
"""
)
""")
self.setContentsMargins(0, 0, 0, 0)
+4 -8
View File
@@ -291,8 +291,7 @@ class ModularToolBar(QToolBar):
menu = QMenu(self)
theme = get_theme_name()
if theme == "dark":
menu.setStyleSheet(
"""
menu.setStyleSheet("""
QMenu {
background-color: rgba(50, 50, 50, 0.9);
border: 1px solid rgba(255, 255, 255, 0.2);
@@ -300,12 +299,10 @@ class ModularToolBar(QToolBar):
QMenu::item:selected {
background-color: rgba(0, 0, 255, 0.2);
}
"""
)
""")
else:
# Light theme styling
menu.setStyleSheet(
"""
menu.setStyleSheet("""
QMenu {
background-color: rgba(255, 255, 255, 0.9);
border: 1px solid rgba(0, 0, 0, 0.2);
@@ -313,8 +310,7 @@ class ModularToolBar(QToolBar):
QMenu::item:selected {
background-color: rgba(0, 0, 255, 0.2);
}
"""
)
""")
for ii, bundle in enumerate(self.shown_bundles):
self.handle_bundle_context_menu(menu, bundle)
if ii < len(self.shown_bundles) - 1: