Commit fd30d580 authored by Jim Nelson's avatar Jim Nelson

#294: Off-white sidebar. #88: Blue photo selection color.

parent 6ca26236
......@@ -203,6 +203,7 @@ public class AppWindow : Gtk.Window {
Thumbnail.MAX_SCALE + CollectionLayout.LEFT_PADDING + CollectionLayout.RIGHT_PADDING;
public static Gdk.Color BG_COLOR = parse_color("#444");
public static Gdk.Color SIDEBAR_BG_COLOR = parse_color("#EEE");
public static const long EVENT_LULL_SEC = 3 * 60 * 60;
public static const long EVENT_MAX_DURATION_SEC = 12 * 60 * 60;
......@@ -872,6 +873,8 @@ public class AppWindow : Gtk.Window {
notebook.set_show_tabs(false);
notebook.set_show_border(false);
sidebar.modify_base(Gtk.StateType.NORMAL, SIDEBAR_BG_COLOR);
// put the sidebar in a scrolling window
Gtk.ScrolledWindow scrolled_sidebar = new Gtk.ScrolledWindow(null, null);
scrolled_sidebar.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
......
......@@ -3,7 +3,7 @@ public abstract class LayoutItem : Gtk.Alignment {
public static const int LABEL_PADDING = 4;
public static const int FRAME_PADDING = 4;
public static const string TEXT_COLOR = "#FFF";
public static const string SELECTED_COLOR = "#FF0";
public static const string SELECTED_COLOR = "#0FF";
public static const string UNSELECTED_COLOR = "#FFF";
// Due to the potential for thousands or tens of thousands of thumbnails being present in the
......
......@@ -241,7 +241,8 @@ public class CollectionPage : CheckerboardPage {
}
private override void drag_begin(Gdk.DragContext context) {
assert(get_selected_count() != 0);
if (get_selected_count() == 0)
return;
drag_items.clear();
......
......@@ -182,6 +182,22 @@ public abstract class Page : Gtk.ScrolledWindow {
dnd_enabled = true;
}
public void disable_drag_source() {
if (!dnd_enabled)
return;
assert(event_source != null);
event_source.drag_begin -= on_drag_begin;
event_source.drag_data_get -= on_drag_data_get;
event_source.drag_data_delete -= on_drag_data_delete;
event_source.drag_end -= on_drag_end;
event_source.drag_failed -= on_drag_failed;
Gtk.drag_source_unset(event_source);
dnd_enabled = false;
}
public bool is_dnd_enabled() {
return dnd_enabled;
}
......@@ -579,7 +595,7 @@ public abstract class CheckerboardPage : Page {
// Return true to block the DnD handler, false otherwise
if (!is_dnd_enabled())
return false;
return selected_items.size == 0;
}
......@@ -591,7 +607,7 @@ public abstract class CheckerboardPage : Page {
LayoutItem item = get_item_at(event.x, event.y);
if (item == null) {
// released button on "dead" area
return false;
return true;
}
if (last_clicked_item != item) {
......
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