Skip to content

Commit 3f5e156

Browse files
committed
aesthetics
1 parent 1c43089 commit 3f5e156

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

services/static-webserver/client/source/class/osparc/support/HomePage.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ qx.Class.define("osparc.support.HomePage", {
4343
decorateButton: function(button) {
4444
button.set({
4545
font: "text-14",
46+
icon: null,
4647
minHeight: 28,
47-
gap: 10,
48+
gap: 8,
4849
});
4950
button.getChildControl("label").set({
5051
rich: true
@@ -72,21 +73,28 @@ qx.Class.define("osparc.support.HomePage", {
7273
break;
7374
}
7475
case "ask-a-question":
75-
control = new qx.ui.form.Button(this.tr("Ask a Question"), "@FontAwesome5Solid/comments/16");
76+
control = new qx.ui.form.Button(this.tr("Ask a Question"));
7677
osparc.support.HomePage.decorateButton(control);
7778
control.set({
79+
icon: "@FontAwesome5Solid/comments/16",
7880
appearance: "strong-button",
7981
center: true,
8082
});
8183
control.addListener("execute", () => this.fireEvent("openConversation"));
8284
this._add(control);
8385
break;
8486
case "learning-box":
85-
control = new osparc.widget.SectionBox(this.tr("Learning"));
87+
control = new osparc.widget.SectionBox(this.tr("Learning"), "@FontAwesome5Solid/graduation-cap/14");
88+
control.getChildControl("legend").set({
89+
gap: 8
90+
});
8691
this._add(control);
8792
break;
8893
case "references-box":
89-
control = new osparc.widget.SectionBox(this.tr("References"));
94+
control = new osparc.widget.SectionBox(this.tr("References"), "@FontAwesome5Solid/book/14");
95+
control.getChildControl("legend").set({
96+
gap: 8
97+
});
9098
this._add(control);
9199
break;
92100
}
@@ -128,6 +136,9 @@ qx.Class.define("osparc.support.HomePage", {
128136
const releaseNotesButton = osparc.store.Support.getReleaseNotesButton();
129137
this._add(releaseNotesButton);
130138
this.self().decorateButton(releaseNotesButton);
139+
releaseNotesButton.set({
140+
icon: "@FontAwesome5Solid/bullhorn/14"
141+
});
131142
},
132143
}
133144
});

services/static-webserver/client/source/class/osparc/widget/SectionBox.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,39 @@ qx.Class.define("osparc.widget.SectionBox", {
2121
include: [qx.ui.core.MRemoteChildrenHandling, qx.ui.core.MLayoutHandling],
2222

2323
/**
24-
* @param legend {String?} Initial title
24+
* @param legend {String?} Section title
25+
* @param icon {String?} Section icon
2526
*/
26-
construct: function(legend) {
27+
construct: function(legend, icon) {
2728
this.base(arguments);
2829

2930
this._setLayout(new qx.ui.layout.Canvas());
3031

31-
if (legend) {
32-
this.setLegend(legend);
33-
}
34-
3532
// ensure child controls exist
3633
this.getChildControl("frame");
3734
this.getChildControl("legend");
35+
36+
if (legend) {
37+
this.setLegend(legend);
38+
}
39+
if (icon) {
40+
this.setIcon(icon);
41+
}
3842
},
3943

4044
properties: {
41-
/** Title text shown on top of the border */
4245
legend: {
4346
check: "String",
4447
init: "",
4548
event: "changeLegend",
4649
},
4750

48-
/** Background for the title; should match panel bg token */
51+
icon: {
52+
check: "String",
53+
init: "",
54+
event: "changeIcon",
55+
},
56+
4957
legendBackgroundColor: {
5058
check: "Color",
5159
init: "background-main-1",
@@ -84,6 +92,7 @@ qx.Class.define("osparc.widget.SectionBox", {
8492
padding: [0, 6],
8593
});
8694
this.bind("legend", control, "label");
95+
this.bind("icon", control, "icon");
8796
this.bind("legendBackgroundColor", control, "backgroundColor");
8897
this._add(control, { left: 12, top: 0 });
8998
break;

0 commit comments

Comments
 (0)