Skip to content

Commit ffc15fc

Browse files
committed
notify state
1 parent 11381c2 commit ffc15fc

File tree

4 files changed

+15
-26
lines changed

4 files changed

+15
-26
lines changed

src/AppSystem/Launcher.vala

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ public class Dock.Launcher : BaseItem {
3131

3232
public App app { get; construct; }
3333

34-
private State _state;
35-
public new State state {
36-
get { return _state; }
37-
set {
38-
_state = value;
39-
running_revealer.reveal_child = (value != HIDDEN) && !moving;
40-
running_revealer.sensitive = value == ACTIVE;
41-
}
42-
}
43-
4434
private Gtk.Box running_box;
4535
private Gtk.Image image;
4636
private Gtk.Label badge;
@@ -306,6 +296,11 @@ public class Dock.Launcher : BaseItem {
306296
running_revealer.reveal_child = !moving && state != HIDDEN;
307297
});
308298

299+
notify["state"].connect (() => {
300+
running_revealer.reveal_child = (state != HIDDEN) && !moving;
301+
running_revealer.sensitive = state == ACTIVE;
302+
});
303+
309304
var drop_controller_motion = new Gtk.DropControllerMotion ();
310305
add_controller (drop_controller_motion);
311306
drop_controller_motion.enter.connect (queue_dnd_cycle);

src/BaseIconGroup.vala

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,6 @@ public abstract class Dock.BaseIconGroup : BaseItem {
99

1010
public ListModel icons { get; construct; }
1111

12-
private State _state;
13-
public new State state {
14-
get { return _state; }
15-
set {
16-
_state = value;
17-
18-
if ((value != HIDDEN) && !moving) {
19-
add_css_class ("running");
20-
} else if (has_css_class ("running")) {
21-
remove_css_class ("running");
22-
}
23-
}
24-
}
25-
2612
class construct {
2713
set_css_name ("icongroup");
2814
}
@@ -47,6 +33,14 @@ public abstract class Dock.BaseIconGroup : BaseItem {
4733
bind_property ("icon-size", bin, "height-request", SYNC_CREATE);
4834

4935
overlay.child = bin;
36+
37+
notify["state"].connect (() => {
38+
if ((state != HIDDEN) && !moving) {
39+
add_css_class ("running");
40+
} else if (has_css_class ("running")) {
41+
remove_css_class ("running");
42+
}
43+
});
5044
}
5145

5246
private Gtk.Widget create_flow_box_child (Object? item) {

src/BaseItem.vala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public class Dock.BaseItem : Gtk.Box {
5252
}
5353
}
5454

55+
public State state { get; set; }
56+
5557
protected Gtk.Overlay overlay;
5658
protected Gtk.GestureClick gesture_click;
5759

src/WorkspaceSystem/DynamicWorkspaceItem.vala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ public class Dock.DynamicWorkspaceIcon : BaseItem {
88
set_css_name ("icongroup");
99
}
1010

11-
public State state { get; set; }
12-
1311
public DynamicWorkspaceIcon () {
1412
Object (disallow_dnd: true, group: Group.WORKSPACE);
1513
}

0 commit comments

Comments
 (0)