Skip to content

Commit e5fc01c

Browse files
danirabbitJeremy Wootten
andauthored
Window: DynamicNotebook → Hdy.TabBar (#2256)
Co-authored-by: Jeremy Wootten <[email protected]>
1 parent 7bd542f commit e5fc01c

File tree

2 files changed

+295
-183
lines changed

2 files changed

+295
-183
lines changed

src/Application.vala

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,17 @@ public class Files.Application : Gtk.Application {
298298
prefs, "sort-directories-first", GLib.SettingsBindFlags.DEFAULT);
299299
}
300300

301+
public View.Window? create_empty_window () {
302+
if (this.get_windows ().length () >= MAX_WINDOWS) { //Can be assumed to be limited in length
303+
return null;
304+
}
305+
306+
var win = new View.Window (this);
307+
add_window (win as Gtk.Window);
308+
plugins.interface_loaded (win as Gtk.Widget);
309+
return win;
310+
}
311+
301312
public View.Window? create_window (GLib.File? location = null,
302313
ViewMode viewmode = ViewMode.PREFERRED) {
303314

@@ -308,13 +319,7 @@ public class Files.Application : Gtk.Application {
308319
private View.Window? create_window_with_tabs (GLib.File[] locations = {},
309320
ViewMode viewmode = ViewMode.PREFERRED) {
310321

311-
if (this.get_windows ().length () >= MAX_WINDOWS) { //Can be assumed to be limited in length
312-
return null;
313-
}
314-
315-
var win = new View.Window (this);
316-
add_window (win as Gtk.Window);
317-
plugins.interface_loaded (win as Gtk.Widget);
322+
var win = create_empty_window ();
318323
win.open_tabs (locations, viewmode);
319324

320325
return win;

0 commit comments

Comments
 (0)