Skip to content

Commit 071b9ec

Browse files
🎨 [Frontend] New icons: Hypertools, More, New Folder (#7805)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 110179c commit 071b9ec

File tree

6 files changed

+25
-16
lines changed

6 files changed

+25
-16
lines changed

services/static-webserver/client/source/class/osparc/dashboard/NewPlusMenu.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
9191
},
9292

9393
statics: {
94+
MORE_ICON: "https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/icons/arrows.png",
95+
FOLDER_ICON: "https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/icons/folder.png",
96+
9497
createMenuButton: function(icon, title, infoText) {
9598
title = osparc.utils.Utils.replaceTokens(
9699
title,
@@ -153,10 +156,8 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
153156
switch (id) {
154157
case "new-folder":
155158
this.addSeparator();
156-
control = this.self().createMenuButton(
157-
"@FontAwesome5Solid/folder/16",
158-
this.tr("New Folder"),
159-
);
159+
control = this.self().createMenuButton(null, this.tr("New Folder"));
160+
this.self().setIcon(control, this.self().FOLDER_ICON);
160161
osparc.utils.Utils.setIdToWidget(control, "newFolderButton");
161162
control.addListener("tap", () => this.__createNewFolder());
162163
this.add(control);
@@ -206,7 +207,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
206207
appearance: "menu-wider",
207208
});
208209
hypertoolsMenuButton.setMenu(hypertoolsMenu);
209-
this.self().setIcon(hypertoolsMenuButton, osparc.data.model.StudyUI.HYPERTOOL_ICON(16));
210+
this.self().setIcon(hypertoolsMenuButton, osparc.data.model.StudyUI.HYPERTOOL_ICON);
210211

211212
hypertools.forEach(templateData => {
212213
const hypertoolButton = this.self().createMenuButton(null, templateData["name"]);
@@ -231,17 +232,15 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
231232
},
232233

233234
__addMoreMenu: function() {
234-
const moreMenuButton = this.self().createMenuButton("@FontAwesome5Solid/angle-double-right/16", this.tr("More"));
235-
moreMenuButton.getChildControl("icon").set({
236-
marginLeft: 6, // center it
237-
});
235+
const moreMenuButton = this.self().createMenuButton(null, this.tr("More"));
238236
this.addAt(moreMenuButton, this.__itemIdx);
239237
this.__itemIdx++;
240238

241239
const moreMenu = new qx.ui.menu.Menu().set({
242240
appearance: "menu-wider",
243241
});
244242
moreMenuButton.setMenu(moreMenu);
243+
this.self().setIcon(moreMenuButton, this.self().MORE_ICON);
245244

246245
const permissions = osparc.data.Permissions.getInstance();
247246
if (permissions.canDo("dashboard.templates.read")) {
@@ -319,7 +318,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
319318
});
320319
});
321320

322-
this.self().setIcon(menuButton, buttonConfig["icon"] || "osparc/icons/diagram.png");
321+
this.self().setIcon(menuButton, buttonConfig["icon"] || osparc.data.model.StudyUI.PIPELINE_ICON);
323322
this.__addFromResourceButton(menuButton, buttonConfig["category"]);
324323
},
325324

services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserFilter.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,13 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
421421

422422
// hypertools filter
423423
const button = new qx.ui.toolbar.RadioButton("Hypertools", null);
424-
osparc.utils.Utils.replaceIconWithThumbnail(button, osparc.data.model.StudyUI.HYPERTOOL_ICON(18), 20);
424+
osparc.utils.Utils.replaceIconWithThumbnail(button, osparc.data.model.StudyUI.HYPERTOOL_ICON, 26);
425+
// align it with the rest of icons
426+
button.set({
427+
paddingLeft: 5,
428+
paddingTop: 0,
429+
paddingBottom: 0,
430+
});
425431
button.appType = "hypertool";
426432
this.__appTypeButtons.push(button);
427433

services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,21 +261,24 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", {
261261
const serviceTypeMenu = new qx.ui.menu.Menu();
262262
menuButton.setMenu(serviceTypeMenu);
263263

264-
const iconSize = 12;
264+
const iconSize = 14;
265265
const serviceTypes = osparc.service.Utils.TYPES;
266266
Object.keys(serviceTypes).forEach(serviceId => {
267267
if (!["computational", "dynamic"].includes(serviceId)) {
268268
return;
269269
}
270270
const serviceType = serviceTypes[serviceId];
271271
const serviceTypeButton = new qx.ui.menu.Button(serviceType.label, serviceType.icon+iconSize);
272+
serviceTypeButton.getChildControl("icon").set({
273+
alignX: "center",
274+
});
272275
serviceTypeMenu.add(serviceTypeButton);
273276
serviceTypeButton.addListener("execute", () => this.__addChip("app-type", serviceId, serviceType.label), this);
274277
});
275278

276279
// hypertools filter
277280
const hypertoolTypeButton = new qx.ui.menu.Button("Hypertools", null);
278-
osparc.utils.Utils.replaceIconWithThumbnail(hypertoolTypeButton, osparc.data.model.StudyUI.HYPERTOOL_ICON(iconSize), iconSize);
281+
osparc.utils.Utils.replaceIconWithThumbnail(hypertoolTypeButton, osparc.data.model.StudyUI.HYPERTOOL_ICON, 18);
279282
serviceTypeMenu.add(hypertoolTypeButton);
280283
hypertoolTypeButton.addListener("execute", () => this.__addChip("app-type", "hypertool", "Hypertools"), this);
281284
},

services/static-webserver/client/source/class/osparc/data/model/StudyUI.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ qx.Class.define("osparc.data.model.StudyUI", {
9494
TEMPLATE_TYPE: "TEMPLATE",
9595
TUTORIAL_TYPE: "TUTORIAL",
9696
HYPERTOOL_TYPE: "HYPERTOOL",
97-
HYPERTOOL_ICON: (iconSize = 22) => ("@FontAwesome5Solid/wrench/" + iconSize),
97+
HYPERTOOL_ICON: "https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/icons/hypertool.png",
98+
PIPELINE_ICON: "https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/icons/diagram.png",
9899
},
99100

100101
members: {

services/static-webserver/client/source/class/osparc/study/Utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ qx.Class.define("osparc.study.Utils", {
439439
__guessIcon: function(studyData) {
440440
return new Promise(resolve => {
441441
if (studyData["ui"]["mode"] === "pipeline") {
442-
resolve("osparc/icons/diagram.png");
442+
resolve(osparc.data.model.StudyUI.PIPELINE_ICON);
443443
} else {
444444
const defaultIcon = osparc.dashboard.CardBase.PRODUCT_ICON;
445445
// the was to guess the TI type is to check the boot mode of the ti-postpro in the pipeline
@@ -454,7 +454,7 @@ qx.Class.define("osparc.study.Utils", {
454454
resolve(defaultIcon);
455455
});
456456
} else {
457-
resolve("osparc/icons/diagram.png");
457+
resolve(osparc.data.model.StudyUI.PIPELINE_ICON);
458458
}
459459
}
460460
});
Binary file not shown.

0 commit comments

Comments
 (0)