summaryrefslogtreecommitdiff
diff options
-rw-r--r--lockscreen/BackgroundSettings.h4
-rw-r--r--lockscreen/BackgroundSettingsGnome.cpp24
-rw-r--r--lockscreen/BackgroundSettingsGnome.h4
-rw-r--r--lockscreen/LockScreenShield.cpp4
-rw-r--r--lockscreen/StandaloneLockScreen.cpp2
-rw-r--r--resources/logo.pngbin0 -> 4158 bytes
-rw-r--r--unity-shared/UScreen.cpp6
7 files changed, 34 insertions, 10 deletions
diff --git a/lockscreen/BackgroundSettings.h b/lockscreen/BackgroundSettings.h
index f83e97d2b..50d821599 100644
--- a/lockscreen/BackgroundSettings.h
+++ b/lockscreen/BackgroundSettings.h
@@ -35,7 +35,9 @@ class BackgroundSettings
public:
virtual ~BackgroundSettings() {};
- virtual BaseTexturePtr GetBackgroundTexture(nux::Size const& size, bool draw_grid) = 0;
+ virtual BaseTexturePtr GetBackgroundTexture(nux::Size const& size,
+ bool draw_grid,
+ bool draw_logo) = 0;
sigc::signal<void> bg_changed;
};
diff --git a/lockscreen/BackgroundSettingsGnome.cpp b/lockscreen/BackgroundSettingsGnome.cpp
index 9a81ac9aa..45b9f1206 100644
--- a/lockscreen/BackgroundSettingsGnome.cpp
+++ b/lockscreen/BackgroundSettingsGnome.cpp
@@ -21,6 +21,7 @@
#include <libgnome-desktop/gnome-bg.h>
+#include "config.h"
#include "unity-shared/GtkTexture.h"
namespace unity
@@ -51,12 +52,33 @@ int get_grid_offset (int size)
}
-BaseTexturePtr BackgroundSettingsGnome::GetBackgroundTexture(nux::Size const& size, bool draw_grid)
+BaseTexturePtr BackgroundSettingsGnome::GetBackgroundTexture(nux::Size const& size,
+ bool draw_grid,
+ bool draw_logo)
{
cairo_surface_t* cairo_surface = gnome_bg_create_surface(gnome_bg_, gdk_get_default_root_window(),
size.width, size.height, FALSE);
cairo_t* c = cairo_create(cairo_surface);
+ if (draw_logo)
+ {
+ int grid_x_offset = get_grid_offset(size.width);
+ int grid_y_offset = get_grid_offset(size.height);
+
+ cairo_save(c);
+
+ int height = 22;
+ int padding = 10;
+ int x = grid_x_offset + GRID_SIZE + padding;
+ int y = grid_y_offset + GRID_SIZE * (size.height / GRID_SIZE - 1) - height - padding;
+ cairo_translate (c, x, y);
+
+ cairo_surface_t* logo_surface = cairo_image_surface_create_from_png (PKGDATADIR"/logo.png");
+ cairo_set_source_surface(c, logo_surface, 0, 0);
+ cairo_paint_with_alpha(c, 0.5);
+ cairo_restore(c);
+ }
+
if (draw_grid)
{
int width = size.width;
diff --git a/lockscreen/BackgroundSettingsGnome.h b/lockscreen/BackgroundSettingsGnome.h
index 7531bdd9a..2d45184c5 100644
--- a/lockscreen/BackgroundSettingsGnome.h
+++ b/lockscreen/BackgroundSettingsGnome.h
@@ -37,7 +37,9 @@ class BackgroundSettingsGnome : public BackgroundSettings
public:
BackgroundSettingsGnome();
- BaseTexturePtr GetBackgroundTexture(nux::Size const& size, bool draw_grid) override;
+ BaseTexturePtr GetBackgroundTexture(nux::Size const& size,
+ bool draw_grid,
+ bool draw_logo) override;
private:
glib::Object<_GnomeBG> gnome_bg_;
diff --git a/lockscreen/LockScreenShield.cpp b/lockscreen/LockScreenShield.cpp
index c30a3b26d..53f4d596e 100644
--- a/lockscreen/LockScreenShield.cpp
+++ b/lockscreen/LockScreenShield.cpp
@@ -17,8 +17,6 @@
* Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
*/
-#include "config.h"
-
#include "LockScreenShield.h"
#include "BackgroundSettingsGnome.h" // FIXME: remove this
@@ -59,7 +57,7 @@ Shield::Shield(bool is_primary)
void Shield::UpdateBackgroundTexture()
{
- auto background_texture = bg_settings_->GetBackgroundTexture(nux::Size(GetBaseWidth(), GetBaseHeight()), true);
+ auto background_texture = bg_settings_->GetBackgroundTexture(nux::Size(GetBaseWidth(), GetBaseHeight()), true, true);
background_layer_.reset(new nux::TextureLayer(background_texture->GetDeviceTexture(), nux::TexCoordXForm(), nux::color::White, true));
SetBackgroundLayer(background_layer_.get());
}
diff --git a/lockscreen/StandaloneLockScreen.cpp b/lockscreen/StandaloneLockScreen.cpp
index 43f50f1b3..b33d58114 100644
--- a/lockscreen/StandaloneLockScreen.cpp
+++ b/lockscreen/StandaloneLockScreen.cpp
@@ -52,7 +52,7 @@ public:
struct LockScreenWindow
{
LockScreenWindow()
- : wt(nux::CreateGUIThread("Unity LockScreen Controller", 1024, 300, 0, &LockScreenWindow::ThreadWidgetInit, this))
+ : wt(nux::CreateGUIThread("Unity LockScreen Controller", 1400, 600, 0, &LockScreenWindow::ThreadWidgetInit, this))
, animation_controller(tick_source)
{}
diff --git a/resources/logo.png b/resources/logo.png
new file mode 100644
index 000000000..ddc0af02c
--- /dev/null
+++ b/resources/logo.png
Binary files differ
diff --git a/unity-shared/UScreen.cpp b/unity-shared/UScreen.cpp
index 4a52331ac..2e46e2223 100644
--- a/unity-shared/UScreen.cpp
+++ b/unity-shared/UScreen.cpp
@@ -86,9 +86,9 @@ nux::Geometry& UScreen::GetMonitorGeometry(int monitor)
std::vector<nux::Geometry>& UScreen::GetMonitors()
{
- /*monitors_.clear();
- monitors_.push_back(nux::Geometry(0,0,800,500));
- monitors_.push_back(nux::Geometry(800,200,500,300));*/
+ //monitors_.clear();
+ //monitors_.push_back(nux::Geometry(0,0,700,500));
+ //monitors_.push_back(nux::Geometry(700,200,500,300));
return monitors_;
}