Skip to content

Commit

Permalink
the button is an image
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Jun 25, 2024
1 parent 7150826 commit 06b0e48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,33 @@
************************************************************************ */

qx.Class.define("osparc.desktop.credits.CreditsIndicatorButton", {
extend: qx.ui.form.Button,
extend: osparc.desktop.credits.CreditsImage,

construct: function() {
this.base(arguments);

this.set({
backgroundColor: "transparent"
maxHeight: 30,
cursor: "pointer",
padding: [3, 8]
});

const store = osparc.store.Store.getInstance();
store.bind("contextWallet", this, "wallet");
this.setSize({
height: 24,
width: 30
});

this.__creditsContainer = new osparc.desktop.credits.CreditsNavBarContainer();
this.__creditsContainer.exclude();

this.addListener("tap", this.__buttonTapped, this);
},

properties: {
wallet: {
check: "osparc.data.model.Wallet",
init: null,
nullable: true,
event: "changeWallet",
apply: "__applyWallet"
}
},

members: {
__creditsContainer: null,
__tappedOut: null,

__applyWallet: function() {
osparc.desktop.credits.Utils.setCreditsIconToButton(this);
},

__buttonTapped: function() {
if (this.__tappedOut) {
this.__tappedOut = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ qx.Class.define("osparc.navigation.NavigationBar", {
this.getChildControl("help");
if (osparc.desktop.credits.Utils.areWalletsEnabled()) {
this.getChildControl("credits-button");
this.getChildControl("credits-image-button");
}
this.getChildControl("log-in-button");
this.getChildControl("user-menu");
Expand Down Expand Up @@ -239,25 +238,8 @@ qx.Class.define("osparc.navigation.NavigationBar", {
this.getChildControl("right-items").add(control);
break;
}
case "credits-image-button": {
control = new osparc.desktop.credits.CreditsImage().set({
maxHeight: 24
})
control.setSize({
height: 24,
width: 32
});
this.getChildControl("right-items").add(control);
break;
}
case "credits-button":
control = new osparc.desktop.credits.CreditsIndicatorButton().set({
maxHeight: 32
});
control.getChildControl("icon").set({
maxHeight: 24,
scale: true
});
control = new osparc.desktop.credits.CreditsIndicatorButton();
osparc.utils.Utils.setIdToWidget(control, "creditsNavigationBtn");
this.getChildControl("right-items").add(control);
break;
Expand Down

0 comments on commit 06b0e48

Please sign in to comment.