Minor fixes for HistoryItem's method font

This commit is contained in:
Rohit Awate 2018-08-14 20:01:10 +05:30
parent 2e4f550513
commit d5e5e357d2
4 changed files with 45 additions and 34 deletions

View file

@ -34,10 +34,16 @@ import java.util.ResourceBundle;
public class HistoryItemController implements Initializable, Searchable<ComposerState> {
@FXML
private Label requestType, address;
private Label methodLabel, address;
@FXML
private Tooltip tooltip;
private static final String GETStyle = "-fx-text-fill: orangered";
private static final String POSTStyle = "-fx-text-fill: cornflowerblue";
private static final String PUTStyle = "-fx-text-fill: deeppink";
private static final String PATCHStyle = "-fx-text-fill: teal";
private static final String DELETEStyle = "-fx-text-fill: limegreen";
private ComposerState state;
@Override
@ -51,22 +57,22 @@ public class HistoryItemController implements Initializable, Searchable<Composer
public void setState(ComposerState state) {
this.state = state;
this.requestType.setText(state.httpMethod);
this.methodLabel.setText(state.httpMethod);
switch (state.httpMethod) {
case HTTPConstants.GET:
requestType.setStyle("-fx-text-fill: deeppink");
methodLabel.setStyle(GETStyle);
break;
case HTTPConstants.POST:
requestType.setStyle("-fx-text-fill: cornflowerblue");
methodLabel.setStyle(POSTStyle);
break;
case HTTPConstants.PUT:
requestType.setStyle("-fx-text-fill: crimson");
methodLabel.setStyle(PUTStyle);
break;
case HTTPConstants.PATCH:
requestType.setStyle("-fx-text-fill: teal");
methodLabel.setStyle(PATCHStyle);
break;
case HTTPConstants.DELETE:
requestType.setStyle("-fx-text-fill: limegreen");
methodLabel.setStyle(DELETEStyle);
break;
}
this.address.setText(state.target);

View file

@ -290,6 +290,12 @@
}
/* History item */
#methodLabel {
-fx-font-family: sans-serif;
-fx-font-weight: bold;
-fx-font-size: 13px;
}
#historyItemBox {
-fx-background-color: #353535;
}
@ -360,7 +366,6 @@
/* Tree Visualizer */
.tree-view {
-fx-padding: 5px;
-fx-background-color: #353535;
}
@ -377,7 +382,7 @@
-fx-background-color: #282828;
-fx-text-fill: azure;
-fx-font-size: 14px;
-fx-font-family: "Liberation Mono", monospace;
-fx-font-family: "Liberation Mono", "Consolas", "Courier New", "Monaco", "DejaVu Sans Mono", monospace;
-fx-border-width: 0px;
}

View file

@ -22,24 +22,21 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.text.Font?>
<HBox fx:id="historyItemBox" alignment="CENTER_LEFT" maxHeight="35.0" maxWidth="300.0" minHeight="35.0" minWidth="250.0"
spacing="10.0" stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.141"
spacing="10.0" 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.HistoryItemController">
<children>
<Label fx:id="requestType" minWidth="50.0">
<font>
<Font name="Liberation Mono Bold" size="13.0"/>
</font>
</Label>
<Label fx:id="address" textFill="#bababa" textOverrun="WORD_ELLIPSIS" HBox.hgrow="ALWAYS">
<font>
<Font size="13.0"/>
</font>
<tooltip>
<Tooltip fx:id="tooltip" text="tooltip"/>
</tooltip>
</Label>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
<children>
<Label fx:id="methodLabel" minWidth="50.0">
</Label>
<Label fx:id="address" textFill="#bababa" textOverrun="WORD_ELLIPSIS" HBox.hgrow="ALWAYS">
<font>
<Font size="13.0"/>
</font>
<tooltip>
<Tooltip fx:id="tooltip" text="tooltip"/>
</tooltip>
</Label>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
</HBox>

View file

@ -23,7 +23,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Font?>
<VBox fx:id="searchPane" alignment="TOP_CENTER" maxWidth="310.0" minWidth="310.0" stylesheets="@../../css/Adreana.css"
SplitPane.resizableWithParent="false" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1"
SplitPane.resizableWithParent="false" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.rohitawate.everest.controllers.HistoryPaneController">
<children>
<HBox fx:id="historySearchFieldBox" alignment="CENTER" fillHeight="false">
@ -31,7 +31,7 @@
<Insets />
</VBox.margin>
<children>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true"
<ImageView fitHeight="15.0" fitWidth="15.0" pickOnBounds="true" preserveRatio="true"
HBox.hgrow="ALWAYS">
<image>
<Image url="@../../assets/Search.png" />
@ -42,6 +42,9 @@
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
<font>
<Font size="13.0"/>
</font>
</TextField>
<JFXButton fx:id="clearSearchFieldButton" ripplerFill="WHITE" HBox.hgrow="ALWAYS">
<graphic>
@ -54,7 +57,7 @@
</JFXButton>
</children>
<padding>
<Insets bottom="10.0" left="20.0" right="20.0" top="10.0" />
<Insets bottom="5.0" left="20.0" right="10.0" top="5.0"/>
</padding>
</HBox>
<StackPane VBox.vgrow="ALWAYS">
@ -87,9 +90,9 @@
</StackPane>
<StackPane fx:id="searchLayer">
<children>
<VBox alignment="TOP_CENTER" visible="false">
<VBox alignment="TOP_CENTER">
<children>
<Label graphicTextGap="10.0" text="SEARCH RESULTS" textFill="#199F6F">
<Label graphicTextGap="10.0" text="SEARCH RESULTS" textFill="#4ab98e">
<VBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</VBox.margin>
@ -109,7 +112,7 @@
</ScrollPane>
</children>
</VBox>
<StackPane fx:id="searchFailedLayer">
<StackPane fx:id="searchFailedLayer" visible="false">
<children>
<VBox alignment="CENTER">
<children>