summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorJason Smith <jason.smith@canonical.com>2011-08-24 18:30:37 -0400
committerJason Smith <jason.smith@canonical.com>2011-08-24 18:30:37 -0400
commitd6a77717497e86601ac6dcfc714f5f653342b920 (patch)
treeaea18bac5eff48968e79eac9485a36f736857d24 /plugins
parent999facf72ad1945dbfdf15e3fdc5e804791e67c1 (diff)
add bfb squircle rendering
(bzr r1425)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unityshell/resources/launcher_bfb.pngbin0 -> 4362 bytes
-rw-r--r--plugins/unityshell/resources/squircle_base_54.pngbin0 -> 4654 bytes
-rw-r--r--plugins/unityshell/resources/squircle_shine_54.pngbin0 -> 7412 bytes
-rw-r--r--plugins/unityshell/src/AbstractIconRenderer.h2
-rw-r--r--plugins/unityshell/src/BFBLauncherIcon.cpp2
-rw-r--r--plugins/unityshell/src/IconRenderer.cpp36
-rw-r--r--plugins/unityshell/src/Launcher.cpp1
7 files changed, 33 insertions, 8 deletions
diff --git a/plugins/unityshell/resources/launcher_bfb.png b/plugins/unityshell/resources/launcher_bfb.png
new file mode 100644
index 000000000..c7b576fe4
--- /dev/null
+++ b/plugins/unityshell/resources/launcher_bfb.png
Binary files differ
diff --git a/plugins/unityshell/resources/squircle_base_54.png b/plugins/unityshell/resources/squircle_base_54.png
new file mode 100644
index 000000000..95c289346
--- /dev/null
+++ b/plugins/unityshell/resources/squircle_base_54.png
Binary files differ
diff --git a/plugins/unityshell/resources/squircle_shine_54.png b/plugins/unityshell/resources/squircle_shine_54.png
new file mode 100644
index 000000000..4b32f1bae
--- /dev/null
+++ b/plugins/unityshell/resources/squircle_shine_54.png
Binary files differ
diff --git a/plugins/unityshell/src/AbstractIconRenderer.h b/plugins/unityshell/src/AbstractIconRenderer.h
index 13881b61a..600dae181 100644
--- a/plugins/unityshell/src/AbstractIconRenderer.h
+++ b/plugins/unityshell/src/AbstractIconRenderer.h
@@ -60,6 +60,7 @@ public:
, stick_thingy(false)
, keyboard_nav_hl(false)
, draw_shortcut(false)
+ , system_item(false)
, window_indicators(0)
, shortcut_label(0)
{
@@ -87,6 +88,7 @@ public:
bool stick_thingy;
bool keyboard_nav_hl;
bool draw_shortcut;
+ bool system_item;
int window_indicators;
char shortcut_label;
};
diff --git a/plugins/unityshell/src/BFBLauncherIcon.cpp b/plugins/unityshell/src/BFBLauncherIcon.cpp
index 0add0b2b4..fbe6a8236 100644
--- a/plugins/unityshell/src/BFBLauncherIcon.cpp
+++ b/plugins/unityshell/src/BFBLauncherIcon.cpp
@@ -29,7 +29,7 @@ BFBLauncherIcon::BFBLauncherIcon(Launcher* IconManager)
: SimpleLauncherIcon(IconManager)
{
tooltip_text = _("Ubuntu Start");
- SetIconName("distributor-logo");
+ SetIconName(PKGDATADIR"/launcher_bfb.png");
SetQuirk(QUIRK_VISIBLE, true);
SetQuirk(QUIRK_RUNNING, false);
SetIconType(TYPE_HOME);
diff --git a/plugins/unityshell/src/IconRenderer.cpp b/plugins/unityshell/src/IconRenderer.cpp
index a10e36d99..2de684852 100644
--- a/plugins/unityshell/src/IconRenderer.cpp
+++ b/plugins/unityshell/src/IconRenderer.cpp
@@ -178,6 +178,10 @@ nux::BaseTexture* arrow_ltr = 0;
nux::BaseTexture* arrow_rtl = 0;
nux::BaseTexture* arrow_empty_ltr = 0;
nux::BaseTexture* arrow_empty_rtl = 0;
+
+nux::BaseTexture* squircle_base = 0;
+nux::BaseTexture* squircle_shine = 0;
+
std::vector<nux::BaseTexture*> icon_background;
std::vector<nux::BaseTexture*> icon_selected_background;
std::vector<nux::BaseTexture*> icon_edge;
@@ -376,7 +380,9 @@ void IconRenderer::RenderIcon(nux::GraphicsEngine& GfxContext, RenderArg const&
nux::Color edge_color(0x55555555);
float backlight_intensity = arg.backlight_intensity;
float glow_intensity = arg.glow_intensity;
+
nux::BaseTexture* background = local::icon_background[size];
+ nux::BaseTexture* shine = local::icon_shine[size];
if (arg.keyboard_nav_hl)
{
@@ -389,6 +395,16 @@ void IconRenderer::RenderIcon(nux::GraphicsEngine& GfxContext, RenderArg const&
background = local::icon_selected_background[size];
}
+ if (arg.system_item)
+ {
+ background_color = nux::color::White;
+ backlight_intensity = 1.0f;
+ glow_intensity = 0.0f;
+
+ background = local::squircle_base;
+ shine = local::squircle_shine;
+ }
+
// draw tile
if (backlight_intensity > 0)
{
@@ -402,12 +418,15 @@ void IconRenderer::RenderIcon(nux::GraphicsEngine& GfxContext, RenderArg const&
edge_color = edge_color + ((background_color - edge_color) * arg.backlight_intensity);
- RenderElement(GfxContext,
- arg,
- local::icon_edge[size]->GetDeviceTexture(),
- edge_color,
- arg.alpha,
- arg.icon->GetTransform("Tile"));
+ if (!arg.system_item)
+ {
+ RenderElement(GfxContext,
+ arg,
+ local::icon_edge[size]->GetDeviceTexture(),
+ edge_color,
+ arg.alpha,
+ arg.icon->GetTransform("Tile"));
+ }
// end tile draw
// draw icon
@@ -421,7 +440,7 @@ void IconRenderer::RenderIcon(nux::GraphicsEngine& GfxContext, RenderArg const&
// draw overlay shine
RenderElement(GfxContext,
arg,
- local::icon_shine[size]->GetDeviceTexture(),
+ shine->GetDeviceTexture(),
nux::color::White,
arg.alpha,
arg.icon->GetTransform("Tile"));
@@ -1069,6 +1088,9 @@ void generate_textures()
PKGDATADIR"/launcher_icon_shine_150.png",
PKGDATADIR"/launcher_icon_shine_54.png");
+ squircle_base = load_texture(PKGDATADIR"/squircle_base_54.png");
+ squircle_shine = load_texture(PKGDATADIR"/squircle_shine_54.png");
+
pip_ltr = load_texture(PKGDATADIR"/launcher_pip_ltr.png");
arrow_ltr = load_texture(PKGDATADIR"/launcher_arrow_ltr.png");
arrow_empty_ltr = load_texture(PKGDATADIR"/launcher_arrow_outline_ltr.png");
diff --git a/plugins/unityshell/src/Launcher.cpp b/plugins/unityshell/src/Launcher.cpp
index 647a79563..a81af5324 100644
--- a/plugins/unityshell/src/Launcher.cpp
+++ b/plugins/unityshell/src/Launcher.cpp
@@ -1013,6 +1013,7 @@ void Launcher::SetupRenderArg(LauncherIcon* icon, struct timespec const& current
arg.progress_bias = IconProgressBias(icon, current);
arg.progress = CLAMP(icon->GetProgress(), 0.0f, 1.0f);
arg.draw_shortcut = _shortcuts_shown && !_hide_machine->GetQuirk(LauncherHideMachine::PLACES_VISIBLE);
+ arg.system_item = icon->Type() == LauncherIcon::TYPE_HOME;
if (_dash_is_open)
arg.active_arrow = icon->Type() == LauncherIcon::TYPE_HOME;