Commit 3c5b4f56 authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko

display-box: Put the game into a DisplayBin

And change its offsets when the sidebar slides out. This way the game can
never change the height and instead overflows off the screen.

Also, this allows to remove the special-casing for narrow window, since
this behavior works with narrow windows too.
parent eb7f6ae8
Pipeline #104597 passed with stages
in 16 minutes and 19 seconds
......@@ -28,7 +28,7 @@
<object class="GtkOverlay" id="display_overlay">
<property name="visible">True</property>
<child>
<object class="GtkEventBox" id="display_bin">
<object class="GamesDisplayBin" id="display_bin">
<property name="visible">True</property>
<property name="hexpand">True</property>
</object>
......
......@@ -59,7 +59,7 @@ private class Games.DisplayBox : Gtk.Bin {
[GtkChild]
private Gtk.Overlay display_overlay;
[GtkChild]
private Gtk.EventBox display_bin;
private DisplayBin display_bin;
[GtkChild]
private DisplayHeaderBar fullscreen_header_bar;
[GtkChild]
......@@ -147,11 +147,8 @@ private class Games.DisplayBox : Gtk.Bin {
}
private void update_margin () {
var width = get_allocated_width ();
display_bin.margin_start = 0;
if (width > 900)
display_bin.margin_end = savestates_list.get_allocated_width ();
else
display_bin.margin_end = 0;
var width = savestates_list.get_allocated_width ();
display_bin.horizontal_offset = -width / 2;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment