New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement 3-column UI #63
Implement 3-column UI #63
Conversation
- Shift content block to center column - Add placeholder right column for news feed - Refactor basic styles
private void setAccelerators() { | ||
setAccelerator(helpMenuItem, KeyCombination.valueOf("F1")); | ||
} | ||
|
||
/** | ||
* Sets the accelerator of a MenuItem. | ||
* @param keyCombination the KeyCombination value of the accelerator | ||
*/ | ||
private void setAccelerator(MenuItem menuItem, KeyCombination keyCombination) { | ||
menuItem.setAccelerator(keyCombination); | ||
|
||
/* | ||
* TODO: the code below can be removed once the bug reported here | ||
* https://bugs.openjdk.java.net/browse/JDK-8131666 | ||
* is fixed in later version of SDK. | ||
* | ||
* According to the bug report, TextInputControl (TextField, TextArea) will | ||
* consume function-key events. Because CommandBox contains a TextField, and | ||
* ResultDisplay contains a TextArea, thus some accelerators (e.g F1) will | ||
* not work when the focus is in them because the key event is consumed by | ||
* the TextInputControl(s). | ||
* | ||
* For now, we add following event filter to capture such key events and open | ||
* help window purposely so to support accelerators even when focus is | ||
* in CommandBox or ResultDisplay. | ||
*/ | ||
getRoot().addEventFilter(KeyEvent.KEY_PRESSED, event -> { | ||
if (event.getTarget() instanceof TextInputControl && keyCombination.match(event)) { | ||
menuItem.getOnAction().handle(new ActionEvent()); | ||
event.consume(); | ||
} | ||
}); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good that you removed code that was deemed unnecessary, especially the menubar which is not part of our product UI
// General UI | ||
.root, .list-cell { | ||
-fx-background-color: white; | ||
} | ||
.list-cell:selected { | ||
-fx-background-color: #eee; | ||
} | ||
|
||
.list-cell Label, | ||
.list-cell:selected Label { | ||
-fx-text-fill: black; | ||
} | ||
|
||
// Utilities | ||
.container { | ||
-fx-padding: 10; | ||
} | ||
|
||
.plain-border-box { | ||
-fx-border-color: #ccc; | ||
-fx-border-radius: 0; | ||
-fx-border-insets: 0; | ||
-fx-background-color: white; | ||
-fx-background-radius: 0; | ||
-fx-background-insets: 0; | ||
} | ||
|
||
// Person card | ||
.list-item { | ||
-fx-padding: 10 0; | ||
-fx-border-width: 0 0 1 0; | ||
-fx-border-color: #ccc; | ||
} | ||
|
||
#tags { | ||
-fx-padding: 5 0 0 0; | ||
-fx-hgap: 5; | ||
-fx-vgap: 5; | ||
} | ||
|
||
#tags Label { | ||
-fx-text-fill: white; | ||
-fx-padding: 5; | ||
-fx-background-color: orange; | ||
} | ||
|
||
// Statusbar | ||
.statusbar { | ||
-fx-padding: 0 10 10; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice that you came up with a theme for the app instead of the same AB3 theme.
<Label fx:id="name" text="\$first" wrapText="true"/> | ||
<Label fx:id="address" text="\$address" wrapText="true"/> | ||
<Label fx:id="category" text="\$category" wrapText="true"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition of wraptext here!
Overall, sick edits to the UI!! Really like the plain white minimalistic view, like the apple fan you are :') |
Closes #48