feat(ui_builders_shared): implement class ScrollbarWheelOnlyScrollArea

This commit is contained in:
dev 2026-02-26 12:15:34 +00:00
parent ca05b2e10d
commit 736a1626aa

View file

@ -71,3 +71,21 @@ def icon_from_svg_data_url(data_url, size=24, color_hex=None, palette=None):
renderer.render(painter)
painter.end()
return QIcon(pixmap)
# ScrollbarWheelOnlyScrollArea: class definition for ScanSlicer behavior.
class ScrollbarWheelOnlyScrollArea(QScrollArea):
# wheelEvent: function definition for ScanSlicer behavior.
def wheelEvent(self, event):
scrollbar = self.verticalScrollBar()
if scrollbar is None or not scrollbar.isVisible():
event.ignore()
return
global_pos = event.globalPosition().toPoint()
scrollbar_rect = QRect(scrollbar.mapToGlobal(QPoint(0, 0)), scrollbar.size())
if not scrollbar_rect.contains(global_pos):
event.ignore()
return
super().wheelEvent(event)