summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 0453975..46debec 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -130,12 +130,15 @@ m_brightness_menu (0), m_saturation_menu (0), m_opacity_menu (0)
setBackgroundColor(QColor(0,0));
+ double op = Settings::shadowOpacity() / 100.0;
+ op *= 0xffff;
+
m_sradius = Settings::shadowRadius();
QColor color = Settings::shadowColor();
m_scolor[0] = short((color.red() / 256.0) * 0xffff);
m_scolor[1] = short((color.green() / 256.0) * 0xffff);
m_scolor[2] = short((color.blue() / 256.0) * 0xffff);
- m_scolor[3] = short(Settings::shadowOpacity() * 0xffff);
+ m_scolor[3] = short(op);
int offX = Settings::shadowOffsetX();
int offY = Settings::shadowOffsetY();
@@ -1101,29 +1104,51 @@ Aquamarine::Window::updateWindowGeometry ()
}
void
-Aquamarine::Window::reloadDecoration ()
+Aquamarine::Window::updateConfig ()
{
- delete m_deco;
- m_deco = 0;
+ if (!m_deco) return;
+
+ double op = Settings::shadowOpacity() / 100.0;
+ op *= 0xffff;
m_sradius = Settings::shadowRadius();
QColor color = Settings::shadowColor();
m_scolor[0] = short((color.red() / 256.0) * 0xffff);
m_scolor[1] = short((color.green() / 256.0) * 0xffff);
m_scolor[2] = short((color.blue() / 256.0) * 0xffff);
- m_scolor[3] = short(Settings::shadowOpacity() * 0xffff);
+ m_scolor[3] = short(op);
int offX = Settings::shadowOffsetX();
int offY = Settings::shadowOffsetY();
offX = KMAX(-m_sradius,KMIN(m_sradius,offX));
offY = KMAX(-m_sradius,KMIN(m_sradius,offY));
+ m_deco->widget()->move(m_soffset.left(),m_soffset.top());
+
if (Settings::drawShadows())
m_soffset.setCoords(-m_sradius + offX,-m_sradius + offY,
m_sradius + offX,m_sradius + offY);
else
m_soffset.setCoords(0,0,0,0);
+ m_deco->widget()->move(-m_soffset.left(),-m_soffset.top());
+
+ resizeDecoration();
+ updateWindowProperties();
+
+ if (m_shapeSet)
+ {
+ m_shapeChange = m_shape;
+ renderShadow();
+ }
+}
+
+void
+Aquamarine::Window::reloadDecoration ()
+{
+ delete m_deco;
+ m_deco = 0;
+
createDecoration ();
}