add alt-tab-window-opacity key to configure opacity of faded-out windows

This commit is contained in:
Tom Beckmann 2014-04-19 14:57:09 +02:00
commit befc6cc8f8
3 changed files with 8 additions and 1 deletions

View File

@ -148,6 +148,11 @@
<default>false</default>
<summary>Make parent windows that spawn a modal attached dialog being dimmed</summary>
</key>
<key type="d" name="alt-tab-window-opacity">
<range min="0.0" max="1.0"/>
<default>0.0</default>
<summary>The opacity of the windows located in the background in the alt-tab-switcher.</summary>
</key>
</schema>
<schema path="/org/pantheon/desktop/gala/animations/" id="org.pantheon.desktop.gala.animations" gettext-domain="gala">

View File

@ -73,6 +73,7 @@ namespace Gala
public string button_layout { get; set; }
public bool attach_modal_dialogs { get; set; }
public bool dim_parents { get; set; }
public double alt_tab_window_opacity { get; set; }
static AppearanceSettings? instance = null;

View File

@ -272,6 +272,7 @@ namespace Gala
void dim_windows ()
{
var current_actor = current_window.get_compositor_private () as Actor;
var window_opacity = (int)Math.floor (AppearanceSettings.get_default ().alt_tab_window_opacity * 255);
var i = 0;
foreach (var clone in window_clones) {
if (current_actor == clone.source) {
@ -280,7 +281,7 @@ namespace Gala
dock.get_child_at_index (i).animate (AnimationMode.LINEAR, 100, opacity : 255);
} else {
clone.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, depth : -200.0f, opacity : 0);
clone.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, depth : -200.0f, opacity : window_opacity);
dock.get_child_at_index (i).animate (AnimationMode.LINEAR, 100, opacity : 100);
}