Skip to content

Commit

Permalink
about dialog, older mac hwi build
Browse files Browse the repository at this point in the history
  • Loading branch information
craigraw committed Aug 21, 2020
1 parent c814b8e commit fa082e8
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 5 deletions.
Binary file removed src/.DS_Store
Binary file not shown.
16 changes: 16 additions & 0 deletions src/main/java/com/sparrowwallet/sparrow/AboutController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.sparrowwallet.sparrow;

import javafx.event.ActionEvent;
import javafx.stage.Stage;

public class AboutController {
private Stage stage;

public void setStage(Stage stage) {
this.stage = stage;
}

public void close(ActionEvent event) {
stage.close();
}
}
26 changes: 25 additions & 1 deletion src/main/java/com/sparrowwallet/sparrow/AppController.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import javafx.fxml.Initializable;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
Expand All @@ -46,6 +48,7 @@
import javafx.scene.layout.StackPane;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.Window;
import javafx.util.Duration;
import org.controlsfx.control.Notifications;
Expand Down Expand Up @@ -334,7 +337,7 @@ private void setOsxApplicationMenu() {
MenuToolkit tk = MenuToolkit.toolkit();
MenuItem preferences = new MenuItem("Preferences...");
preferences.setOnAction(this::openPreferences);
Menu defaultApplicationMenu = new Menu("Apple", null, tk.createAboutMenuItem(MainApp.APP_NAME, null), new SeparatorMenuItem(),
Menu defaultApplicationMenu = new Menu("Apple", null, tk.createAboutMenuItem(MainApp.APP_NAME, getAboutStage()), new SeparatorMenuItem(),
preferences, new SeparatorMenuItem(),
tk.createHideMenuItem(MainApp.APP_NAME), tk.createHideOthersMenuItem(), tk.createUnhideAllMenuItem(), new SeparatorMenuItem(),
tk.createQuitMenuItem(MainApp.APP_NAME));
Expand All @@ -344,6 +347,27 @@ preferences, new SeparatorMenuItem(),
}
}

private Stage getAboutStage() {
try {
FXMLLoader loader = new FXMLLoader(AppController.class.getResource("about.fxml"));
Parent root = loader.load();
AboutController controller = loader.getController();

Stage stage = new Stage();
stage.setTitle("About Sparrow");
stage.initStyle(StageStyle.UNDECORATED);
stage.setResizable(false);
stage.setScene(new Scene(root));
controller.setStage(stage);

return stage;
} catch(IOException e) {
log.error("Error loading about stage", e);
}

return null;
}

public void openTransactionFromFile(ActionEvent event) {
Stage window = new Stage();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class FontAwesome5 extends GlyphFont {
* The individual glyphs offered by the FontAwesome5 font.
*/
public static enum Glyph implements INamedCharacter {
ANGLE_DOUBLE_RIGHT('\uf101'),
ARROW_DOWN('\uf063'),
ARROW_UP('\uf062'),
BTC('\uf15a'),
Expand Down
Binary file removed src/main/resources/.DS_Store
Binary file not shown.
15 changes: 15 additions & 0 deletions src/main/resources/com/sparrowwallet/sparrow/about.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.title-area {
-fx-background-color: -fx-control-inner-background;
-fx-padding: 10 25 10 25;
-fx-border-width: 0px 0px 1px 0px;
-fx-border-color: #e5e5e6;
}

.title-label {
-fx-font-size: 20px;
}

.content-area, .button-area {
-fx-padding: 10 25 25 25;
}

31 changes: 31 additions & 0 deletions src/main/resources/com/sparrowwallet/sparrow/about.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<?import javafx.scene.image.ImageView?>
<?import javafx.scene.image.Image?>
<StackPane prefHeight="420.0" prefWidth="600.0" stylesheets="@about.css" fx:controller="com.sparrowwallet.sparrow.AboutController" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml">
<VBox spacing="20">
<HBox styleClass="title-area">
<HBox alignment="CENTER_LEFT">
<Label text="Sparrow 0.9.1" styleClass="title-label" />
</HBox>
<Region HBox.hgrow="ALWAYS"/>
<ImageView AnchorPane.rightAnchor="0">
<Image url="/image/sparrow-small.png" requestedWidth="50" requestedHeight="50" smooth="false" />
</ImageView>
</HBox>
<VBox spacing="10" styleClass="content-area">
<Label text="Sparrow is a Bitcoin wallet with the goal of providing greater transparency and usability on the path to full financial self sovereignty. It attempts to provide all of the detail about your wallet setup, transactions and UTXOs so that you can transact will a full understanding of your money." wrapText="true" />
<Label text="Sparrow can operate in both an online and offline mode. In the online mode it connects to your Electrum server to display transaction history. In the offline mode it is useful as a transaction editor and as an airgapped multisig coordinator." wrapText="true" />
<Label text="For privacy and security reasons it is not recommended to use a public Electrum server. Install an Electrum server that connects to your full node to index the blockchain and provide full privacy." wrapText="true" />
</VBox>
<HBox styleClass="button-area" alignment="BOTTOM_RIGHT" VBox.vgrow="SOMETIMES">
<Button text="Done" onAction="#close" />
</HBox>
</VBox>
</StackPane>
6 changes: 3 additions & 3 deletions src/main/resources/com/sparrowwallet/sparrow/wallet/send.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
}

.amount-field {
-fx-pref-width: 145px;
-fx-min-width: 145px;
-fx-max-width: 145px;
-fx-pref-width: 140px;
-fx-min-width: 140px;
-fx-max-width: 140px;
}

.amount-unit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@
<HBox AnchorPane.rightAnchor="10">
<Button fx:id="clearButton" text="Clear" cancelButton="true" onAction="#clear" />
<Region HBox.hgrow="ALWAYS" style="-fx-min-width: 20px" />
<Button fx:id="createButton" text="Create Transaction" defaultButton="true" disable="true" onAction="#createTransaction" />
<Button fx:id="createButton" text="Create Transaction" defaultButton="true" disable="true" contentDisplay="RIGHT" graphicTextGap="5" onAction="#createTransaction">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="ANGLE_DOUBLE_RIGHT" />
</graphic>
</Button>
</HBox>
</AnchorPane>
</bottom>
Expand Down
Binary file modified src/main/resources/external/mac/hwi-1.1.2-mac-amd64-signed.zip
Binary file not shown.

0 comments on commit fa082e8

Please sign in to comment.