Minor bug fixes and UI improvements

This commit is contained in:
Rohit Awate 2018-02-19 12:42:21 +05:30
parent 83f557dd38
commit 557de8ef99
5 changed files with 48 additions and 29 deletions

View file

@ -3,14 +3,16 @@ package com.rohitawate.restaurant.homewindow;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.control.Tooltip;
import java.net.URL;
import java.util.ResourceBundle;
public class HistoryItemController {
public class HistoryItemController implements Initializable {
@FXML
private Label requestType, address;
@FXML
private Tooltip tooltip;
public void setRequestType(String requestType) {
this.requestType.setText(requestType);
@ -27,4 +29,9 @@ public class HistoryItemController {
public String getAddress() {
return address.getText();
}
@Override
public void initialize(URL location, ResourceBundle resources) {
tooltip.textProperty().bind(address.textProperty());
}
}

View file

@ -17,9 +17,6 @@
package com.rohitawate.restaurant.homewindow;
import com.rohitawate.restaurant.models.DashboardState;
import com.rohitawate.restaurant.models.requests.DataDispatchRequest;
import com.rohitawate.restaurant.models.requests.GETRequest;
import com.rohitawate.restaurant.models.requests.RestaurantRequest;
import com.rohitawate.restaurant.util.Services;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
@ -29,7 +26,6 @@ import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.input.KeyCode;
@ -41,7 +37,6 @@ import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@ -80,7 +75,7 @@ public class HomeWindowController implements Initializable {
// Loads the history
Task<List<DashboardState>> historyLoader = new Task<List<DashboardState>>() {
@Override
protected List<DashboardState> call() throws Exception {
protected List<DashboardState> call() {
return Services.historyManager.getHistory();
}
};
@ -188,6 +183,7 @@ public class HomeWindowController implements Initializable {
}
public void addHistoryItem(DashboardState state) {
historyPromptLayer.setVisible(false);
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/homewindow/HistoryItem.fxml"));
Parent historyItem = loader.load();

View file

@ -14,7 +14,7 @@
.combo-box .list-cell {
-fx-background-color: #707070;
-fx-pref-height: 39px;
-fx-font-size: 18px;
-fx-font-size: 15px;
-fx-text-fill: #d4d4d4;
-fx-padding: 0 0 0 10px;
}
@ -74,14 +74,19 @@
-fx-background-color: black;
}
/* Home window tab */
#homeWindowTabPane:top .tab-header-area .headers-region .tab:top .tab-container .tab-close-button {
-fx-background-color: white;
}
#homeWindowTabPane:top .tab-header-area .headers-region .tab:selected:top {
#homeWindowTabPane:top .tab-header-area .headers-region .tab:hover:top {
-fx-background-color: orangered;
}
#homeWindowTabPane:top .tab-header-area .headers-region .tab:selected:top {
-fx-background-color: #505050;
}
.tab-pane:top .tab-header-area {
-fx-padding: 0;
}
@ -96,7 +101,8 @@
#headersBox,
.scroll-pane,
.scroll-pane .viewport,
.scroll-pane .scroll-bar:vertical {
.scroll-pane .scroll-bar:vertical,
.scroll-pane .scroll-bar:horizontal {
-fx-background-color: #3d3d3d;
-fx-background-insets: 0px;
}
@ -113,17 +119,21 @@
-fx-background-color: #6a6a6a;
}
#requestOptionsTab .tab-header-area .headers-region .tab:selected:top {
-fx-background-color: #55a15c;
}
/* Tab titles */
.tab-pane:top .tab-header-area .headers-region .tab:top .tab-container .tab-label .text {
-fx-fill: white;
}
/* Tabs in the request 'Body' option */
/* Request options (Headers, Authorization, etc) tab */
#requestOptionsTab .tab-header-area .headers-region .tab:hover:top {
-fx-background-color: #55a15c;
}
#requestOptionsTab .tab-header-area .headers-region .tab:selected:top {
-fx-background-color: #3d3d3d;
}
/* Body tab pane */
#bodyTabPane:top .tab-header-area .tab-header-background,
#bodyTabPane:top .tab-header-area .headers-region .tab:top {
-fx-background-color: #545454;
@ -134,11 +144,15 @@
-fx-background-color: #3d3d3d;
}
#bodyTabPane .tab-header-area .headers-region .tab:selected:top {
#bodyTabPane:top .tab-header-area .headers-region .tab:hover:top {
-fx-background-color: #4e848f;
}
.scroll-pane .scroll-bar:vertical .thumb {
#bodyTabPane:top .tab-header-area .headers-region .tab:selected:top {
-fx-background-color: #3d3d3d;
}
.scroll-pane .scroll-bar .thumb {
-fx-background-color: #808080;
}
@ -194,6 +208,10 @@
-fx-background-color: #353535;
}
#historyItemBox:hover {
-fx-background-color: #282828;
}
/* SnackBar */
.jfx-snackbar-content {
-fx-background-color: black;

View file

@ -2,10 +2,10 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.text.Font?>
<HBox fx:id="historyItemBox" alignment="CENTER_LEFT" maxHeight="40.0" minHeight="40.0" minWidth="300.0" spacing="20.0" stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.restaurant.homewindow.HistoryItemController">
<children>
<StackPane maxWidth="80.0" minWidth="80.0" HBox.hgrow="ALWAYS">
@ -21,6 +21,9 @@
<font>
<Font size="15.0" />
</font>
<tooltip>
<Tooltip fx:id="tooltip" text="tooltip"/>
</tooltip>
</Label>
</children>
<padding>

View file

@ -17,18 +17,13 @@
-->
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Font?>
<SplitPane dividerPositions="0.3" stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.restaurant.homewindow.HomeWindowController">
<items>
<VBox fx:id="historyPane" alignment="TOP_CENTER" maxWidth="500.0" minWidth="500.0" spacing="10.0" SplitPane.resizableWithParent="false">
<VBox fx:id="historyPane" alignment="TOP_CENTER" maxWidth="500.0" prefWidth="400.0" spacing="10.0"
SplitPane.resizableWithParent="false">
<children>
<TextField fx:id="historySearchField" promptText="SEARCH" VBox.vgrow="ALWAYS">
<VBox.margin>