-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2691 from axpoems/further-imp-payment-filter
Further improvements in offer list payments filter
- Loading branch information
Showing
12 changed files
with
171 additions
and
74 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
apps/desktop/desktop/src/main/java/bisq/desktop/components/controls/BisqPopupMenuItem.java
This file was deleted.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
.../desktop/desktop/src/main/java/bisq/desktop/components/controls/DropdownBisqMenuItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* This file is part of Bisq. | ||
* | ||
* Bisq is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or (at | ||
* your option) any later version. | ||
* | ||
* Bisq is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public | ||
* License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package bisq.desktop.components.controls; | ||
|
||
import javafx.event.ActionEvent; | ||
import javafx.event.Event; | ||
import javafx.scene.control.CustomMenuItem; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class DropdownBisqMenuItem extends CustomMenuItem { | ||
private final BisqMenuItem bisqMenuItem; | ||
|
||
public DropdownBisqMenuItem(String defaultIconId, String activeIconId, String text) { | ||
bisqMenuItem = new BisqMenuItem(defaultIconId, activeIconId, text); | ||
bisqMenuItem.getStyleClass().add("dropdown-menu-item-content"); | ||
setContent(bisqMenuItem); | ||
|
||
// Using DropdownMenuItem.setOnAction leads to duplicate execution of the handler on MacOS 14.5 / M3. | ||
// Might be a bug in the MacOS specific JavaFX libraries as other devs could not reproduce the issue. | ||
// Using an eventFilter and consuming the event solves the issue. | ||
// This happens only when bisqMenuItem is used inside the DropdownMenuItem | ||
bisqMenuItem.addEventFilter(ActionEvent.ANY, Event::consume); | ||
} | ||
|
||
public DropdownBisqMenuItem(String text) { | ||
this(null, null, text); | ||
} | ||
|
||
public DropdownBisqMenuItem(String defaultIconId, String activeIconId) { | ||
this(defaultIconId, activeIconId, ""); | ||
} | ||
|
||
public void setLabelText(String text) { | ||
bisqMenuItem.setText(text); | ||
} | ||
|
||
public Double getWidth() { | ||
return bisqMenuItem.getWidth(); | ||
} | ||
|
||
public void updateWidth(Double width) { | ||
bisqMenuItem.setPrefWidth(width); | ||
} | ||
|
||
public String getLabelText() { | ||
return bisqMenuItem.getText(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.