Previously, the code would chain up to the parent button_press_event(),
which is impossible with the introduction of gestures. A workaround for
that is just unselecting everything and selecting the path that is
underneath the pointer.
In GTK+ 4, the overlays for various different states (empty folder, no
search results, etc.) are visible by default and can be seen when
creating a new tab or opening a new location. That is fixable by hiding
them by default.
This commit replaces the removed comparison of the event and tree view
bin windows with a check for negative coordinates, which will be the
case after converting the event coordinates when a header is pressed.
Additionally, this replaces the GtkWidget::event handlers with gestures.
Checking for negative coordinates could probably be removed if the
gestures were cleverly reordered, so that the header ones run first and
claim the sequence.
This broke with replacing focus event handlers with listening to changes
in GtkWidget::has-focus, which doesn’t change in the toplevel when the
window goes inactive while the focus is on the entry.
Until now, the usage pie chart was drawn by connecting to ::draw of
the GtkDrawingArea, which has since been obsoleted. Luckily to us, one
can very easily just set the draw function of the drawing area. This
commit does just that and fixes styling issues by moving out class
addition to just before drawing (2 px solid borders were being applied
to the entire drawing area, which wasn’t an intended look).
The icon size of a GtkImage is GTK_ICON_SIZE_INHERIT by default, which
is the size of a regular button, given that the parent element is a
button. This commit sets the pixel size of the GtkImage to that of the
displayed thumbnail.
This merges some getter functions into one with additional parameters,
so that duplicate code can be avoided. Additionally, this converts
callers to use textures where possible.
The ::size-allocate handler only redoes its layout if the allocation
had changed and if there isn’t an allocation loop. There used to be a
bug, which caused that to happen in certain cases, but the workarounds
break in GTK+ 4, and it doesn’t seem likely that the bug will manifest
itself again.
This means that we no longer have to store the event device to get
coordinates from, but this means that the coordinates are no longer
toplevel-relative, so in some capacity the code becomes less convoluted.