summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoronestone <onestone>2006-12-19 00:31:09 +0000
committeronestone <onestone>2006-12-19 00:31:09 +0000
commite44afc75929e20f93ed53bc9880d59d1feb66044 (patch)
tree33786a03bd64d8b75ae078ccc74da44887e17d20 /src
parent2f44397a29a96715e919bc5173e7dcfacbd16c78 (diff)
downloadaquamarine-e44afc75929e20f93ed53bc9880d59d1feb66044.tar.gz
aquamarine-e44afc75929e20f93ed53bc9880d59d1feb66044.tar.bz2
aquamarine: added aquamarine configuration to the kcontrol module
Diffstat (limited to 'src')
-rw-r--r--src/aquamarine.kcfg4
-rw-r--r--src/decorator.cpp14
-rw-r--r--src/defaultShadow.cpp6
-rw-r--r--src/window.cpp35
-rw-r--r--src/window.h1
5 files changed, 48 insertions, 12 deletions
diff --git a/src/aquamarine.kcfg b/src/aquamarine.kcfg
index ce89fa6..216642b 100644
--- a/src/aquamarine.kcfg
+++ b/src/aquamarine.kcfg
@@ -19,9 +19,9 @@
</entry>
<entry name="ShadowOpacity" type="Double">
<label>Shadow opacity (darkness).</label>
- <default>.5</default>
+ <default>80</default>
<min>0</min>
- <max>1</max>
+ <max>100</max>
</entry>
<entry name="ShadowOffsetX" type="Int">
<label>Shadow X offset (distance).</label>
diff --git a/src/decorator.cpp b/src/decorator.cpp
index 6e6fcd0..8da5808 100644
--- a/src/decorator.cpp
+++ b/src/decorator.cpp
@@ -419,20 +419,26 @@ Aquamarine::Decorator::reconfigure ()
m_config->reparseConfiguration ();
unsigned long changed = m_options->updateSettings ();
+ for (QMap < WId, Aquamarine::Window * >::ConstIterator it =
+ m_windows.constBegin (); it != m_windows.constEnd (); ++it)
+ it.data ()->updateConfig ();
+
+
+ if (m_defShadow)
+ delete m_defShadow;
+ m_defShadow = (Settings::drawShadows())? new Aquamarine::DefaultShadow () : NULL;
+
#ifdef HAVE_BERYL_SETTINGS
beryl_settings_send_reload_signal();
#endif
- if (m_plugins->reset (changed))
+ if (m_plugins->reset (changed))
{
for (QMap < WId, Aquamarine::Window * >::ConstIterator it =
m_windows.constBegin (); it != m_windows.constEnd (); ++it)
it.data ()->reloadDecoration ();
m_defDeco->reloadDecoration ();
m_defDecoActive->reloadDecoration ();
- if (m_defShadow)
- delete m_defShadow;
- m_defShadow = (Settings::drawShadows())? new Aquamarine::DefaultShadow () : NULL;
m_plugins->destroyPreviousPlugin ();
}
}
diff --git a/src/defaultShadow.cpp b/src/defaultShadow.cpp
index c89119d..d44b437 100644
--- a/src/defaultShadow.cpp
+++ b/src/defaultShadow.cpp
@@ -57,12 +57,16 @@
Aquamarine::DefaultShadow::DefaultShadow ()
{
+
+ 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);
// shifted shadows do not work now
/*
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 ();
}
diff --git a/src/window.h b/src/window.h
index 20b40df..bcdd4dc 100644
--- a/src/window.h
+++ b/src/window.h
@@ -117,6 +117,7 @@ namespace Aquamarine
void moveWindow (QMouseEvent * qme);
void reloadDecoration ();
+ void updateConfig ();
void updateState ();
void updateName ();