Skip to content
Open
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
20 changes: 9 additions & 11 deletions BlocksScreen/lib/panels/utilitiesTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(

# --- UI Setup ---
self.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight)
self.loadPage = BasePopup(self)
self.loadPage = BasePopup(self, dialog=False)
self.loadwidget = LoadingOverlayWidget(
self, LoadingOverlayWidget.AnimationGIF.DEFAULT
)
Expand Down Expand Up @@ -233,6 +233,7 @@ def __init__(
QtGui.QPixmap(":/system/media/btn_icons/update-software-icon.svg")
)

# ---- Input Shaper ----
self.automatic_is = OptionCard(
self,
"Automatic\nInput Shaper",
Expand Down Expand Up @@ -261,6 +262,12 @@ def __init__(

self.is_types: dict = {}
self.is_aut_types: dict = {}
self.dialog_page.accepted.connect(
lambda: self.handle_is("SHAPER_CALIBRATE AXIS=Y")
)
self.dialog_page.rejected.connect(
lambda: self.handle_is("SHAPER_CALIBRATE AXIS=X")
)

self.is_page.action_btn.clicked.connect(
lambda: self.change_page(self.indexOf(self.panel.input_shaper_page))
Expand Down Expand Up @@ -349,21 +356,12 @@ def handle_gcode_response(self, data: list[str]) -> None:
self.loadPage.hide()
return

def on_dialog_button_clicked(self, button_name: str) -> None:
print(button_name)
"""Handle dialog button clicks"""
if button_name == "Confirm":
self.handle_is("SHAPER_CALIBRATE AXIS=Y")
elif button_name == "Cancel":
self.handle_is("SHAPER_CALIBRATE AXIS=X")

def handle_is(self, gcode: str) -> None:
if gcode == "SHAPER_CALIBRATE":
self.run_gcode_signal.emit("G28\nM400")
self.aut = True
self.run_gcode_signal.emit(gcode)
if gcode == "":
print("manual Input Shaper Selected")
elif gcode == "":
self.dialog_page.confirm_background_color("#dfdfdf")
self.dialog_page.cancel_background_color("#dfdfdf")
self.dialog_page.cancel_font_color("#000000")
Expand Down
13 changes: 6 additions & 7 deletions BlocksScreen/lib/panels/widgets/basePopup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ def __init__(
dialog: bool = True,
) -> None:
super().__init__(parent)

self.setWindowFlags(
QtCore.Qt.WindowType.Popup | QtCore.Qt.WindowType.FramelessWindowHint
QtCore.Qt.WindowType.Dialog
| QtCore.Qt.WindowType.FramelessWindowHint
| QtCore.Qt.WindowType.CustomizeWindowHint
)
self.floating = floating
self.dialog = dialog

# Color Variables
self.btns_text_color = "#ffffff"
self.cancel_bk_color = "#F44336"
Expand All @@ -45,6 +45,7 @@ def __init__(

if floating:
self.setAttribute(QtCore.Qt.WidgetAttribute.WA_TranslucentBackground, True)
self.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
else:
self.setStyleSheet(
"""
Expand All @@ -59,9 +60,6 @@ def _update_button_style(self) -> None:
if not self.dialog:
return

self.confirm_button.clicked.connect(self.accept)
self.cancel_button.clicked.connect(self.reject)

if not self.floating:
self.confirm_button.setStyleSheet(
f"""
Expand Down Expand Up @@ -252,5 +250,6 @@ def setupUI(self) -> None:
self.cancel_button.setStyleSheet("background: transparent;")
self.hlauyout.addWidget(self.confirm_button)
self.hlauyout.addWidget(self.cancel_button)

self.confirm_button.clicked.connect(self.accept)
self.cancel_button.clicked.connect(self.reject)
self._update_button_style()
2 changes: 1 addition & 1 deletion BlocksScreen/lib/panels/widgets/inputshaperPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def _setupUI(self) -> None:
self.info_box.addWidget(self.vib_label, 0, 1)

self.sug_accel_title_label = QtWidgets.QLabel(self)
self.sug_accel_title_label.setText("Sugested Max Acceleration:")
self.sug_accel_title_label.setText("Sugested Max\nAcceleration:")
self.sug_accel_title_label.setMinimumSize(QtCore.QSize(60, 60))
self.sug_accel_title_label.setMaximumSize(
QtCore.QSize(int(self.infobox_frame.size().width() * 0.40), 9999)
Expand Down
2 changes: 1 addition & 1 deletion BlocksScreen/lib/panels/widgets/probeHelperPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ProbeHelper(QtWidgets.QWidget):
def __init__(self, parent: QtWidgets.QWidget) -> None:
super().__init__(parent)

self.Loadscreen = BasePopup(self)
self.Loadscreen = BasePopup(self, dialog=False)
self.loadwidget = LoadingOverlayWidget(
self, LoadingOverlayWidget.AnimationGIF.PLACEHOLDER
)
Expand Down
Loading