Commit 334a2a60 authored by Jens Georg's avatar Jens Georg

extended: Move info to sidebar

https://bugzilla.gnome.org/show_bug.cgi?id=716192
parent e5bd4a0c
This diff is collapsed.
......@@ -6,6 +6,7 @@
public class LibraryWindow : AppWindow {
public const int SIDEBAR_MIN_WIDTH = 120;
public const int EXTENDED_INFO_MIN_WIDTH = 360;
public static int PAGE_MIN_WIDTH {
get {
......@@ -143,7 +144,8 @@ public class LibraryWindow : AppWindow {
private bool background_progress_displayed = false;
private BasicProperties basic_properties = new BasicProperties();
private ExtendedPropertiesWindow extended_properties;
private ExtendedProperties extended_properties = new ExtendedProperties();
private Gtk.Revealer extended_properties_revealer = new Gtk.Revealer();
private Gtk.Stack stack = new Gtk.Stack();
private Gtk.Box layout = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
......@@ -180,11 +182,6 @@ public class LibraryWindow : AppWindow {
sidebar_tree.graft(saved_search_branch, SidebarRootPosition.SAVED_SEARCH);
sidebar_tree.graft(import_roll_branch, SidebarRootPosition.IMPORT_ROLL);
// create and connect extended properties window
extended_properties = new ExtendedPropertiesWindow(this);
extended_properties.hide.connect(hide_extended_properties);
extended_properties.show.connect(show_extended_properties);
properties_scheduler = new OneShotScheduler("LibraryWindow properties",
on_update_properties_now);
......@@ -240,9 +237,6 @@ public class LibraryWindow : AppWindow {
unsubscribe_from_basic_information(get_current_page());
extended_properties.hide.disconnect(hide_extended_properties);
extended_properties.show.disconnect(show_extended_properties);
foreach (MediaSourceCollection media_sources in MediaCollectionRegistry.get_instance().get_all()) {
media_sources.trashcan_contents_altered.disconnect(on_trashcan_contents_altered);
media_sources.items_altered.disconnect(on_media_altered);
......@@ -710,12 +704,11 @@ public class LibraryWindow : AppWindow {
if (display) {
extended_properties.update_properties(get_current_page());
extended_properties.show_all();
} else {
extended_properties.hide();
}
extended_properties_revealer.set_reveal_child(display);
action.set_state (value);
Config.Facade.get_instance().set_display_extended_properties(display);
}
private void on_display_searchbar(GLib.SimpleAction action, Variant? value) {
......@@ -773,22 +766,6 @@ public class LibraryWindow : AppWindow {
return Config.Facade.get_instance ().get_display_toolbar ();
}
private void show_extended_properties() {
sync_extended_properties(true);
}
private void hide_extended_properties() {
sync_extended_properties(false);
}
private void sync_extended_properties(bool show) {
var action = this.lookup_action ("CommonDisplayExtendedProperties");
action.change_state (show);
// sync the setting so it will persist
Config.Facade.get_instance().set_display_extended_properties(show);
}
public void enqueue_batch_import(BatchImport batch_import, bool allow_user_cancel) {
library_branch.import_queue_entry.enqueue_and_schedule(batch_import, allow_user_cancel);
}
......@@ -1209,7 +1186,9 @@ public class LibraryWindow : AppWindow {
right_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
right_vbox.pack_start(search_toolbar, false, false, 0);
right_vbox.pack_start(stack, true, true, 0);
var stack_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
stack_box.pack_start(stack, true, true, 0);
right_vbox.pack_start(stack_box, true, true, 0);
right_vbox.add (toolbar_revealer);
client_paned = new Gtk.Paned(Gtk.Orientation.HORIZONTAL);
......@@ -1219,6 +1198,29 @@ public class LibraryWindow : AppWindow {
client_paned.set_position(Config.Facade.get_instance().get_sidebar_position());
// TODO: Calc according to layout's size, to give sidebar a maximum width
stack.set_size_request(PAGE_MIN_WIDTH, -1);
var scrolled = new Gtk.ScrolledWindow(null, null);
scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
scrolled.add(extended_properties);
extended_properties_revealer.add(scrolled);
extended_properties_revealer.set_transition_type(Gtk.RevealerTransitionType.SLIDE_LEFT);
extended_properties_revealer.halign = Gtk.Align.END;
extended_properties_revealer.valign = Gtk.Align.FILL;
extended_properties.vexpand = true;
extended_properties.set_margin_top (3);
extended_properties.set_margin_bottom (3);
extended_properties.set_margin_start (3);
extended_properties.set_margin_end (3);
scrolled.set_size_request(EXTENDED_INFO_MIN_WIDTH, -1);
stack_box.pack_end(extended_properties_revealer, false, false, 0);
extended_properties_revealer.halign = Gtk.Align.END;
extended_properties_revealer.hexpand = false;
if (Config.Facade.get_instance().get_display_extended_properties()) {
extended_properties_revealer.set_reveal_child(true);
} else {
extended_properties_revealer.set_reveal_child(false);
}
layout.pack_end(client_paned, true, true, 0);
......
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