Skip to content

Commit

Permalink
- Added "remove vault" button to toolbar
Browse files Browse the repository at this point in the history
- Using Ionicons in the toolbar now
  • Loading branch information
overheadhunter committed Feb 29, 2016
1 parent 8fd0bbd commit c9564ba
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 11 deletions.
7 changes: 6 additions & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright (c) 2014, Sebastian Stenzel
Cryptomator is licensed under the MIT license. The details can be found in the accompanying license file.

## Third party softwares
Cryptomator uses third party softwares that may be licensed under different licenses.
Cryptomator uses third party libraries and fonts that may be licensed under different licenses.

### AquaFX
The ProgressIndicator in ui/src/main/resource/css/mac_theme.css contains code from the AquaFX project.
Expand Down Expand Up @@ -62,6 +62,11 @@ This product includes software developed at The Apache Software Foundation (http

ResolverUtil.java Copyright 2005-2006 Tim Fennell

### Ionicons
Copyright (c) 2016 Drifty (http://drifty.com/)

ionicons.ttf Licensed under the accompanying MIT license

### Jackrabbit WebDAV Library
Copyright 2004-2014 The Apache Software Foundation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.image.Image;
import javafx.scene.text.Font;
import javafx.stage.Stage;

public class MainApplication extends Application {
Expand All @@ -51,6 +52,7 @@ public MainApplication() {

@Override
public void start(final Stage primaryStage) throws IOException {
Font.loadFont(getClass().getResourceAsStream("/css/ionicons.ttf"), 12.0);
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
FXMLLoader.setDefaultClassLoader(contextClassLoader);
Platform.runLater(() -> {
Expand All @@ -70,7 +72,7 @@ public void start(final Stage primaryStage) throws IOException {
final ResourceBundle rb = ResourceBundle.getBundle("localization");
primaryStage.setTitle(rb.getString("app.name"));
primaryStage.setResizable(false);
primaryStage.getIcons().add(new Image(MainApplication.class.getResourceAsStream("/window_icon.png")));
primaryStage.getIcons().add(new Image(MainApplication.class.getResourceAsStream("/window_icon.png")));
primaryStage.show();

ActiveWindowStyleSupport.startObservingFocus(primaryStage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import javafx.fxml.FXML;
import javafx.geometry.Side;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
Expand Down Expand Up @@ -70,6 +71,9 @@ public class MainController extends AbstractFXMLViewController {
@FXML
private ToggleButton addVaultButton;

@FXML
private Button removeVaultButton;

@FXML
private Pane contentPane;

Expand Down Expand Up @@ -110,6 +114,7 @@ public void initialize() {
vaultList.setItems(items);
vaultList.setCellFactory(this::createDirecoryListCell);
vaultList.getSelectionModel().getSelectedItems().addListener(this::selectedVaultDidChange);
removeVaultButton.disableProperty().bind(vaultList.getSelectionModel().selectedItemProperty().isNull());
this.showWelcomeView();
}

Expand Down
Binary file added main/ui/src/main/resources/css/ionicons.ttf
Binary file not shown.
26 changes: 22 additions & 4 deletions main/ui/src/main/resources/css/linux_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,37 @@
-fx-alignment: CENTER_LEFT;
}

.tool-bar.list-related-toolbar .toggle-button {
-fx-padding: 0.4em 0.8em 0.4em 0.8em;
.tool-bar.list-related-toolbar .spacer {
-fx-border-color: transparent COLOR_BORDER transparent transparent;
-fx-border-width: 1;
}

.tool-bar.list-related-toolbar .toggle-button,
.tool-bar.list-related-toolbar .button {
-fx-font-family: Ionicons;
-fx-font-size: 1.8em;
-fx-text-fill: COLOR_TEXT;
-fx-padding: 0.2em 0.8em 0.2em 0.8em;
-fx-background-color: transparent;
-fx-background-insets: 1;
-fx-border-color: transparent COLOR_BORDER transparent transparent;
-fx-border-width: 1;
}

.tool-bar.list-related-toolbar .toggle-button:hover {
.tool-bar.list-related-toolbar .toggle-button:disabled,
.tool-bar.list-related-toolbar .button:disabled {
-fx-text-fill: COLOR_TEXT_DISABLED;
}

.tool-bar.list-related-toolbar .toggle-button:hover,
.tool-bar.list-related-toolbar .button:hover {
-fx-background-color: COLOR_VGRAD_MEDIUM;
}

.tool-bar.list-related-toolbar .toggle-button:armed,
.tool-bar.list-related-toolbar .toggle-button:selected {
.tool-bar.list-related-toolbar .toggle-button:selected,
.tool-bar.list-related-toolbar .button:armed,
.tool-bar.list-related-toolbar .button:selected {
-fx-background-color: COLOR_VGRAD_DARK;
}

Expand All @@ -190,6 +207,7 @@
******************************************************************************/

.context-menu {
-fx-font-size: 12px;
-fx-background-color: COLOR_BORDER, COLOR_BACKGROUND;
-fx-background-insets: 0, 1;
-fx-padding: 1;
Expand Down
23 changes: 20 additions & 3 deletions main/ui/src/main/resources/css/mac_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,33 @@
-fx-alignment: CENTER_LEFT;
}

.tool-bar.list-related-toolbar .toggle-button {
.tool-bar.list-related-toolbar .spacer {
-fx-border-color: transparent COLOR_BORDER transparent transparent;
-fx-border-width: 1;
}

.tool-bar.list-related-toolbar .toggle-button,
.tool-bar.list-related-toolbar .button {
-fx-font-family: Ionicons;
-fx-font-size: 1.4em;
-fx-text-fill: COLOR_TEXT;
-fx-background-color: transparent;
-fx-padding: 0.2em 0.8em 0.2em 0.8em;
-fx-padding: 0.1em 0.6em 0.1em 0.6em;
-fx-background-insets: 0;
-fx-background-radius: 0;
-fx-border-color: transparent COLOR_BORDER transparent transparent;
-fx-border-width: 1;
}

.tool-bar.list-related-toolbar .toggle-button:disabled,
.tool-bar.list-related-toolbar .button:disabled {
-fx-text-fill: COLOR_TEXT_DISABLED;
}

.tool-bar.list-related-toolbar .toggle-button:armed,
.tool-bar.list-related-toolbar .toggle-button:selected {
.tool-bar.list-related-toolbar .toggle-button:selected,
.tool-bar.list-related-toolbar .button:armed,
.tool-bar.list-related-toolbar .button:selected {
-fx-background-color: linear-gradient(to bottom, #C0C0C0 0%, #ADADAD 100%);
}

Expand All @@ -243,6 +259,7 @@
******************************************************************************/

.context-menu {
-fx-font-size: 13px;
-fx-background-color: rgba(255.0, 255.0, 255.0, 0.9);
-fx-background-insets: 0;
-fx-background-radius: 4.0;
Expand Down
16 changes: 15 additions & 1 deletion main/ui/src/main/resources/css/win_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
-fx-font-size: 12px;

COLOR_TEXT: #000;
COLOR_TEXT_DISABLED: #888;
COLOR_HYPERLINK: #3399FF;
COLOR_BORDER: #ACACAC;
COLOR_BORDER_FOCUS: #3399FF;
Expand Down Expand Up @@ -227,17 +228,30 @@
.tool-bar.list-related-toolbar {
-fx-background-color: transparent;
-fx-padding: 0.1em 0 0.1em 0;
-fx-spacing: 0;
-fx-spacing: 1px;
-fx-alignment: CENTER_LEFT;
}

.tool-bar.list-related-toolbar .toggle-button,
.tool-bar.list-related-toolbar .button {
-fx-font-family: Ionicons;
-fx-font-size: 1.4em;
-fx-text-fill: COLOR_TEXT;
}

.tool-bar.list-related-toolbar .toggle-button:disabled,
.tool-bar.list-related-toolbar .button:disabled {
-fx-text-fill: COLOR_TEXT_DISABLED;
}

/*******************************************************************************
* *
* PopupMenu *
* *
******************************************************************************/

.context-menu {
-fx-font-size: 12px;
-fx-background-color: derive(COLOR_BACKGROUND, -30%), COLOR_BACKGROUND;
-fx-background-insets: 0, 1;
-fx-padding: 1px;
Expand Down
8 changes: 7 additions & 1 deletion main/ui/src/main/resources/fxml/main.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<?import javafx.scene.control.ContextMenu?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Separator?>

<HBox fx:id="rootPane" prefHeight="440.0" prefWidth="640.0" xmlns:fx="http://javafx.com/fxml" cacheShape="true" cache="true">

Expand All @@ -43,7 +45,11 @@
<ListView fx:id="vaultList" VBox.vgrow="ALWAYS" focusTraversable="false" cacheShape="true" cache="true"/>
<ToolBar VBox.vgrow="NEVER" styleClass="list-related-toolbar" cacheShape="true" cache="true">
<items>
<ToggleButton text="+" fx:id="addVaultButton" onAction="#didClickAddVault" focusTraversable="false" cacheShape="true" cache="true"/>
<ToggleButton text="&#xf489;" fx:id="addVaultButton" onAction="#didClickAddVault" focusTraversable="false" cacheShape="true" cache="true"/>
<Button text="&#xf462;" fx:id="removeVaultButton" onAction="#didClickRemoveSelectedEntry" focusTraversable="false" cacheShape="true" cache="true"/>
<Pane HBox.hgrow="ALWAYS" styleClass="spacer" />
<!-- future use: -->
<Button text="&#xf43c;" disable="true" focusTraversable="false" cacheShape="true" cache="true"/>
</items>
</ToolBar>
</children>
Expand Down

0 comments on commit c9564ba

Please sign in to comment.