Skip to content

Commit 838631e

Browse files
committed
Changed overview layout
On Fedora 25 with wayland, the sizing of the overview window did not worked. This resulted in a too heigh overview window (thus moving the bottom_row out of the screen). Changed the way the overview size is set and changed scrolledwindow policy to always use scroll bars. Without this "always scroll" option the size of the inner widget of the scrolledwindow resulted in the out of screen bug.
1 parent f19307b commit 838631e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/classes/window/overview.vala

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ namespace pdfpc.Window {
131131
this.slides = new Gtk.ListStore(1, typeof(int));
132132
this.slides_view = new Gtk.IconView.with_model(this.slides);
133133
this.slides_view.selection_mode = Gtk.SelectionMode.SINGLE;
134+
this.slides_view.halign = Gtk.Align.CENTER;
134135
this.renderer = new CellRendererHighlight();
135136
this.renderer.metadata = metadata;
136137
this.slides_view.pack_start(renderer, true);
@@ -234,14 +235,13 @@ namespace pdfpc.Window {
234235
} else {
235236
this.slides_view.columns = tc;
236237
}
237-
this.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
238+
this.set_policy(Gtk.PolicyType.ALWAYS, Gtk.PolicyType.ALWAYS);
238239
this.target_height = (int)Math.round(this.target_width / aspect_ratio);
239240
rows = (int)Math.ceil((float)this.n_slides / this.slides_view.columns);
240241
int full_height = rows*(this.target_height + 2*padding + 2*row_spacing) + 2*margin;
241242
if (full_height > this.max_height) {
242243
full_height = this.max_height;
243244
}
244-
this.set_size_request(-1, full_height);
245245

246246
this.last_structure_n_slides = this.n_slides;
247247

src/classes/window/presenter.vala

+2-3
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ namespace pdfpc.Window {
301301
this.slide_count = metadata.get_slide_count();
302302

303303
this.overview = new Overview(this.metadata, this.presentation_controller, this);
304+
this.overview.vexpand = true;
305+
this.overview.hexpand = true;
304306
this.overview.set_n_slides(this.presentation_controller.user_n_slides);
305307
this.presentation_controller.set_overview(this.overview);
306308
this.presentation_controller.register_controllable(this);
@@ -342,9 +344,6 @@ namespace pdfpc.Window {
342344
nextViewWithNotes.pack_start(notes_sw, true, true, 5);
343345
slide_views.pack_start(nextViewWithNotes, true, true, 0);
344346

345-
this.overview.halign = Gtk.Align.CENTER;
346-
this.overview.valign = Gtk.Align.CENTER;
347-
348347
this.slide_stack = new Gtk.Stack();
349348
this.slide_stack.add_named(slide_views, "slides");
350349
this.slide_stack.add_named(this.overview, "overview");

0 commit comments

Comments
 (0)