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
9 changes: 0 additions & 9 deletions BlocksScreen/lib/panels/networkWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2828,9 +2828,6 @@ def _setup_saved_details_page(self) -> None:
self.low_priority_btn.setMaximumSize(QtCore.QSize(100, 100))
self.low_priority_btn.setCheckable(True)
self.low_priority_btn.setFlat(True)
self.low_priority_btn.setProperty(
"icon_pixmap", PixmapCache.get(":/ui/media/btn_icons/indf_svg.svg")
)
self.low_priority_btn.setText("Low")
self.low_priority_btn.setProperty("class", "back_btn")
self.low_priority_btn.setProperty("button_type", "icon")
Expand All @@ -2844,9 +2841,6 @@ def _setup_saved_details_page(self) -> None:
self.med_priority_btn.setCheckable(True)
self.med_priority_btn.setChecked(False) # Don't set default checked
self.med_priority_btn.setFlat(True)
self.med_priority_btn.setProperty(
"icon_pixmap", PixmapCache.get(":/ui/media/btn_icons/indf_svg.svg")
)
self.med_priority_btn.setText("Medium")
self.med_priority_btn.setProperty("class", "back_btn")
self.med_priority_btn.setProperty("button_type", "icon")
Expand All @@ -2860,9 +2854,6 @@ def _setup_saved_details_page(self) -> None:
self.high_priority_btn.setCheckable(True)
self.high_priority_btn.setChecked(False)
self.high_priority_btn.setFlat(True)
self.high_priority_btn.setProperty(
"icon_pixmap", PixmapCache.get(":/ui/media/btn_icons/indf_svg.svg")
)
self.high_priority_btn.setText("High")
self.high_priority_btn.setProperty("class", "back_btn")
self.high_priority_btn.setProperty("button_type", "icon")
Expand Down
18 changes: 0 additions & 18 deletions BlocksScreen/lib/panels/printTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,20 +428,6 @@ def _on_delete_file_confirmed(self, filename: str, directory: str) -> None:
except (RuntimeError, TypeError):
pass

def setProperty(self, name: str, value: typing.Any) -> bool:
"""Intercept the set property method

Args:
name (str): Name of the dynamic property
value (typing.Any): Value for the dynamic property

Returns:
bool: Returns to the super class
"""
if name == "backgroundPixmap":
self.background = value
return super().setProperty(name, value)

def handle_cancel_print(self) -> None:
"""Handles the print cancel action"""
if (
Expand Down Expand Up @@ -514,10 +500,6 @@ def setupMainPrintPage(self) -> None:
self.setSizePolicy(sizePolicy)
self.setMinimumSize(QtCore.QSize(710, 410))
self.setMaximumSize(QtCore.QSize(720, 420))
self.setProperty(
"backgroundPixmap",
QtGui.QPixmap(":/background/media/graphics/scroll_list_window.svg"),
)
self.print_page = QtWidgets.QWidget()
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Policy.MinimumExpanding,
Expand Down
3 changes: 0 additions & 3 deletions BlocksScreen/lib/panels/widgets/babystepPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ def _setupUI(self) -> None:
self.bbp_z_offset_current_value.setText(
f"Z: {round(self._pending_z_offset, 3) or 0.0:.3f} mm"
)
self.bbp_z_offset_current_value.setPixmap(
QtGui.QPixmap(":/graphics/media/btn_icons/z_offset_adjust.svg")
)
self.bbp_z_offset_current_value.setAlignment(
QtCore.Qt.AlignmentFlag.AlignCenter
)
Expand Down
5 changes: 4 additions & 1 deletion BlocksScreen/lib/panels/widgets/popupDialogWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def __init__(self, parent) -> None:
self.message_type: Popup.MessageType = Popup.MessageType.INFO
self.default_background_color = QtGui.QColor(164, 164, 164)
self.info_icon = QtGui.QPixmap(":ui/media/btn_icons/info.svg")
self.warning_icon = QtGui.QPixmap(":ui/media/btn_icons/warning.svg")
# no warning asset exists yet; the yellow ColorCode carries the severity
self.warning_icon = QtGui.QPixmap(":ui/media/btn_icons/error.svg")
self.error_icon = QtGui.QPixmap(":ui/media/btn_icons/error.svg")
self.setAttribute(QtCore.Qt.WidgetAttribute.WA_TranslucentBackground, True)
self.setMouseTracking(True)
Expand Down Expand Up @@ -179,6 +180,8 @@ def _add_popup(self) -> None:
self.icon_label.setPixmap(self.warning_icon)
case Popup.MessageType.ERROR:
self.icon_label.setPixmap(self.error_icon)
case _:
self.icon_label.clear()

end_rect = self._calculate_target_geometry()
start_rect = end_rect.translated(0, -end_rect.height() * 2)
Expand Down
3 changes: 0 additions & 3 deletions BlocksScreen/lib/panels/widgets/probeHelperPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,6 @@ def _setupUi(self) -> None:
self.current_offset_info.setFont(font)
self.current_offset_info.setStyleSheet("background: transparent; color: white;")
self.current_offset_info.setText("Z:0.000mm")
self.current_offset_info.setPixmap(
QtGui.QPixmap(":/graphics/media/btn_icons/z_offset_adjust.svg")
)
self.current_offset_info.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.current_offset_info.setObjectName("current_offset_info")
# Add graphic frame AFTER the offset buttons group box
Expand Down
2 changes: 1 addition & 1 deletion BlocksScreen/lib/panels/widgets/slider_selector_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, parent) -> None:
self.decrease_button_icon = QtGui.QPixmap(
":/arrow_icons/media/btn_icons/left_arrow.svg"
)
self.background = QtGui.QPixmap(":/ui/background/media/1st_background.png")
self.background = QtGui.QPixmap(":/background/media/1st_background.png")
self.setStyleSheet(
"#SliderPage{background-image: url(:/background/media/1st_background.png);}\n"
)
Expand Down
2 changes: 1 addition & 1 deletion BlocksScreen/lib/ui/controlStackedWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -5122,7 +5122,7 @@ Home</string>
<bool>true</bool>
</property>
<property name="icon_pixmap" stdset="0">
<pixmap>:/button_borders/media/btn_icons/back.svg</pixmap>
<pixmap resource="resources/icon_resources.qrc">:/ui/media/btn_icons/back.svg</pixmap>
</property>
<property name="button_type" stdset="0">
<string>icon</string>
Expand Down
2 changes: 1 addition & 1 deletion BlocksScreen/lib/ui/controlStackedWidget_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,7 @@ def setupUi(self, controlStackedWidget):
self.z_adjust_back_button.setMaximumSize(QtCore.QSize(60, 60))
self.z_adjust_back_button.setText("")
self.z_adjust_back_button.setFlat(True)
self.z_adjust_back_button.setProperty("icon_pixmap", QtGui.QPixmap(":/button_borders/media/btn_icons/back.svg"))
self.z_adjust_back_button.setProperty("icon_pixmap", QtGui.QPixmap(":/ui/media/btn_icons/back.svg"))
self.z_adjust_back_button.setObjectName("z_adjust_back_button")
self.z_adjustment_header_layout.addWidget(self.z_adjust_back_button)
self.verticalLayoutWidget_8 = QtWidgets.QWidget(parent=self.z_adjustment_page)
Expand Down
12 changes: 6 additions & 6 deletions BlocksScreen/lib/utils/blocks_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ def __init__(self, parent: QtWidgets.QWidget = None, *args, **kwargs):
super().__init__(parent, *args, **kwargs)

self.setAttribute(QtCore.Qt.WidgetAttribute.WA_AcceptTouchEvents, True)
self.icon_pixmap: typing.Optional[QtGui.QPixmap] = None
self.icon_pixmap: QtGui.QPixmap | None = None
self._text: str = ""
self._background_color: typing.Optional[QtGui.QColor] = None
self._border_color: typing.Optional[QtGui.QColor] = None
self._background_color: QtGui.QColor | None = None
self._border_color: QtGui.QColor | None = None
self._rounded: bool = False
self._marquee: bool = True
self.timer = QtCore.QTimer()
Expand Down Expand Up @@ -76,7 +76,7 @@ def setText(self, text: str) -> None:
self.update_text_metrics()

@property
def background_color(self) -> typing.Optional[QtGui.QColor]:
def background_color(self) -> QtGui.QColor | None:
"""Widget background color"""
return self._background_color

Expand All @@ -85,7 +85,7 @@ def background_color(self, color: QtGui.QColor) -> None:
self._background_color = color

@property
def border_color(self) -> typing.Optional[QtGui.QColor]:
def border_color(self) -> QtGui.QColor | None:
"""Widget border color"""
return self._border_color

Expand Down Expand Up @@ -209,7 +209,7 @@ def paintEvent(self, a0: QtGui.QPaintEvent) -> None:
else:
qp.fillRect(rect, self._background_color)

if self.icon_pixmap:
if self.icon_pixmap is not None and not self.icon_pixmap.isNull():
icon_rect = QtCore.QRectF(
0.0 + self.icon_margin,
0.0 + self.icon_margin,
Expand Down
22 changes: 0 additions & 22 deletions tests/ui/test_resource_keys_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,11 @@
# Known-broken keys, measured 2026-08-31. This dict may only ever shrink:
# test_xfail_keys_are_still_broken fails once an entry stops being broken.
XFAIL_KEYS = {
":/background/media/graphics/scroll_list_window.svg": (
"asset is on disk but declared by no .qrc; retired by PR 3"
),
":/button_borders/media/btn_icons/back.svg": (
"wrong prefix, real key is :/ui/media/btn_icons/back.svg; "
"lives in a generated _ui.py so the .ui file is the fix; retired by PR 3"
),
":/graphics/media/btn_icons/z_offset_adjust.svg": (
"asset deleted from the qrc in 927e43c (2025-06-04) and absent from "
"disk, yet 3 call sites still request it; retired by PR 3"
),
":/network/media/btn_icons/network/{b}bar_wifi{": (
"not broken at runtime: an f-string template the scanner cannot "
"evaluate, whose real keys are the 0bar..3bar matrix; the literal "
"disappears when the Icon enum replaces it in PR 8"
),
":/ui/background/media/1st_background.png": (
"duplicated prefix segment, real key is "
":/background/media/1st_background.png; retired by PR 3"
),
":/ui/media/btn_icons/indf_svg.svg": (
"no such file in any .qrc or on disk; retired by PR 3"
),
":/ui/media/btn_icons/warning.svg": (
"no such file in any .qrc or on disk, so the warning popup renders a "
"blank icon; needs a new asset, not just a key fix; retired by PR 3"
),
}

# Deliberately a text scan, not an AST walk: an AST walk only sees ast.Constant,
Expand Down
Loading