summaryrefslogtreecommitdiff
diff options
-rw-r--r--.bzrignore1
-rw-r--r--data/Makefile.am18
-rw-r--r--data/applications.pngbin0 -> 1505 bytes
-rw-r--r--data/files.pngbin0 -> 789 bytes
-rw-r--r--data/gadgets.pngbin0 -> 1212 bytes
-rw-r--r--data/home.pngbin0 -> 963 bytes
-rw-r--r--data/music.pngbin0 -> 4244 bytes
-rw-r--r--data/people.pngbin0 -> 4399 bytes
-rw-r--r--data/photos.pngbin0 -> 4097 bytes
-rw-r--r--data/software_centre.pngbin0 -> 3842 bytes
-rw-r--r--data/trash.pngbin0 -> 3970 bytes
-rw-r--r--data/videos.pngbin0 -> 3977 bytes
-rw-r--r--data/web.pngbin0 -> 1647 bytes
-rw-r--r--src/places/bar-view.vala63
-rw-r--r--src/places/default-view.vala3
-rw-r--r--src/places/view.vala7
-rw-r--r--src/quicklauncher/launcher-view.vala4
-rw-r--r--src/window.vala111
18 files changed, 189 insertions, 18 deletions
diff --git a/.bzrignore b/.bzrignore
index 8697a208e..b130e93f8 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -112,3 +112,4 @@ src/quicklauncher/launcher-store.c
src/quicklauncher/launcher-view.c
src/quicklauncher/prism-handler.c
src/quicklauncher/quicklauncher-manager.c
+
diff --git a/data/Makefile.am b/data/Makefile.am
index 20161dd54..2c45f0833 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,10 +1,24 @@
+//Please keep alphabetical :-)
+
dist_default_DATA = \
+ applications.png \
+ files.png \
+ gadgets.png \
+ gradient.png \
+ home.png \
honeycomb.png \
honeycomb-mask.png \
- gradient.png \
+ music.png \
+ people.png \
+ photos.png \
quicklauncher_focused_indicator.svg \
quicklauncher_running_indicator.svg \
quicklauncher_spinner.png \
- tight_check_4px.png
+ software_centre.png \
+ tight_check_4px.png \
+ trash.png \
+ videos.png \
+ web.png
+
defaultdir = $(pkgdatadir)
diff --git a/data/applications.png b/data/applications.png
new file mode 100644
index 000000000..f3121db5e
--- /dev/null
+++ b/data/applications.png
Binary files differ
diff --git a/data/files.png b/data/files.png
new file mode 100644
index 000000000..bde64565e
--- /dev/null
+++ b/data/files.png
Binary files differ
diff --git a/data/gadgets.png b/data/gadgets.png
new file mode 100644
index 000000000..d76493517
--- /dev/null
+++ b/data/gadgets.png
Binary files differ
diff --git a/data/home.png b/data/home.png
new file mode 100644
index 000000000..6d20e5c4d
--- /dev/null
+++ b/data/home.png
Binary files differ
diff --git a/data/music.png b/data/music.png
new file mode 100644
index 000000000..408b680c2
--- /dev/null
+++ b/data/music.png
Binary files differ
diff --git a/data/people.png b/data/people.png
new file mode 100644
index 000000000..9a131bbc1
--- /dev/null
+++ b/data/people.png
Binary files differ
diff --git a/data/photos.png b/data/photos.png
new file mode 100644
index 000000000..7909b0b90
--- /dev/null
+++ b/data/photos.png
Binary files differ
diff --git a/data/software_centre.png b/data/software_centre.png
new file mode 100644
index 000000000..ced6d986c
--- /dev/null
+++ b/data/software_centre.png
Binary files differ
diff --git a/data/trash.png b/data/trash.png
new file mode 100644
index 000000000..acd2c8a8c
--- /dev/null
+++ b/data/trash.png
Binary files differ
diff --git a/data/videos.png b/data/videos.png
new file mode 100644
index 000000000..53d90b92f
--- /dev/null
+++ b/data/videos.png
Binary files differ
diff --git a/data/web.png b/data/web.png
new file mode 100644
index 000000000..af3092ce7
--- /dev/null
+++ b/data/web.png
Binary files differ
diff --git a/src/places/bar-view.vala b/src/places/bar-view.vala
index 1d9f9fd1b..d61ffc888 100644
--- a/src/places/bar-view.vala
+++ b/src/places/bar-view.vala
@@ -19,6 +19,18 @@
namespace Unity.Places.Bar
{
+ const string APPS_FILE = Unity.PKGDATADIR + "/applications.png";
+ const string FILES_FILE = Unity.PKGDATADIR + "/files.png";
+ const string GADGETS_FILE = Unity.PKGDATADIR + "/gadgets.png";
+ const string HOME_FILE = Unity.PKGDATADIR + "/home.png";
+ const string MUSIC_FILE = Unity.PKGDATADIR + "/music.png";
+ const string PEOPLE_FILE = Unity.PKGDATADIR + "/people.png";
+ const string PHOTOS_FILE = Unity.PKGDATADIR + "/photos.png";
+ const string SOFTWARECENTER_FILE = Unity.PKGDATADIR + "/software_centre.png";
+ const string TRASH_FILE = Unity.PKGDATADIR + "/trash.png";
+ const string VIDEOS_FILE = Unity.PKGDATADIR + "/videos.png";
+ const string WEB_FILE = Unity.PKGDATADIR + "/web.png";
+
public class View : Ctk.Box
{
private Gee.ArrayList<Unity.Places.Bar.Model> places;
@@ -28,7 +40,9 @@ namespace Unity.Places.Bar
Unity.Places.Bar.Model place;
int i;
Ctk.Image icon;
- int icon_size = 64;
+ int icon_size = 48;
+ Ctk.EffectGlow glow;
+ Clutter.Color white = {255, 255, 255, 255};
this.homogeneous = false;
this.spacing = icon_size/2;
@@ -38,35 +52,72 @@ namespace Unity.Places.Bar
// populate places-bar with hard-coded contents for the moment
place = new Unity.Places.Bar.Model ("Home",
- "folder-home",
+ HOME_FILE,
"Default View");
this.places.add (place);
place = new Unity.Places.Bar.Model ("Applications",
- "applications-games",
+ APPS_FILE,
"Programs installed locally");
this.places.add (place);
place = new Unity.Places.Bar.Model ("Files",
- "folder",
+ FILES_FILE,
"Your files stored locally");
this.places.add (place);
+ place = new Unity.Places.Bar.Model ("Music",
+ MUSIC_FILE,
+ "Soothing sounds and vibes");
+ this.places.add (place);
+
+ place = new Unity.Places.Bar.Model ("People",
+ PEOPLE_FILE,
+ "Friends, pals, mates and folks");
+ this.places.add (place);
+
+ place = new Unity.Places.Bar.Model ("Photos",
+ PHOTOS_FILE,
+ "Pretty pictures presented by pixels");
+ this.places.add (place);
+
place = new Unity.Places.Bar.Model ("Trash",
- "trashcan_empty",
+ TRASH_FILE,
"Your piece of waste");
this.places.add (place);
// create all image-actors for icons
for (i = 0; i < this.places.size ; i++)
{
- icon = new Ctk.Image.from_stock (icon_size, this.places[i].icon_name);
+ //icon = new Ctk.Image.from_stock (icon_size, this.places[i].icon_name);
+ icon = new Ctk.Image.from_filename (icon_size, this.places[i].icon_name);
+ icon.set_reactive (true);
+
+ glow = new Ctk.EffectGlow ();
+ glow.set_color (white);
+ glow.set_factor (1.0f);
+ icon.add_effect (glow);
+
this.pack (icon, false, false);
+ icon.enter_event.connect (this.on_enter);
+ icon.leave_event.connect (this.on_leave);
}
this.show_all ();
}
+ public bool on_enter ()
+ {
+ /* stdout.printf ("on_enter() called\n"); */
+ return false;
+ }
+
+ public bool on_leave ()
+ {
+ /* stdout.printf ("on_leave() called\n"); */
+ return false;
+ }
+
construct
{
}
diff --git a/src/places/default-view.vala b/src/places/default-view.vala
index af230ee88..01c3c0217 100644
--- a/src/places/default-view.vala
+++ b/src/places/default-view.vala
@@ -89,7 +89,8 @@ namespace Unity.Places.Default
this.secondary_label.opacity = 0;
return false;
}
- public bool on_clicked ()
+
+ public bool on_clicked ()
{
stdout.printf ("on_clicked() called\n");
return false;
diff --git a/src/places/view.vala b/src/places/view.vala
index 2d2f42f4f..c2ec860f8 100644
--- a/src/places/view.vala
+++ b/src/places/view.vala
@@ -29,15 +29,16 @@ namespace Unity.Places
{
base.allocate (box, flags);
Clutter.ActorBox child_box = { 0.0f, 0.0f, 0.0f, 0.0f };
+ int bar_icon_size = 48;
child_box.x1 = this.padding.left;
child_box.x2 = box.x2 - box.x1 - this.padding.left - this.padding.right;
child_box.y1 = this.padding.top;
- child_box.y2 = child_box.y1 + 64;
+ child_box.y2 = child_box.y1 + bar_icon_size;
this.bar_view.allocate (child_box, flags);
- child_box.y1 = this.padding.top + 64;
- child_box.y2 = box.y2 - box.y1 - this.padding.top -this.padding.bottom - 64;
+ child_box.y1 = this.padding.top + bar_icon_size;
+ child_box.y2 = box.y2 - box.y1 - this.padding.top -this.padding.bottom - bar_icon_size;
this.default_view.allocate (child_box, flags);
}
diff --git a/src/quicklauncher/launcher-view.vala b/src/quicklauncher/launcher-view.vala
index 949ed10fc..b7bf850be 100644
--- a/src/quicklauncher/launcher-view.vala
+++ b/src/quicklauncher/launcher-view.vala
@@ -431,10 +431,9 @@ namespace Unity.Quicklauncher
menuitem.activated.connect (shortcut.activated);
menuitem.activated.connect (this.close_menu);
}
-
try {
var bg_tex = new Clutter.Texture.from_file (MENU_BG_FILE);
- //bg_tex.set_opacity (38);
+ bg_tex.set_opacity (38);
bg_tex.set_repeat (true, true);
this.menu.set_texture(bg_tex);
@@ -445,7 +444,6 @@ namespace Unity.Quicklauncher
this.menu_dropshadow = new Ctk.EffectDropShadow(3, 5, 5);
this.menu.add_effect(this.menu_dropshadow);
-
this.menu.show ();
}
diff --git a/src/window.vala b/src/window.vala
index be4319ade..040f1de07 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -21,6 +21,96 @@
namespace Unity
{
+ public class PlacesBackground : Ctk.Bin
+ {
+ public Clutter.CairoTexture cairotxt;
+
+ private Ctk.EffectGlow effect_glow;
+
+ public PlacesBackground ()
+ {
+ int W = 600;
+ int H = 70;
+
+ int h1 = 32;
+ int h2 = 12;
+ int h3 = 36;
+ int X0 = 0;
+ int Y0 = h1;
+ int w0 = 4;
+ int w1 = 44;
+ int cp0 = 12;
+ int cp1 = 4;
+
+ cairotxt = new Clutter.CairoTexture(W, H);
+ Cairo.Context cairoctx = cairotxt.create();
+ {
+ cairoctx.scale (1.0f, 1.0f);
+ cairoctx.set_operator (Cairo.Operator.CLEAR);
+ cairoctx.paint ();
+ cairoctx.set_operator (Cairo.Operator.OVER);
+ cairoctx.set_source_rgba (1.0f, 1.0f, 1.0f, 1.0f);
+ cairoctx.move_to (X0, Y0);
+ cairoctx.line_to (X0+w0, Y0);
+
+ cairoctx.curve_to (
+ X0+w0+cp0, Y0,
+ X0+w0+cp0, Y0,
+ X0+w0+cp0, Y0-cp0);
+
+ X0 = X0+w0+cp0;
+ Y0 = Y0-cp0;
+ cairoctx.line_to (X0, Y0-h2);
+ cairoctx.curve_to (X0, Y0-h2-cp1,
+ X0, Y0-h2-cp1,
+ X0+cp1, Y0-h2-cp1);
+ X0 = X0+cp1;
+ Y0 = Y0-h2-cp1;
+
+ cairoctx.line_to (X0+w1, Y0);
+ cairoctx.curve_to (X0+w1+cp1, Y0,
+ X0+w1+cp1, Y0,
+ X0+w1+cp1, Y0+cp1);
+ X0 = X0+w1+cp1;
+ Y0 = Y0+cp1;
+
+ cairoctx.line_to (X0, Y0+h3);
+ cairoctx.curve_to (X0, Y0+h3+cp0,
+ X0, Y0+h3+cp0,
+ X0+cp0, Y0+h3+cp0);
+
+ X0 = X0+cp0;
+ Y0 = Y0+h3+cp0;
+
+ cairoctx.line_to (X0 + 408, Y0);
+ cairoctx.curve_to (X0 + 408 + 80, Y0,
+ X0 + 408+80, Y0-80,
+ X0 + 408+80, Y0-80);
+
+ cairoctx.stroke ();
+ }
+
+ cairotxt.set_opacity (0xFF);
+ this.add_actor (cairotxt);
+
+ effect_glow = new Ctk.EffectGlow ();
+ Clutter.Color c = Clutter.Color ()
+ {
+ red = 255,
+ green = 255,
+ blue = 255,
+ alpha = 255
+ };
+
+ effect_glow.set_color (c);
+ effect_glow.set_factor (1.0f);
+ this.add_effect (effect_glow);
+ }
+
+ construct
+ {
+ }
+ }
public class UnderlayWindow : Gtk.Window, Shell
{
@@ -39,6 +129,11 @@ namespace Unity
private Quicklauncher.View quicklauncher;
private Unity.Places.View places;
+ private PlacesBackground placesbackground;
+ /* These parameters are temporary until we get the right metrics for the places bar */
+ private int PlacesDecorationOffsetX;
+ private int PlacesDecorationOffsetY;
+
public UnderlayWindow (bool popup, int width, int height)
{
Object(is_popup: popup, popup_width: width, popup_height: height);
@@ -121,7 +216,15 @@ namespace Unity
this.places = new Unity.Places.View ();
this.stage.add_actor (this.quicklauncher);
this.stage.add_actor (this.places);
-
+
+ /* Places Background */
+ PlacesDecorationOffsetX = 6;
+ PlacesDecorationOffsetY = 6;
+
+ this.placesbackground = new PlacesBackground ();
+ this.stage.add_actor (this.placesbackground);
+ this.placesbackground.show ();
+
/* Layout everything */
this.move (0, 0);
this.relayout ();
@@ -183,8 +286,10 @@ namespace Unity
height -
this.workarea_size.top -
this.workarea_size.bottom);
- this.places.set_position (this.workarea_size.left + 54,
- this.workarea_size.top);
+ this.places.set_position (this.workarea_size.left + 54 + PlacesDecorationOffsetX,
+ this.workarea_size.top + PlacesDecorationOffsetY);
+
+ this.placesbackground.set_position (this.workarea_size.left + 58, this.workarea_size.top);
}
public override void show ()