Skip to content

Commit 0b47f7c

Browse files
committed
Fix overlay for proper composition in GTK4
1 parent 36d04dd commit 0b47f7c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/MainView.vala

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
*
1919
*/
2020

21-
public class Obliviate.MainView : Gtk.Overlay {
21+
public class Obliviate.MainView : Gtk.Box {
22+
private Gtk.Overlay overlay;
2223
private Gtk.Grid grid;
2324
private Granite.Toast toast;
2425

@@ -35,6 +36,8 @@ public class Obliviate.MainView : Gtk.Overlay {
3536
private uint timeout_id;
3637

3738
construct {
39+
overlay = new Gtk.Overlay();
40+
3841
grid = new Gtk.Grid () {
3942
row_spacing = 4,
4043
column_spacing = 4,
@@ -47,8 +50,8 @@ public class Obliviate.MainView : Gtk.Overlay {
4750

4851
var toast = new Granite.Toast (_ ("Copied to clipboard"));
4952

50-
set_child (grid);
51-
add_overlay (toast);
53+
overlay.set_child (grid);
54+
overlay.add_overlay (toast);
5255

5356
var site_label = new Gtk.Label (_ ("Site:")) {
5457
halign = Gtk.Align.END,
@@ -143,6 +146,8 @@ public class Obliviate.MainView : Gtk.Overlay {
143146
grid.attach_next_to (button_box, generated_pass, Gtk.PositionType.BOTTOM);
144147

145148
clipboard = this.get_clipboard ();
149+
150+
append (overlay);
146151
}
147152

148153
private void handle_generate_password () {

0 commit comments

Comments
 (0)