Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/231'
Browse files Browse the repository at this point in the history
* origin/pr/231:
  Show progress bar after loading CSS theme

Pull request description:

If the progress bar is shown before loading the application CSS theme, it looks like a graphical glitch for around 744ms on my HP Elitebook 820 system. Until the next call to `update_progress` and `Gtk.main_iteration_do` loop (picture below).

But if the progress bar is shown and updated right after loading the CSS theme, it is much prettier.

![progress_bar2](https://github.com/user-attachments/assets/bd240f5e-39a5-453e-b5d4-24a6d3374622)

![progress_bar1](https://github.com/user-attachments/assets/e39539c7-37e2-4f22-af99-eacfc2416ce9)
  • Loading branch information
marmarek committed Nov 22, 2024
2 parents 2b308a5 + 9a85256 commit ab56644
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions qubes_config/global_config/global_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,6 @@ def perform_setup(self):
"""
The function that performs actual widget realization and setup.
"""
self.progress_bar_dialog.show()
self.progress_bar_dialog.update_progress(0)

self.builder = Gtk.Builder()
glade_ref = (importlib.resources.files('qubes_config') /
'global_config.glade')
Expand All @@ -342,6 +339,9 @@ def perform_setup(self):
light_file_name='qubes-global-config-light.css',
dark_file_name='qubes-global-config-dark.css')

self.progress_bar_dialog.show_all()
self.progress_bar_dialog.update_progress(0)

self.apply_button: Gtk.Button = self.builder.get_object('apply_button')
self.cancel_button: Gtk.Button = \
self.builder.get_object('cancel_button')
Expand Down
4 changes: 1 addition & 3 deletions qubes_config/new_qube/new_qube_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ def perform_setup(self):
The function that performs actual widget realization and setup. Should
be only called once, in the main instance of this application.
"""
self.progress_bar_dialog.show()
self.progress_bar_dialog.update_progress(0.1)

self.builder = Gtk.Builder()
glade_ref = (importlib.resources.files('qubes_config') /
'new_qube.glade')
Expand All @@ -122,6 +119,7 @@ def perform_setup(self):
light_file_name='qubes-new-qube-light.css',
dark_file_name='qubes-new-qube-dark.css')

self.progress_bar_dialog.show_all()
self.progress_bar_dialog.update_progress(0.1)

self.template_handler = TemplateHandler(self.builder, self.qapp)
Expand Down
1 change: 0 additions & 1 deletion qubes_config/widgets/gtk_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ def __init__(self, parent_application: Gtk.Application, loading_text: str):

self.box.pack_start(self.progress_bar, False, False, 10)

self.show_all()
self.update_progress(0)

self.connect('delete-event', self._quit)
Expand Down

0 comments on commit ab56644

Please sign in to comment.