Skip to content

Commit fc6fc09

Browse files
committed
aesthetics
1 parent df9a54a commit fc6fc09

File tree

1 file changed

+19
-9
lines changed
  • services/static-webserver/client/source/class/osparc/dashboard

1 file changed

+19
-9
lines changed

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

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,19 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
4343
const menuButton = new qx.ui.menu.Button().set({
4444
label,
4545
icon: icon || null,
46-
font: "text-14",
46+
font: "text-16",
4747
padding: 4,
4848
});
4949
menuButton.getChildControl("label").set({
5050
rich: true,
5151
});
52+
menuButton.getChildControl("icon").set({
53+
scale: true,
54+
maxHeight: 20,
55+
maxWidth: 20,
56+
allowShrinkX: true,
57+
allowShrinkY: true,
58+
});
5259
return menuButton;
5360
},
5461
},
@@ -60,7 +67,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
6067
case "new-folder":
6168
control = this.self().createMenuButton(
6269
this.tr("New Folder"),
63-
osparc.dashboard.CardBase.NEW_ICON + "14"
70+
osparc.dashboard.CardBase.NEW_ICON + "16"
6471
);
6572
osparc.utils.Utils.setIdToWidget(control, "newFolderButton");
6673
control.addListener("tap", () => this.__createNewFolder());
@@ -72,15 +79,15 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
7279
firstUpperCase: true,
7380
plural: true
7481
}),
75-
"@FontAwesome5Solid/copy/14"
82+
"@FontAwesome5Solid/copy/16"
7683
);
7784
control.addListener("tap", () => this.fireDataEvent("changeTab", "templatesTab"));
7885
this.add(control);
7986
break;
8087
case "services-entry":
8188
control = this.self().createMenuButton(
8289
this.tr("Services"),
83-
"@FontAwesome5Solid/cogs/14"
90+
"@FontAwesome5Solid/cogs/16"
8491
);
8592
control.addListener("tap", () => this.fireDataEvent("changeTab", "servicesTab"));
8693
this.add(control);
@@ -129,7 +136,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
129136
categories.forEach(category => {
130137
const categoryHeader = new qx.ui.basic.Label().set({
131138
value: category["label"],
132-
font: "text-14",
139+
font: "text-16",
133140
rich: true,
134141
wrap: true,
135142
});
@@ -139,9 +146,11 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
139146
},
140147

141148
__addFromTemplateButton: function(templateData, templates) {
149+
const icon = "icon" in templateData ? templateData["icon"] : null;
150+
const menuButton = this.self().createMenuButton(templateData.title, icon);
151+
osparc.utils.Utils.setIdToWidget(menuButton, templateData.idToWidget);
152+
142153
if (templateData.showDisabled) {
143-
const menuButton = this.self().createMenuButton(templateData.title);
144-
osparc.utils.Utils.setIdToWidget(menuButton, templateData.idToWidget);
145154
if (templateData.showDisabled) {
146155
menuButton.set({
147156
enabled: false,
@@ -154,8 +163,9 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
154163

155164
const templateFound = templates.find(t => t.name === templateData.expectedTemplateLabel);
156165
if (templateFound) {
157-
const menuButton = this.self().createMenuButton(templateData.title);
158-
osparc.utils.Utils.setIdToWidget(menuButton, templateData.idToWidget);
166+
if (menuButton.getIcon() === null && templateFound["thumbnail"]) {
167+
menuButton.setIcon(templateFound["thumbnail"]);
168+
}
159169
menuButton.addListener("tap", () => {
160170
this.fireDataEvent("newStudyFromTemplateClicked", {
161171
templateData: templateFound,

0 commit comments

Comments
 (0)