Skip to content

Commit 78bdea4

Browse files
committed
LinkButton supports icon
1 parent 5c78891 commit 78bdea4

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

services/web/client/source/class/osparc/desktop/preferences/pages/ExperimentalPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ qx.Class.define("osparc.desktop.preferences.pages.ExperimentalPage", {
6262
));
6363
box.add(label);
6464

65-
const linkBtn = new osparc.ui.form.LinkButton(this.tr("To qx-osparc-theme"), "https://github.com/ITISFoundation/qx-osparc-theme");
65+
const linkBtn = new osparc.ui.form.LinkButton(this.tr("To qx-osparc-theme"), null, "https://github.com/ITISFoundation/qx-osparc-theme");
6666
box.add(linkBtn);
6767

6868
const select = new qx.ui.form.SelectBox("Theme");

services/web/client/source/class/osparc/desktop/preferences/pages/SecurityPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ qx.Class.define("osparc.desktop.preferences.pages.SecurityPage", {
220220
));
221221
box.add(label);
222222

223-
const linkBtn = new osparc.ui.form.LinkButton(this.tr("To DAT-Core"), "https://app.blackfynn.io");
223+
const linkBtn = new osparc.ui.form.LinkButton(this.tr("To DAT-Core"), null, "https://app.blackfynn.io");
224224
box.add(linkBtn);
225225

226226
const tokensList = this.__tokensList = new qx.ui.container.Composite(new qx.ui.layout.VBox(8));

services/web/client/source/class/osparc/ui/form/LinkButton.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@
2929
*/
3030

3131
qx.Class.define("osparc.ui.form.LinkButton", {
32-
extend: osparc.ui.form.FetchButton,
32+
extend: qx.ui.form.Button,
3333

3434
/**
3535
* @param label {String} Label to use
3636
* @param url {String} Url to point to
37-
* @param height {Integer?12} Height of the link icon
3837
*/
39-
construct: function(label, url, height = 12) {
38+
construct: function(label, icon, url) {
4039
this.base(arguments, label);
4140

4241
this.set({
@@ -45,7 +44,11 @@ qx.Class.define("osparc.ui.form.LinkButton", {
4544
});
4645

4746
if (url) {
48-
this.setIcon("@FontAwesome5Solid/external-link-alt/" + height);
47+
if (icon) {
48+
this.setIcon(icon);
49+
} else {
50+
this.setIcon("@FontAwesome5Solid/external-link-alt/12");
51+
}
4952
this.addListener("execute", () => {
5053
window.open(url);
5154
}, this);

0 commit comments

Comments
 (0)