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:
@@ -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."""
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user