1. 13 Mar, 2021 5 commits
  2. 11 Mar, 2021 2 commits
    • James Westman's avatar
      Rewrite ShumateMarkerLayer selection logic · 8def5e81
      James Westman authored
      Selecting and unselecting map markers is now done entirely through the
      ShumateMarkerLayer rather than the individual ShumateMarkers. This makes
      the code simpler and matches how e.g. GtkListBox works.
      
      Some notable changes:
      - The ShumateMarker methods for selecting and unselecting a marker have been
        removed and replaced with methods in ShumateMarkerLayer.
      - Setting the selection mode to GTK_SELECTION_NONE no longer sets the
        selectable property of children to FALSE.
      - Added marker-selected and marker-unselected signals to
        ShumateMarkerLayer.
      - Selecting a marker properly deselects the other markers in
        GTK_SELECTION_SINGLE mode.
      8def5e81
    • James Westman's avatar
      tests: Add tests for ShumateMarkerLayer · deba962b
      James Westman authored
      deba962b
  3. 10 Mar, 2021 12 commits
  4. 09 Mar, 2021 11 commits
    • Georges Basile Stavracas Neto's avatar
      map-layer: Shift row and columns when possible · 8744b93f
      Georges Basile Stavracas Neto authored
      Every time the top-left tile changes the row or column it's displaying, *all*
      other tiles change too. This incurs all tiles reloading every time the viewport
      is moved enough, which flickers and makes up for a bad experience.
      
      Fix that by shifting rows and columns by a certain amount to avoid making all
      tiles reload.
      8744b93f
    • Georges Basile Stavracas Neto's avatar
      map-layer: Rename some variables · 240815cb
      Georges Basile Stavracas Neto authored
      While technically the latitude and longitude that ShumateViewport reports
      is indeed relative to its center, this is an implementation detail. It gets
      confusing when we mix map coordinates with geographic coordinates and actor
      coordinates.
      
      Rename 'center_' to 'latitude_' in the allocation function.
      240815cb
    • Georges Basile Stavracas Neto's avatar
      map-layer: Allocate columns, then rows · 996a0a1b
      Georges Basile Stavracas Neto authored
      My totally westener brain is hardwired to think of it the same way I
      read text: top-left to bottom-right. The current allocation code goes
      top-bottom and left-right, and that's making me think of it wrongly
      way too many times.
      
      Allocate top-left to bottom-right through each column then row.
      996a0a1b
    • Georges Basile Stavracas Neto's avatar
      map-layer: Use row & column terminology when dealing with tiles · 8ce6bfc1
      Georges Basile Stavracas Neto authored
      It is super confusing that sometimes, some of the (x,y) are about tile coordinates,
      and other times they're pixels in actor coordinates.
      
      Resolve this confusion by using row & column when dealing with tiles.
      8ce6bfc1
    • Georges Basile Stavracas Neto's avatar
      map-layer: Trivial cleanup · e8e7feef
      Georges Basile Stavracas Neto authored
      Replace the else condition with a continue in the if(), and
      reduce indentation.
      e8e7feef
    • Georges Basile Stavracas Neto's avatar
      map-layer: Queue idle relayout if grid needs recomputing · 38e94a1f
      Georges Basile Stavracas Neto authored
      Sometimes we legit need to recompute the grid using the new width and
      height passed by the allocator, but we can't really do that in that
      moment to not break the allocation model of GTK4.
      
      Queue an idle callback to recompute the grid in allocation.
      38e94a1f
    • Georges Basile Stavracas Neto's avatar
      map-layer: Rework tile allocation · 021d1632
      Georges Basile Stavracas Neto authored
      ShumateMapLayer currently breaks the GTK4 allocation model by calling
      gtk_widget_size_allocate() outsize allocation, and by queueing allocation
      during allocation (by removing and adding widgets).
      
      Rework its allocation to not do that anymore. Make the allocation vfunc
      only allocate, and never queue allocations.
      
      Despite the scary diff, this change merely moves the contents of the
      shumate_map_layer_compute_grid() function to inside the allocation
      vfunc, and the contents of the allocation vfunc to recompute_grid().
      021d1632
    • Georges Basile Stavracas Neto's avatar
      view: Fix scroll-to-zoom direction · ee1dac0d
      Georges Basile Stavracas Neto authored
      The check for the scroll deltas is reversed, correct that. It's worth
      noticing that we don't have to care about natural scroll, the values
      are reversed when it's enabled.
      
      Also make sure to not zoom out when dy is zero.
      
      Fixes: GNOME/libshumate#4
      ee1dac0d
    • Georges Basile Stavracas Neto's avatar
      view: Remove 'kinetic-mode' property · 84a5100b
      Georges Basile Stavracas Neto authored
      It doesn't seem to be useful enough to justify its existance, so just
      remove it. Adapt the Vala demo to not use it too.
      84a5100b
    • Georges Basile Stavracas Neto's avatar
      view: Remove 'deceleration' property · be067301
      Georges Basile Stavracas Neto authored
      It currently is stub, and it doesn't seem to be much useful either.
      
      Remove the 'deceleration' property.
      be067301
    • Georges Basile Stavracas Neto's avatar
      view: Add kinetic scrolling · 61f35d43
      Georges Basile Stavracas Neto authored
      Implement kinetic scrolling through a GtkGestureSwipe that is triggered
      after ending a drag. When triggered, it adds a tick callback to the view,
      and each tick calculates the new distance from the point where the drag
      end happened.
      
      The kinetic scrolling heuristic is copied and modified from GTK4.
      
      The deceleration rate is hardcoded for now, because the 'deceleration'
      property is stub, but that'll be fixed by the next commits.
      
      Fixes: GNOME/libshumate#7
      61f35d43
  5. 05 Mar, 2021 10 commits