Add button to add new tab

This commit is contained in:
Rohit Awate 2018-07-30 19:08:13 +05:30
parent c3c80d643e
commit 3b79315228
4 changed files with 34 additions and 3 deletions

View file

@ -147,6 +147,7 @@ public class HomeWindowController implements Initializable {
dashboard.setState(newState);
}
@FXML
private void addTab() {
addTab(new ComposerState());
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

View file

@ -142,6 +142,14 @@
-fx-faint-focus-color: transparent;
}
#newTabButton {
-fx-background-color: #6a6a6a;
}
#newTabButton:hover {
-fx-background-color: limegreen;
}
.tab-pane:top .tab-header-area .headers-region .tab:top {
-fx-background-color: #6a6a6a;
}
@ -151,6 +159,10 @@
-fx-fill: white;
}
.tab:selected .tab-close-button:hover {
-fx-background-color: #282828;
}
/* Request options (Headers, Authorization, etc) tab */
#requestOptionsTab .tab-header-area .headers-region .tab:hover:top {
-fx-background-color: #55a15c;

View file

@ -16,8 +16,11 @@
~ limitations under the License.
-->
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.*?>
<StackPane fx:id="homeWindowSP" stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.111"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.everest.controllers.HomeWindowController">
@ -26,9 +29,24 @@
<items>
<VBox fx:id="tabDashboardBox" alignment="TOP_CENTER" SplitPane.resizableWithParent="false">
<children>
<TabPane fx:id="tabPane" maxHeight="35.0" minHeight="35.0" tabClosingPolicy="ALL_TABS"
tabMaxHeight="35.0" tabMaxWidth="200.0" tabMinHeight="35.0" tabMinWidth="200.0"
VBox.vgrow="ALWAYS"/>
<HBox VBox.vgrow="ALWAYS">
<children>
<JFXButton fx:id="newTabButton" contentDisplay="CENTER" minHeight="35.0" minWidth="40.0"
onAction="#addTab" HBox.hgrow="ALWAYS">
<graphic>
<ImageView fitHeight="15.0" fitWidth="15.0" pickOnBounds="true"
preserveRatio="true">
<image>
<Image url="@../../assets/NewTabPlus.png"/>
</image>
</ImageView>
</graphic>
</JFXButton>
<TabPane fx:id="tabPane" maxHeight="35.0" minHeight="35.0" minWidth="220.0"
tabClosingPolicy="ALL_TABS" tabMaxHeight="35.0" tabMaxWidth="200.0"
tabMinHeight="35.0" tabMinWidth="200.0" HBox.hgrow="ALWAYS"/>
</children>
</HBox>
<StackPane fx:id="dashboardContainer" VBox.vgrow="ALWAYS"/>
</children>
</VBox>