mirror of
https://github.com/elementary/gala.git
synced 2024-10-05 19:27:25 +03:00
Expose BackgroundManager to the library (#1859)
Co-authored-by: Danielle Foré <danielle@elementary.io>
This commit is contained in:
parent
bf4eec88c7
commit
ba7c41d931
8
lib/BackgroundManager.vala
Normal file
8
lib/BackgroundManager.vala
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
* SPDX-FileCopyrightText: 2024 elementary, Inc. (https://elementary.io)
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface Gala.BackgroundManagerInterface : Meta.BackgroundGroup {
|
||||||
|
public abstract Meta.BackgroundActor newest_background_actor { get; }
|
||||||
|
}
|
@ -3,6 +3,7 @@ gala_lib_sources = files(
|
|||||||
'App.vala',
|
'App.vala',
|
||||||
'AppCache.vala',
|
'AppCache.vala',
|
||||||
'AppSystem.vala',
|
'AppSystem.vala',
|
||||||
|
'BackgroundManager.vala',
|
||||||
'CloseButton.vala',
|
'CloseButton.vala',
|
||||||
'Constants.vala',
|
'Constants.vala',
|
||||||
'DragDropAction.vala',
|
'DragDropAction.vala',
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* 2014 Tom Beckmann
|
* 2014 Tom Beckmann
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Gala.BackgroundManager : Meta.BackgroundGroup {
|
public class Gala.BackgroundManager : Meta.BackgroundGroup, Gala.BackgroundManagerInterface {
|
||||||
private const double DIM_OPACITY = 0.55;
|
private const double DIM_OPACITY = 0.55;
|
||||||
private const int FADE_ANIMATION_TIME = 1000;
|
private const int FADE_ANIMATION_TIME = 1000;
|
||||||
|
|
||||||
@ -13,6 +13,11 @@ public class Gala.BackgroundManager : Meta.BackgroundGroup {
|
|||||||
public WindowManager wm { get; construct; }
|
public WindowManager wm { get; construct; }
|
||||||
public int monitor_index { get; construct; }
|
public int monitor_index { get; construct; }
|
||||||
public bool control_position { get; construct; }
|
public bool control_position { get; construct; }
|
||||||
|
public Meta.BackgroundActor newest_background_actor {
|
||||||
|
get {
|
||||||
|
return (new_background_actor != null) ? new_background_actor : background_actor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private BackgroundSource background_source;
|
private BackgroundSource background_source;
|
||||||
private Meta.BackgroundActor background_actor;
|
private Meta.BackgroundActor background_actor;
|
||||||
@ -64,15 +69,14 @@ public class Gala.BackgroundManager : Meta.BackgroundGroup {
|
|||||||
transition.remove_on_complete = true;
|
transition.remove_on_complete = true;
|
||||||
transition.completed.connect (() => {
|
transition.completed.connect (() => {
|
||||||
old_background_actor.destroy ();
|
old_background_actor.destroy ();
|
||||||
|
|
||||||
changed ();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
old_background_actor.add_transition ("fade-out", transition);
|
old_background_actor.add_transition ("fade-out", transition);
|
||||||
} else {
|
} else {
|
||||||
old_background_actor.destroy ();
|
old_background_actor.destroy ();
|
||||||
changed ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void update_background_actor (bool animate = true) {
|
private void update_background_actor (bool animate = true) {
|
||||||
|
Loading…
Reference in New Issue
Block a user