Skip to content

Commit

Permalink
use fixed size loader
Browse files Browse the repository at this point in the history
  • Loading branch information
amit9838 committed Jan 27, 2024
1 parent 7b34f7a commit 9c1756d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/frontendHourlyDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ def create_stack_page(self, page_name):
"Enjoy a rain-free day today!",
"Umbrella status: resting. No precipitation in sight !",
"No rain in sight today!"


]
no_prec_label = Gtk.Label(label=no_prec_labels[random.randint(0,len(no_prec_labels)-1)])
no_prec_label.set_css_classes(["text-3a", "bold-3", "light-2"])
Expand Down
11 changes: 7 additions & 4 deletions src/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,27 @@ def show_loader(self):
return

container_loader = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
container_loader.set_margin_top(200)
container_loader.set_margin_top(250)
container_loader.set_margin_bottom(300)


# Create loader
loader = Gtk.Spinner()
loader.set_margin_top(50)
loader.set_margin_bottom(50)
loader.set_size_request(120, 120)

loader.set_css_classes(['loader'])
container_loader.append(loader)


loader_label = Gtk.Label(label=f"Getting Weather Data")
loader_label.set_css_classes(["text-1", "bold-2"])
loader_label.set_css_classes(["text-2a", "bold-2"])
container_loader.append(loader_label)

loader.start()
loader.set_hexpand(True)
loader.set_vexpand(True)
# loader.set_hexpand(True)
# loader.set_vexpand(True)
self.main_stack.add_named(container_loader, "loader")
self.main_stack.set_visible_child_name("loader")

Expand Down

0 comments on commit 9c1756d

Please sign in to comment.