Skip to content

Commit 43c5e89

Browse files
committed
eyes next to the fields
1 parent 9cd1a0c commit 43c5e89

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

services/static-webserver/client/source/class/osparc/desktop/account/ProfilePage.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,14 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
111111
form.add(firstName, "First Name", null, "firstName");
112112
form.add(lastName, "Last Name", null, "lastName");
113113
form.add(email, "Email", null, "email");
114-
box.add(new qx.ui.form.renderer.Single(form));
114+
const icons = {
115+
0: "@FontAwesome5Solid/eye/12",
116+
1: "@FontAwesome5Solid/eye-slash/12",
117+
2: "@FontAwesome5Solid/eye-slash/12",
118+
3: "@FontAwesome5Solid/eye-slash/12",
119+
};
120+
const singleWithIcon = new osparc.ui.form.renderer.SingleWithIcon(form, icons);
121+
box.add(singleWithIcon);
115122

116123
const expirationLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(5)).set({
117124
paddingLeft: 16,
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/* ************************************************************************
2+
3+
osparc - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2025 IT'IS Foundation, https://itis.swiss
9+
10+
License:
11+
MIT: https://opensource.org/licenses/MIT
12+
13+
Authors:
14+
* Odei Maiz (odeimaiz)
15+
16+
************************************************************************ */
17+
18+
qx.Class.define("osparc.ui.form.renderer.SingleWithIcon", {
19+
extend: qx.ui.form.renderer.Single,
20+
21+
construct: function(form, icons) {
22+
if (icons) {
23+
this.__icons = icons;
24+
} else {
25+
this.__icons = {};
26+
}
27+
28+
this.base(arguments, form);
29+
},
30+
31+
members: {
32+
__icons: null,
33+
34+
setIcons(icons) {
35+
this.__icons = icons;
36+
37+
this._render();
38+
},
39+
40+
// overridden
41+
addItems: function(items, names, title, itemOptions, headerOptions) {
42+
this.base(arguments, items, names, title, itemOptions, headerOptions);
43+
44+
// header
45+
let row = title === null ? 0 : 1;
46+
47+
for (let i = 0; i < items.length; i++) {
48+
if (i in this.__icons) {
49+
const image = new qx.ui.basic.Image(this.__icons[i]).set({
50+
alignY: "middle",
51+
});
52+
this._add(image, {
53+
row,
54+
column: 2,
55+
});
56+
}
57+
58+
row++;
59+
}
60+
},
61+
}
62+
});

0 commit comments

Comments
 (0)