summaryrefslogtreecommitdiff
diff options
-rw-r--r--plugins/unityshell/src/unityshell.cpp23
-rw-r--r--plugins/unityshell/src/unityshell.h1
-rw-r--r--resources/panel_shadow.png (renamed from resources/panel-shadow.png)bin159 -> 159 bytes
3 files changed, 16 insertions, 8 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index de308d819..417269462 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -42,6 +42,7 @@
#include "PluginAdapter.h"
#include "QuicklistManager.h"
#include "TextureCache.h"
+#include "ThemeSettings.h"
#include "Timer.h"
#include "XKeyboardUtil.h"
#include "unityshell.h"
@@ -447,10 +448,8 @@ UnityScreen::UnityScreen(CompScreen* screen)
InitGesturesSupport();
- CompString name(PKGDATADIR"/panel-shadow.png");
- CompString pname("unityshell");
- CompSize size(1, 20);
- _shadow_texture = GLTexture::readImageToTexture(name, pname, size);
+ LoadPanelShadowTexture();
+ theme::Settings::Get()->theme.changed.connect(sigc::hide(sigc::mem_fun(this, &UnityScreen::LoadPanelShadowTexture)));
ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, [this](GVariant * data)
{
@@ -708,6 +707,14 @@ void UnityScreen::nuxEpilogue()
glDisable(GL_SCISSOR_TEST);
}
+void UnityScreen::LoadPanelShadowTexture()
+{
+ CompString name(theme::Settings::Get()->ThemedFilePath("panel_shadow", {PKGDATADIR}));
+ CompString pname;
+ CompSize size;
+ _shadow_texture = GLTexture::readImageToTexture(name, pname, size);
+}
+
void UnityScreen::setPanelShadowMatrix(GLMatrix const& matrix)
{
panel_shadow_matrix_ = matrix;
@@ -715,15 +722,15 @@ void UnityScreen::setPanelShadowMatrix(GLMatrix const& matrix)
void UnityScreen::FillShadowRectForOutput(CompRect& shadowRect, CompOutput const& output)
{
- if (_shadow_texture.empty ())
+ if (_shadow_texture.empty())
return;
- int monitor = PluginAdapter::Default().MonitorGeometryIn(NuxGeometryFromCompRect(output));
- float panel_h = static_cast<float>(panel_style_.PanelHeight(monitor));
+ int monitor = WM.MonitorGeometryIn(NuxGeometryFromCompRect(output));
+ float panel_h = panel_style_.PanelHeight(monitor);
float shadowX = output.x();
float shadowY = output.y() + panel_h;
float shadowWidth = output.width();
- float shadowHeight = _shadow_texture[0]->height();
+ float shadowHeight = _shadow_texture[0]->height() * unity_settings_.em(monitor)->DPIScale();
shadowRect.setGeometry(shadowX, shadowY, shadowWidth, shadowHeight);
}
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index 7235ac118..cc714b37d 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -292,6 +292,7 @@ private:
void OnInitiateSpread();
void OnTerminateSpread();
+ void LoadPanelShadowTexture();
void DamagePanelShadow();
void OnViewHidden(nux::BaseWindow *bw);
diff --git a/resources/panel-shadow.png b/resources/panel_shadow.png
index a37c8fe87..a37c8fe87 100644
--- a/resources/panel-shadow.png
+++ b/resources/panel_shadow.png
Binary files differ