Skip to content

Commit d0760d7

Browse files
committed
arrange dot on navbar buttons
1 parent 1184058 commit d0760d7

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

services/static-webserver/client/source/class/osparc/jobs/JobsButton.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ qx.Class.define("osparc.jobs.JobsButton", {
6666
textColor: osparc.navigation.NavigationBar.BG_COLOR,
6767
});
6868
this._add(control, {
69-
bottom: 10,
70-
right: 2
69+
bottom: -4,
70+
right: -4,
7171
});
7272
break;
7373
case "is-active-icon":
7474
control = new qx.ui.basic.Image("@FontAwesome5Solid/circle/8").set({
7575
textColor: "strong-main",
7676
});
7777
this._add(control, {
78-
bottom: 12,
79-
right: 4
78+
bottom: -2,
79+
right: -2,
8080
});
8181
break;
8282
}
@@ -109,6 +109,7 @@ qx.Class.define("osparc.jobs.JobsButton", {
109109
},
110110

111111
__updateJobsButton: function(isActive) {
112+
isActive = true;
112113
this.getChildControl("icon");
113114
[
114115
this.getChildControl("is-active-icon-outline"),

services/static-webserver/client/source/class/osparc/notification/NotificationsButton.js

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ qx.Class.define("osparc.notification.NotificationsButton", {
4545
let control;
4646
switch (id) {
4747
case "icon": {
48-
control = new qx.ui.basic.Image();
48+
control = new qx.ui.basic.Image("@FontAwesome5Regular/bell/22");
4949
const iconContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({
5050
alignY: "middle",
5151
})).set({
@@ -57,6 +57,24 @@ qx.Class.define("osparc.notification.NotificationsButton", {
5757
});
5858
break;
5959
}
60+
case "is-active-icon-outline":
61+
control = new qx.ui.basic.Image("@FontAwesome5Solid/circle/12").set({
62+
textColor: osparc.navigation.NavigationBar.BG_COLOR,
63+
});
64+
this._add(control, {
65+
bottom: -4,
66+
right: -4,
67+
});
68+
break;
69+
case "is-active-icon":
70+
control = new qx.ui.basic.Image("@FontAwesome5Solid/circle/8").set({
71+
textColor: "strong-main",
72+
});
73+
this._add(control, {
74+
bottom: -2,
75+
right: -2,
76+
});
77+
break;
6078
case "number":
6179
control = new qx.ui.basic.Label().set({
6280
backgroundColor: "error",
@@ -82,16 +100,15 @@ qx.Class.define("osparc.notification.NotificationsButton", {
82100
const notifications = notificationManager.getNotifications();
83101
notifications.forEach(notification => notification.addListener("changeRead", () => this.__updateButton(), this));
84102

85-
const nUnreadNotifications = notifications.filter(notification => notification.getRead() === false).length;
86-
const icon = this.getChildControl("icon");
87-
icon.set({
88-
source: nUnreadNotifications > 0 ? "@FontAwesome5Solid/bell/22" : "@FontAwesome5Regular/bell/22",
89-
textColor: nUnreadNotifications > 0 ? "strong-main" : "text"
90-
});
91-
const number = this.getChildControl("number");
92-
number.set({
93-
value: nUnreadNotifications.toString(),
94-
visibility: nUnreadNotifications > 0 ? "visible" : "excluded"
103+
let nUnreadNotifications = notifications.filter(notification => notification.getRead() === false).length;
104+
nUnreadNotifications = 5;
105+
[
106+
this.getChildControl("is-active-icon-outline"),
107+
this.getChildControl("is-active-icon"),
108+
].forEach(control => {
109+
control.set({
110+
visibility: nUnreadNotifications > 0 ? "visible" : "excluded"
111+
});
95112
});
96113
},
97114

0 commit comments

Comments
 (0)