Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Drawing/StyleManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Gala.Drawing.StyleManager : Object {
private const uint8 ACCENT_COLOR_ALPHA = 64;

private static GLib.Once<StyleManager> instance;
public static StyleManager get_instance () {
public static unowned StyleManager get_instance () {
return instance.once (() => new StyleManager ());
}

Expand Down
26 changes: 18 additions & 8 deletions src/Widgets/MultitaskingView/WindowClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
*/
public bool active {
set {
active_shape.update_color ();

active_shape.save_easing_state ();
active_shape.set_easing_duration (Utils.get_animation_duration (FADE_ANIMATION_DURATION));
active_shape.opacity = value ? 255 : 0;
Expand Down Expand Up @@ -127,8 +125,9 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
add_action (drag_action);
}

active_shape = new ActiveShape ();
active_shape.opacity = 0;
active_shape = new ActiveShape () {
opacity = 0
};

clone_container = new Clutter.Actor () {
pivot_point = { 0.5f, 0.5f }
Expand Down Expand Up @@ -672,14 +671,25 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
*/
private class ActiveShape : Clutter.Actor {
private const int BORDER_RADIUS = 16;
private const double COLOR_OPACITY = 0.8;
private const uint8 COLOR_OPACITY = 204;

construct {
add_effect (new RoundedCornersEffect (BORDER_RADIUS, 1.0f));
}

public void update_color () {
background_color = Drawing.StyleManager.get_instance ().theme_accent_color;
unowned var style_manager = Drawing.StyleManager.get_instance ();
style_manager.bind_property ("theme-accent-color", this, "background-color", SYNC_CREATE, (binding, from_value, ref to_value) => {
#if !HAS_MUTTER47
var new_color_ptr = (Clutter.Color*) from_value.get_boxed ();
#else
var new_color_ptr = (Cogl.Color*) from_value.get_boxed ();
#endif

var new_color = *new_color_ptr;
new_color.alpha = COLOR_OPACITY;

to_value = new_color;
return true;
}, null);
}
}
}