@@ -42,8 +42,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
4242 */
4343 public bool active {
4444 set {
45- active_shape. update_color ();
46-
4745 active_shape. save_easing_state ();
4846 active_shape. set_easing_duration (Utils . get_animation_duration (FADE_ANIMATION_DURATION ));
4947 active_shape. opacity = value ? 255 : 0 ;
@@ -127,15 +125,17 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
127125 add_action (drag_action);
128126 }
129127
130- active_shape = new ActiveShape (monitor_scale);
131- active_shape. opacity = 0 ;
128+ active_shape = new ActiveShape (monitor_scale) {
129+ opacity = 0
130+ };
132131 bind_property (" monitor-scale" , active_shape, " monitor-scale" );
133132
134133 clone_container = new Clutter .Actor () {
135134 pivot_point = { 0.5f , 0.5f }
136135 };
137136
138- window_title = new Tooltip ();
137+ window_title = new Tooltip (monitor_scale);
138+ bind_property (" monitor-scale" , window_title, " monitor-scale" );
139139
140140 close_button = new Gala .CloseButton (monitor_scale) {
141141 opacity = 0
@@ -674,7 +674,7 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
674674 */
675675 private class ActiveShape : Clutter .Actor {
676676 private const int BORDER_RADIUS = 16 ;
677- private const double COLOR_OPACITY = 0.8 ;
677+ private const uint8 COLOR_OPACITY = 204 ;
678678
679679 public float monitor_scale { get ; construct set ; }
680680
@@ -686,10 +686,19 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
686686 var rounded_corners_effect = new RoundedCornersEffect (BORDER_RADIUS , monitor_scale);
687687 bind_property (" monitor-scale" , rounded_corners_effect, " monitor-scale" );
688688 add_effect (rounded_corners_effect);
689- }
690689
691- public void update_color () {
692- background_color = Drawing . StyleManager . get_instance (). theme_accent_color;
690+ unowned var style_manager = Drawing . StyleManager . get_instance ();
691+ style_manager. bind_property (" theme-accent-color" , this , " background-color" , SYNC_CREATE , (binding, from_value, ref to_value) = > {
692+ #if ! HAS_MUTTER47
693+ var new_color = (Clutter . Color ) from_value;
694+ #else
695+ var new_color = (Cogl . Color ) from_value;
696+ #endif
697+ new_color. alpha = COLOR_OPACITY ;
698+
699+ to_value. set_boxed (&new_color);
700+ return true ;
701+ });
693702 }
694703 }
695704}
0 commit comments