mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-11-05 11:56:37 +00:00
feat: add eye toggle button in status bar
This commit is contained in:
parent
8b1fc0149c
commit
73da024645
3 changed files with 40 additions and 0 deletions
|
|
@ -149,6 +149,12 @@ public class AppController implements Initializable {
|
|||
private CheckMenuItem hideEmptyUsedAddresses;
|
||||
private static final BooleanProperty hideEmptyUsedAddressesProperty = new SimpleBooleanProperty();
|
||||
|
||||
@FXML
|
||||
private CheckMenuItem hideAmounts;
|
||||
|
||||
@FXML
|
||||
private ToggleButton hideAmountsToggle;
|
||||
|
||||
@FXML
|
||||
private CheckMenuItem useHdCameraResolution;
|
||||
private static final BooleanProperty useHdCameraResolutionProperty = new SimpleBooleanProperty();
|
||||
|
|
@ -384,6 +390,11 @@ public class AppController implements Initializable {
|
|||
openWalletsInNewWindows.selectedProperty().bindBidirectional(openWalletsInNewWindowsProperty);
|
||||
hideEmptyUsedAddressesProperty.set(Config.get().isHideEmptyUsedAddresses());
|
||||
hideEmptyUsedAddresses.selectedProperty().bindBidirectional(hideEmptyUsedAddressesProperty);
|
||||
hideAmounts.setSelected(Config.get().isHideAmounts());
|
||||
hideAmountsToggle.setSelected(Config.get().isHideAmounts());
|
||||
Glyph eyeGlyph = new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.EYE);
|
||||
Glyph eyeSlashGlyph = new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.EYE_SLASH);
|
||||
hideAmountsToggle.setGraphic(Config.get().isHideAmounts() ? eyeSlashGlyph : eyeGlyph);
|
||||
useHdCameraResolutionProperty.set(Config.get().getWebcamResolution() == null || Config.get().getWebcamResolution().isWidescreenAspect());
|
||||
useHdCameraResolution.selectedProperty().bindBidirectional(useHdCameraResolutionProperty);
|
||||
mirrorCameraImageProperty.set(Config.get().isMirrorCapture());
|
||||
|
|
@ -947,6 +958,18 @@ public class AppController implements Initializable {
|
|||
EventManager.get().post(new HideEmptyUsedAddressesStatusEvent(item.isSelected()));
|
||||
}
|
||||
|
||||
public void hideAmounts(ActionEvent event) {
|
||||
CheckMenuItem item = (CheckMenuItem)event.getSource();
|
||||
Config.get().setHideAmounts(item.isSelected());
|
||||
EventManager.get().post(new HideAmountsStatusEvent(item.isSelected()));
|
||||
}
|
||||
|
||||
public void toggleHideAmounts(ActionEvent event) {
|
||||
boolean hideAmounts = hideAmountsToggle.isSelected();
|
||||
Config.get().setHideAmounts(hideAmounts);
|
||||
EventManager.get().post(new HideAmountsStatusEvent(hideAmounts));
|
||||
}
|
||||
|
||||
public void useHdCameraResolution(ActionEvent event) {
|
||||
CheckMenuItem item = (CheckMenuItem)event.getSource();
|
||||
if(Config.get().getWebcamResolution().isStandardAspect() && item.isSelected()) {
|
||||
|
|
@ -3124,6 +3147,16 @@ public class AppController implements Initializable {
|
|||
hideEmptyUsedAddresses.setSelected(event.isHideEmptyUsedAddresses());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||
hideAmounts.setSelected(event.isHideAmounts());
|
||||
hideAmountsToggle.setSelected(event.isHideAmounts());
|
||||
Glyph glyph = event.isHideAmounts() ?
|
||||
new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.EYE_SLASH) :
|
||||
new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.EYE);
|
||||
hideAmountsToggle.setGraphic(glyph);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void requestOpenWallets(RequestOpenWalletsEvent event) {
|
||||
EventManager.get().post(new OpenWalletsEvent(tabs.getScene().getWindow(), getOpenWalletTabData()));
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public class FontAwesome5 extends GlyphFont {
|
|||
EXTERNAL_LINK_ALT('\uf35d'),
|
||||
ELLIPSIS_H('\uf141'),
|
||||
EYE('\uf06e'),
|
||||
EYE_SLASH('\uf070'),
|
||||
FEATHER_ALT('\uf56b'),
|
||||
FILE_CSV('\uf6dd'),
|
||||
FILE_IMPORT('\uf56f'),
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@
|
|||
<SeparatorMenuItem />
|
||||
<CheckMenuItem fx:id="openWalletsInNewWindows" mnemonicParsing="false" text="Open Wallets In New Windows" onAction="#openWalletsInNewWindows"/>
|
||||
<CheckMenuItem fx:id="hideEmptyUsedAddresses" mnemonicParsing="false" text="Hide Empty Used Addresses" onAction="#hideEmptyUsedAddresses"/>
|
||||
<CheckMenuItem fx:id="hideAmounts" mnemonicParsing="false" text="Hide Amounts" onAction="#hideAmounts"/>
|
||||
<CheckMenuItem fx:id="showLoadingLog" mnemonicParsing="false" text="Show Wallet Loading Log" onAction="#showLoadingLog" />
|
||||
<CheckMenuItem fx:id="showTxHex" mnemonicParsing="false" text="Show Transaction Hex" onAction="#showTxHex"/>
|
||||
<SeparatorMenuItem />
|
||||
|
|
@ -174,6 +175,11 @@
|
|||
|
||||
<StatusBar fx:id="statusBar" text="" minHeight="36">
|
||||
<rightItems>
|
||||
<ToggleButton fx:id="hideAmountsToggle" contentDisplay="GRAPHIC_ONLY" onAction="#toggleHideAmounts">
|
||||
<tooltip>
|
||||
<Tooltip text="Hide Amounts" />
|
||||
</tooltip>
|
||||
</ToggleButton>
|
||||
<UnlabeledToggleSwitch fx:id="serverToggle">
|
||||
<tooltip>
|
||||
<Tooltip text="Disconnected" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue