Skip to content

Commit

Permalink
feat(FocusPicture): bump (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeopJr and bugaevc authored Dec 14, 2024
1 parent 3dc4011 commit 19d7f86
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/Widgets/FocusPicture.vala
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ public class Tuba.Widgets.FocusPicture : Gtk.Widget, Gtk.Buildable, Gtk.Accessib
set {
if (_content_fit == value) return;

bool queue_resize = value == Gtk.ContentFit.SCALE_DOWN || _content_fit == Gtk.ContentFit.SCALE_DOWN;
_content_fit = value;
this.queue_draw ();

if (queue_resize) {
this.queue_resize ();
} else {
this.queue_draw ();
}
}
}

Expand Down Expand Up @@ -193,6 +199,19 @@ public class Tuba.Widgets.FocusPicture : Gtk.Widget, Gtk.Buildable, Gtk.Accessib
);
}

if (for_size > 0 && _content_fit == Gtk.ContentFit.SCALE_DOWN) {
int opposite_intrinsic_size = 0;
if (orientation == Gtk.Orientation.HORIZONTAL) {
opposite_intrinsic_size = _paintable.get_intrinsic_height ();
} else {
opposite_intrinsic_size = _paintable.get_intrinsic_width ();
}

if (opposite_intrinsic_size != 0 && opposite_intrinsic_size < for_size) {
for_size = opposite_intrinsic_size;
}
}

if (orientation == Gtk.Orientation.HORIZONTAL) {
_paintable.compute_concrete_size (
0,
Expand Down

0 comments on commit 19d7f86

Please sign in to comment.