Changeset 888
- Timestamp:
- 02/14/14 01:55:45 (10 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/assets/style/jfx.css
r840 r888 3 3 * Author: ngw8 4 4 */ 5 5 6 #jfxbrowser { 6 7 -light-gray: rgb(245, 245, 245); 7 8 -dark-gray: rgb(10, 10, 10); 8 9 -highlight: #79b3d4; 10 -red-highlight: #d44747; 11 -red-highlight-transparent: rgba(248,118,92.0.2); 12 13 -green-highlight: #62c139; 14 -green-highlight-transparent: rgba(135,212,101, 0.4); 15 9 16 -fx-accent: -highlight; 10 -fx-shadow-highlight-color: rgba(255, 255, 255, 0.4);17 -fx-shadow-highlight-color: rgba(255, 255, 255, 0.5); 11 18 -fx-base: #eee; 12 19 } … … 55 62 -fx-background-color:-light-gray; 56 63 57 -fx-background-radius: 2 0 0 2; 58 64 -fx-background-radius: 2; 59 65 } 60 66 … … 73 79 } 74 80 81 .fa { 82 -fx-font-family: FontAwesome; 83 } 84 85 .button.fa .text :not(.tooltip) { 86 -fx-effect: dropshadow(one-pass-box, -fx-shadow-highlight-color, 0,0,0,1); 87 } 88 89 .url-button { 90 -fx-background-color: transparent; 91 -fx-padding: 0 8 0 2; 92 -fx-text-fill: derive(-fx-base, -30%); 93 } 94 95 .url-button .text :not(.tooltip) { 96 -fx-effect: dropshadow(two-pass-box, -light-gray, 6,0.8,0,0) !important; 97 } 98 99 .url-cancel-button { 100 -hover-color: -red-highlight; 101 -glow-color: -red-highlight-transparent; 102 } 103 104 .url-go-button { 105 -hover-color: -green-highlight; 106 -glow-color: -green-highlight-transparent; 107 } 108 109 .url-button:hover { 110 -fx-text-fill: -hover-color; 111 } 112 113 /* Tooltip is a child of the button, so have to exclude it from the style */ 114 .url-button:hover .text :not(.tooltip) { 115 -fx-effect: dropshadow( two-pass-box , -glow-color, 6,0,0,0 ); 116 } 117 118 .url-button:active { 119 -fx-text-fill: derive(-hover-color, -30%); 120 } 121 75 122 .scrollbars-hidden .scroll-bar { 76 123 visibility: hidden; -
trunk/src/org/expeditee/items/widgets/JfxBrowser.java
r887 r888 48 48 import javafx.scene.layout.StackPane; 49 49 import javafx.scene.layout.VBox; 50 import javafx.scene.text.Font; 50 51 import javafx.scene.web.WebEngine; 51 52 import javafx.scene.web.WebView; … … 89 90 private Button _forwardButton; 90 91 private Button _backButton; 92 private Button _stopButton; 93 private Button _goButton; 91 94 private Button _convertButton; 92 95 private ToggleButton _readableModeButton; … … 102 105 static { 103 106 Platform.setImplicitExit(false); 107 108 Font.loadFont(ClassLoader.getSystemResourceAsStream("org/expeditee/assets/resources/fonts/fontawesome/fontawesome-webfont.ttf"), 12); 104 109 105 110 try { … … 179 184 horizontal.getStyleClass().add("custom-toolbar"); 180 185 181 this._backButton = new Button("Back"); 186 this._backButton = new Button("\uf060"); 187 this._backButton.setTooltip(new Tooltip("Back")); 182 188 this._backButton.setMinWidth(Button.USE_PREF_SIZE); 189 this._backButton.setMaxHeight(Double.MAX_VALUE); 183 190 this._backButton.setFocusTraversable(false); 184 this._backButton.getStyleClass().add ("first");191 this._backButton.getStyleClass().addAll("first", "fa"); 185 192 186 193 this._backButton.setDisable(true); 187 188 this._forwardButton = new Button("Forward"); 194 195 this._forwardButton = new Button("\uf061"); 196 this._forwardButton.setTooltip(new Tooltip("Forward")); 189 197 this._forwardButton.setMinWidth(Button.USE_PREF_SIZE); 198 this._forwardButton.setMaxHeight(Double.MAX_VALUE); 190 199 this._forwardButton.setFocusTraversable(false); 191 this._forwardButton.getStyleClass().add ("last");200 this._forwardButton.getStyleClass().addAll("last", "fa"); 192 201 193 202 this._urlField = new TextField(url); 194 this._urlField.getStyleClass().add All("first","url-field");203 this._urlField.getStyleClass().add("url-field"); 195 204 this._urlField.setMaxWidth(Double.MAX_VALUE); 196 205 this._urlField.setFocusTraversable(false); 197 198 Button goButton = new Button("Go"); 199 goButton.getStyleClass().add("last"); 200 goButton.setMinWidth(Button.USE_PREF_SIZE); 201 goButton.setFocusTraversable(false); 206 207 this._stopButton = new Button("\uF00D"); 208 this._stopButton.setTooltip(new Tooltip("Stop loading the page")); 209 this._stopButton.getStyleClass().addAll("url-button", "url-cancel-button", "fa"); 210 this._stopButton.setMinWidth(Button.USE_PREF_SIZE); 211 this._stopButton.setMaxHeight(Double.MAX_VALUE); 212 StackPane.setAlignment(this._stopButton, Pos.CENTER_RIGHT); 213 this._stopButton.setFocusTraversable(false); 214 215 this._goButton = new Button("\uf061"); 216 this._goButton.setTooltip(new Tooltip("Load the entered address")); 217 this._goButton.getStyleClass().addAll("url-button", "url-go-button", "fa"); 218 this._goButton.setMinWidth(Button.USE_PREF_SIZE); 219 this._goButton.setMaxHeight(Double.MAX_VALUE); 220 StackPane.setAlignment(this._goButton, Pos.CENTER_RIGHT); 221 this._goButton.setFocusTraversable(false); 202 222 203 223 this._readableModeButton = new ToggleButton(); … … 214 234 215 235 this._urlProgressBar = new ProgressBar(); 216 this._urlProgressBar.getStyleClass().add All("first","url-progress-bar");236 this._urlProgressBar.getStyleClass().add("url-progress-bar"); 217 237 this._urlProgressBar.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); 218 238 219 239 StackPane urlbar = new StackPane(); 220 urlbar.getChildren().addAll(_urlProgressBar, this._urlField );240 urlbar.getChildren().addAll(_urlProgressBar, this._urlField, this._stopButton, this._goButton); 221 241 222 horizontal.getChildren().addAll(this._backButton, this._forwardButton, urlbar, goButton,this._readableModeButton, this._convertButton);242 horizontal.getChildren().addAll(this._backButton, this._forwardButton, urlbar, this._readableModeButton, this._convertButton); 223 243 224 244 HBox.setHgrow(this._backButton, Priority.NEVER); 225 245 HBox.setHgrow(this._forwardButton, Priority.NEVER); 226 246 HBox.setHgrow(this._convertButton, Priority.NEVER); 227 HBox.setHgrow(goButton, Priority.NEVER);228 247 HBox.setHgrow(this._readableModeButton, Priority.NEVER); 229 248 HBox.setHgrow(urlbar, Priority.ALWAYS); 230 249 231 HBox.setMargin(goButton, new Insets(0, 5, 0, 0)); 232 HBox.setMargin(this._readableModeButton, new Insets(0, 5, 0, 0)); 250 HBox.setMargin(this._readableModeButton, new Insets(0, 5, 0, 5)); 233 251 HBox.setMargin(this._forwardButton, new Insets(0, 5, 0, 0)); 234 252 … … 328 346 }); 329 347 330 goButton.setOnAction(new EventHandler<ActionEvent>() { 348 this._stopButton.setOnAction(new EventHandler<ActionEvent>() { 349 350 @Override 351 public void handle(ActionEvent arg0) { 352 JfxBrowser.this._webEngine.getLoadWorker().cancel(); 353 } 354 }); 355 356 this._goButton.setOnAction(new EventHandler<ActionEvent>() { 331 357 332 358 @Override … … 494 520 JfxBrowser.this._urlProgressBar.getStyleClass().remove("completed"); 495 521 522 JfxBrowser.this._stopButton.setVisible(true); 523 JfxBrowser.this._goButton.setVisible(false); 524 496 525 if (JfxBrowser.this._webEngine.getHistory().getCurrentIndex() + 1 >= JfxBrowser.this._webEngine.getHistory().getEntries().size()) { 497 526 JfxBrowser.this._forwardButton.setDisable(true); … … 523 552 JfxBrowser.this._convertButton.setDisable(false); 524 553 JfxBrowser.this._readableModeButton.setDisable(false); 554 JfxBrowser.this._stopButton.setVisible(false); 555 JfxBrowser.this._goButton.setVisible(true); 525 556 break; 526 557 case FAILED: // FAILED 527 558 MessageBay.displayMessage("Failed to load page"); 559 JfxBrowser.this._stopButton.setVisible(false); 560 JfxBrowser.this._goButton.setVisible(true); 528 561 break; 529 562 }
Note:
See TracChangeset
for help on using the changeset viewer.