Skip to content

Commit

Permalink
Add scrollbar offset logic in HourlyDetails widget (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgescutelnicu authored May 8, 2024
1 parent 9bc42f2 commit cabf166
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/frontendHourlyDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,9 @@ def create_stack_page(self, page_name):

label_val.set_margin_top(0)

# Add scrollbar offset
container_size = graphic_container.get_preferred_size()[1]
container_width = container_size.width
scrollbar_offset = (container_width / 24) * (nearest_current_time_idx - 2)
h_adjustment = Gtk.Adjustment(value=scrollbar_offset, lower=0, upper=container_width)
scrolled_window.set_hadjustment(h_adjustment)

0 comments on commit cabf166

Please sign in to comment.