Skip to content

Commit cd150c0

Browse files
committed
fix(bec_progress_bar): replace the custom paint event progressbar with native QProgressBar
1 parent af125e2 commit cd150c0

7 files changed

Lines changed: 583 additions & 161 deletions

File tree

bec_widgets/cli/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def detach(self):
427427

428428

429429
class BECProgressBar(RPCBase):
430-
"""A custom progress bar with smooth transitions. The displayed text can be customized using a template."""
430+
"""A BEC progress bar backed by Qt's native QProgressBar."""
431431

432432
_IMPORT_MODULE = "bec_widgets.widgets.progress.bec_progressbar.bec_progressbar"
433433

bec_widgets/widgets/containers/main_window/main_window.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
class BECMainWindow(BECWidget, QMainWindow):
4747
RPC = True
4848
PLUGIN = True
49-
SCAN_PROGRESS_WIDTH = 100 # px
50-
SCAN_PROGRESS_HEIGHT = 12 # px
49+
SCAN_PROGRESS_WIDTH = 120 # px
50+
SCAN_PROGRESS_HEIGHT = 20 # px
5151

5252
def __init__(self, parent=None, window_title: str = "BEC", **kwargs):
5353
super().__init__(parent=parent, **kwargs)
@@ -197,7 +197,11 @@ def _add_scan_progress_bar(self):
197197

198198
# Setting HoverWidget for the scan progress bar - minimal and full version
199199
self._scan_progress_bar_simple = ScanProgressBar(
200-
self, one_line_design=True, rpc_exposed=False, rpc_passthrough_children=False
200+
self,
201+
one_line_design=True,
202+
rpc_exposed=False,
203+
rpc_passthrough_children=False,
204+
enable_dynamic_stylesheet=True,
201205
)
202206
self._scan_progress_bar_simple.show_elapsed_time = False
203207
self._scan_progress_bar_simple.show_remaining_time = False
@@ -206,7 +210,7 @@ def _add_scan_progress_bar(self):
206210
self._scan_progress_bar_simple.progressbar.setFixedHeight(self.SCAN_PROGRESS_HEIGHT)
207211
self._scan_progress_bar_simple.progressbar.setFixedWidth(self.SCAN_PROGRESS_WIDTH)
208212
self._scan_progress_bar_full = ScanProgressBar(
209-
self, rpc_exposed=False, rpc_passthrough_children=False
213+
self, rpc_exposed=False, rpc_passthrough_children=False, enable_dynamic_stylesheet=False
210214
)
211215
self._scan_progress_hover = HoverWidget(
212216
self, simple=self._scan_progress_bar_simple, full=self._scan_progress_bar_full

0 commit comments

Comments
 (0)