Permalink
Browse files

Some work on overview in HTL and VTL views.

  • Loading branch information...
1 parent b1bed3c commit 1bd83c18cd6708a0d189566b893d011ad898695d @cando committed May 13, 2012
Showing with 521 additions and 93 deletions.
  1. +41 −2 data/gtk-style.css
  2. +66 −40 src/app.vala
  3. +10 −8 src/loading.vala
  4. +4 −2 src/selectionbar.vala
  5. +378 −37 src/timelineview.vala
  6. +18 −0 src/utils.vala
  7. +4 −4 src/zg-backend.vala
View
@@ -2,6 +2,14 @@
@define-color journal_timeline_color darker(@theme_bg_color);
@define-color journal_label_color shade (@theme_bg_color, 0.9);
+GtkDrawingArea {
+ background-color: alpha(#000, 0.0);
+}
+
+GtkNotebook{
+ background-color: alpha(#000, 0.0);
+}
+
/* DAY VIEW STYLE */
.dayview {
background-color: @journal_label_color;
@@ -36,8 +44,34 @@
color: @journal_roundbox_bg_color;
}
-GtkDrawingArea {
- background-color: alpha(#000, 0.0);
+/*TIMELINE FILTER*/
+
+GtkScale.mark {
+ color: @theme_fg_color;
+}
+
+.vtimenav GtkButton {
+ background-color: @journal_label_color;
+ border-image: none;
+ background-image: none;
+ padding: 10px;
+ border-bottom-right-radius: 10px;
+ border-top-right-radius: 10px;
+}
+
+.htimenav GtkButton{
+ background-color: @journal_label_color;
+ border-image: none;
+ background-image: none;
+ padding: 10px;
+ border-top-left-radius: 10px;
+ border-top-right-radius: 10px;
+}
+
+@define-color journal_label_hover_color lighter (@journal_label_color);
+.vtimenav GtkButton:hover,
+.htimenav GtkButton:hover{
+ background-color: @journal_label_hover_color;
}
/* OSD STYLE */
@@ -112,3 +146,8 @@ GtkDrawingArea {
border-width: 0;
}
+.frame {
+ color: lighter (@theme_fg_color);
+ border-style: none;
+ border-width: 0;
+}
View
@@ -2,7 +2,6 @@
using Gtk;
public class Journal.App: GLib.Object {
- public Clutter.Actor actor { get { return stage; } }
public Gtk.ApplicationWindow window;
public bool fullscreen {
get { return Gdk.WindowState.FULLSCREEN in window.get_window ().get_state (); }
@@ -15,22 +14,23 @@ public class Journal.App: GLib.Object {
}
private bool maximized { get { return Gdk.WindowState.MAXIMIZED in window.get_window ().get_state (); } }
public Gtk.Notebook notebook;
- public Gtk.Box main_box;
- public GtkClutter.Embed embed;
- public Clutter.Stage stage;
+ public Gtk.Box main_box;
public Clutter.Actor box; // the whole app box
public GLib.SimpleAction action_fullscreen;
public uint duration;
private Gtk.Application application;
- private Clutter.BoxLayout box_table;
- private LoadingActor loading_actor;
private DayView day_view;
- private ClutterRoundBoxView crv;
- private GtkRoundBoxView grv;
+ private ClutterVTL cvtl;
+ private ClutterHTL chtl;
+ private GtkVTL gvtl;
private ReminderView reminder_view;
private Revealer revealer;
private Gd.MainToolbar main_toolbar;
+
+ //Loading actor
+ private LoadingActor loading;
+ private LoadingActor loading2;
private ZeitgeistBackend _backend;
@@ -94,7 +94,6 @@ public class Journal.App: GLib.Object {
application.activate.connect_after ((app) => {
window.present ();
});
-
}
public int run () {
@@ -118,6 +117,7 @@ public class Journal.App: GLib.Object {
window = new Gtk.ApplicationWindow (application);
window.show_menubar = false;
window.hide_titlebar_when_maximized = true;
+ window.set_default_size (840, 680);
// restore window geometry/position
var size = Utils.settings.get_value ("window-size");
@@ -159,14 +159,14 @@ public class Journal.App: GLib.Object {
if (mode) {
this.main_toolbar.set_mode (Gd.MainToolbarMode.SELECTION);
main_toolbar.set_labels (null, _("(Click on items to select them)"));
- //revealer.reveal ();
+ revealer.reveal ();
}
else {
main_toolbar.set_mode (Gd.MainToolbarMode.OVERVIEW);
int num_days = 3;
string label = _(@"Last $num_days days");
main_toolbar.set_labels (_("Timeline"), label);
- //revealer.unreveal ();
+ revealer.unreveal ();
}
});
notebook = new Gtk.Notebook ();
@@ -176,47 +176,73 @@ public class Journal.App: GLib.Object {
main_box.pack_start (main_toolbar, false, false, 0);
main_box.pack_start (notebook, true, true, 0);
+ window.delete_event.connect (() => { return quit (); });
+ window.key_press_event.connect (on_key_pressed);
+
+ //CLUTTER VTL
+ var embed = new GtkClutter.Embed ();
+ var stage = embed.get_stage () as Clutter.Stage;
+ stage.set_color (Utils.gdk_rgba_to_clutter_color (Utils.get_journal_bg_color ()));
+ cvtl = new ClutterVTL (this, stage);
+ TimeNav vnav = new TimeNav (Orientation.VERTICAL);
+ vnav.go_to_date.connect ((date) => {cvtl.jump_to_day(date);});
+
+ stage.add_actor (cvtl.viewport);
+ var box = new Box (Orientation.HORIZONTAL, 0);
+ box.pack_start (vnav, false, false, 0);
+ box.pack_start (embed, true, true, 0);
+ notebook.append_page (box, null);
+
+ loading = new LoadingActor (this, stage);
+ loading.start ();
+ //CLUTTER HTL
+ var embed2 = new GtkClutter.Embed ();
+ var stage2 = embed2.get_stage () as Clutter.Stage;
+ stage2.set_color (Utils.gdk_rgba_to_clutter_color (Utils.get_journal_bg_color ()));
+ chtl = new ClutterHTL (this, stage2);
+ TimeNav hnav = new TimeNav (Orientation.HORIZONTAL);
+ hnav.go_to_date.connect ((date) => {chtl.jump_to_day(date);});
+
+ stage2.add_actor (chtl.viewport);
+ var box2 = new Grid ();
+ box2.orientation = Orientation.VERTICAL;
+ box2.add (embed2);
+ box2.add (hnav);
+ notebook.append_page (box2, null);
+
+ loading2 = new LoadingActor (this, stage2);
+ loading2.start ();
+ //GTK VTL FIXME doesn't work!
+ gvtl = new GtkVTL (this);
+ ScrolledWindow sw = new ScrolledWindow (null, null);
+ sw.set_policy (PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
+ sw.add_with_viewport (gvtl);
+ //notebook.append_page (sw, null);
+
+ //THREE COLUMN VIEW
//FIXME Make the num of days displayed a preferences??
int num_days = 3;
day_view = new DayView (this, num_days);
-// revealer = new Revealer ();
-// reminder_view = new ReminderView (this);
-// reminder_view.set_hexpand (false);
-// revealer.add (reminder_view);
+ string label = _(@"Last $num_days days");
+ main_toolbar.set_labels (_("Timeline"), label);
+
+ revealer = new Revealer ();
+ reminder_view = new ReminderView (this);
+ reminder_view.set_hexpand (false);
+ revealer.add (reminder_view);
var grid = new Grid ();
grid.set_orientation (Orientation.HORIZONTAL);
grid.add (day_view);
- //grid.add (revealer);
+ grid.add (revealer);
notebook.append_page (grid, null);
- string label = _(@"Last $num_days days");
- main_toolbar.set_labels (_("Timeline"), label);
-
- embed = new GtkClutter.Embed ();
- notebook.append_page (embed, null);
- stage = embed.get_stage () as Clutter.Stage;
- stage.set_color (Utils.gdk_rgba_to_clutter_color (Utils.get_journal_bg_color ()));
-
- window.delete_event.connect (() => { return quit (); });
- window.key_press_event.connect (on_key_pressed);
+ window.show_all();
- crv = new ClutterRoundBoxView (this);
- grv = new GtkRoundBoxView (this);
- ScrolledWindow sw = new ScrolledWindow (null, null);
- sw.set_policy (PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
- sw.add_with_viewport (grv);
- notebook.append_page (sw, null);
-
- loading_actor = new LoadingActor(this);
- loading_actor.start ();
-
-
- main_box.show_all ();
-// revealer.set_no_show_all (true);
-// revealer.hide ();
+ revealer.set_no_show_all (true);
+ revealer.hide ();
}
public bool quit () {
View
@@ -3,28 +3,30 @@ using Cairo;
private class Journal.LoadingActor: GLib.Object {
private App app;
+ private Clutter.Stage stage;
private GtkClutter.Actor gtk_actor_box;
private GtkClutter.Actor gtk_actor_throbber;
private Box box;
private Spinner throbber;
- public LoadingActor (App app) {
+ public LoadingActor (App app, Clutter.Stage stage) {
this.app = app;
+ this.stage = stage;
box = new Box(Orientation.VERTICAL, 0);
throbber = new Spinner ();
- throbber.set_size_request((int)app.stage.height/3, (int)app.stage.height/3);
+ throbber.set_size_request((int)stage.height/3, (int)stage.height/3);
gtk_actor_box = new GtkClutter.Actor.with_contents (box);
- gtk_actor_box.opacity = 235;
+ gtk_actor_box.opacity = 200;
gtk_actor_throbber = new GtkClutter.Actor.with_contents (throbber);
gtk_actor_throbber.get_widget ().get_style_context ().add_class ("throbber");
- gtk_actor_throbber.add_constraint (new Clutter.AlignConstraint (app.stage, Clutter.AlignAxis.X_AXIS, 0.5f));
- gtk_actor_throbber.add_constraint (new Clutter.AlignConstraint (app.stage, Clutter.AlignAxis.Y_AXIS, 0.5f));
- gtk_actor_box.add_constraint (new Clutter.BindConstraint (app.stage, Clutter.BindCoordinate.SIZE, 0));
- app.stage.add_actor (gtk_actor_box);
- app.stage.add_actor (gtk_actor_throbber);
+ gtk_actor_throbber.add_constraint (new Clutter.AlignConstraint (stage, Clutter.AlignAxis.X_AXIS, 0.5f));
+ gtk_actor_throbber.add_constraint (new Clutter.AlignConstraint (stage, Clutter.AlignAxis.Y_AXIS, 0.5f));
+ gtk_actor_box.add_constraint (new Clutter.BindConstraint (stage, Clutter.BindCoordinate.SIZE, 0));
+ stage.add_actor (gtk_actor_box);
+ stage.add_actor (gtk_actor_throbber);
app.backend.events_loaded.connect ( () => {
stop ();
View
@@ -7,15 +7,17 @@ private class Journal.Selectionbar: GLib.Object {
public static const float spacing = 60.0f;
private App app;
+ private Clutter.Stage stage;
private GtkClutter.Actor gtk_actor;
private Gtk.Toolbar toolbar;
private Gtk.ToggleToolButton favorite_btn;
private Gtk.ToggleToolButton remove_btn;
private bool _visible;
- public Selectionbar (App app) {
+ public Selectionbar (App app, Clutter.Stage stage) {
this.app = app;
+ this.stage = stage;
_visible = false;
@@ -46,7 +48,7 @@ private class Journal.Selectionbar: GLib.Object {
toggle_visible ();
});
- app.stage.add_actor (actor);
+ stage.add_actor (actor);
}
public void toggle_visible () {
Oops, something went wrong.

0 comments on commit 1bd83c1

Please sign in to comment.