Skip to content
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

Consistent FX color scheme for JabRef #3839

Merged
merged 19 commits into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bfe7532
Separate colors
halirutan Feb 21, 2018
09705b8
More consistent layout
halirutan Feb 27, 2018
6a99dd1
Merge branch 'maintable-beta' into consistent-layout
halirutan Mar 5, 2018
e470bf7
Remove many explicit color settings and make the style dependent on a…
halirutan Mar 7, 2018
22cb08a
Remove color gradients for controls
halirutan Mar 7, 2018
f8bab4a
Add custom application icons in the same style as existing MaterialDe…
halirutan Mar 9, 2018
a8d5b57
Merge branch 'maintable-beta' into consistent-fxcolors
halirutan Mar 9, 2018
fdd70ce
Merge branch 'maintable-beta' into consistent-fxcolors
halirutan Mar 12, 2018
a4cf911
Fix transparent cell borders for main-table
halirutan Mar 13, 2018
20cb036
Merge branch 'maintable-beta' into consistent-fxcolors
halirutan Mar 18, 2018
aba3dc3
Merge branch 'maintable-beta' into consistent-fxcolors
halirutan Mar 18, 2018
01d1122
Change some icons for consistent visual weight and additional adaptions
halirutan Mar 19, 2018
7e1439a
Reduce the brightness of highlighted menu, marked text, etc
halirutan Mar 19, 2018
3f41151
Fix icon sizes of the custom TTF
halirutan Mar 21, 2018
2c68d79
Fix OO and Emacs icon.
halirutan Mar 22, 2018
7b02ca0
Merge branch 'maintable-beta' into consistent-fxcolors
halirutan Mar 22, 2018
36303bc
Fix size of Copy and Paste icon to original one.
halirutan Mar 23, 2018
8ba9dc7
Fix several style issues as reaction to the comments of the PR
halirutan Mar 26, 2018
97f33d0
Merge branch 'maintable-beta' of https://github.com/JabRef/jabref int…
tobiasdiez Mar 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix several style issues as reaction to the comments of the PR
  • Loading branch information
halirutan committed Mar 26, 2018
commit 8ba9dc7c230dda67971d9f769c5b783e299b0c9e
63 changes: 11 additions & 52 deletions src/main/java/org/jabref/gui/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,26 @@ public class IconTheme {
try (InputStream stream = getMaterialDesignIconsStream()) {
FONT = Font.createFont(Font.TRUETYPE_FONT, stream);
} catch (FontFormatException | IOException e) {
LOGGER.warn("Error loading font", e);
LOGGER.error("Error loading font", e);
}

try (InputStream stream = getJabRefMaterialDesignIconsStream()) {
javafx.scene.text.Font.loadFont(stream, 7);
} catch (IOException e) {
LOGGER.error("Error loading custom font for custom JabRef icons", e);
}
}

private static InputStream getMaterialDesignIconsStream() {
// TODO: The next line loads the additional JabRef-Icons. Most certainly wrong at this place
javafx.scene.text.Font.loadFont(FontBasedIcon.class.getResource("/fonts/JabRefMaterialDesign.ttf").toExternalForm(), 7);
return FontBasedIcon.class.getResourceAsStream("/fonts/materialdesignicons-webfont.ttf");
}

public static javafx.scene.paint.Color getDefaultColor() {
return ColorUtil.toFX(DEFAULT_COLOR);
private static InputStream getJabRefMaterialDesignIconsStream() throws IOException {
return FontBasedIcon.class.getResource("/fonts/JabRefMaterialDesign.ttf").openStream();
}

/**
* Constructs an ImageIcon for the image representing the given function, in the resource
* file listing images.
*
* @param name The name of the icon, such as "open", "save", "saveAs" etc.
* @return The ImageIcon for the function.
*/
public static ImageIcon getImage(String name) {
return new ImageIcon(getIconUrl(name));
public static javafx.scene.paint.Color getDefaultColor() {
return ColorUtil.toFX(DEFAULT_COLOR);
}

public static Image getJabRefImageFX() {
Expand Down Expand Up @@ -303,10 +300,6 @@ public enum JabRefIcons implements JabRefIcon {
icon = new InternalMaterialDesignIcon(color, icons);
}

JabRefIcons(ImageIcon imageIcon) {
icon = new InternalFileIcon(imageIcon);
}

@Override
public Icon getIcon() {
return icon.getIcon();
Expand All @@ -332,40 +325,6 @@ public JabRefIcon withColor(javafx.scene.paint.Color color) {
return icon.withColor(color);
}

private class InternalFileIcon implements JabRefIcon {

private final ImageIcon imageIcon;

InternalFileIcon(ImageIcon imageIcon) {
this.imageIcon = imageIcon;
}

@Override
public Icon getIcon() {
return imageIcon;
}

@Override
public Icon getSmallIcon() {
return imageIcon;
}

@Override
public Node getGraphicNode() {
return new ImageView(new Image(imageIcon.getDescription()));
}

@Override
public JabRefIcon disabled() {
throw new NotImplementedException("Cannot create disabled version of a file-based icon");
}

@Override
public JabRefIcon withColor(javafx.scene.paint.Color color) {
throw new NotImplementedException("Cannot create colored version of a file-based icon");
}
}

public Button asButton() {
Button button = new Button();
button.setGraphic(getGraphicNode());
Expand Down
34 changes: 21 additions & 13 deletions src/main/java/org/jabref/gui/Main.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
-jr-theme: #50618F;
/* The base gray. Most gray-tones in the application are derived from this color. */
-jr-base: #f0f0f0;
-jr-accent: derive(-jr-theme, 50%);

-jr-white: #ffffff;
-jr-gray-00: #f5f5f5;
-jr-gray-0: #f0f0f0;
-jr-gray-1: #e6e6e6;
-jr-gray-2: #808080;
Expand Down Expand Up @@ -43,6 +43,7 @@
/* maintable and group view cells*/
-jr-hover-cell: derive(-jr-yellow, 50%);
-jr-selected-cell: derive(-jr-yellow, 5%);
-jr-drag-target: -jr-orange;

/* Background-color of the toolbar */
-jr-toolbar: derive(-jr-base, 80%);
Expand All @@ -62,9 +63,14 @@
-jr-tooltip-bg: -jr-info;
-jr-tooltip-fg: -jr-black;

/* Consistent size for headers of tab-pane and side-panels*/
-jr-header-height: 3em;
/* Finally, some specific jr styles that depend on -fx definitions in *this* style */
-jr-sidepane-background: -fx-control-inner-background;
-jr-sidepane-header-background: -fx-background;
-jr-sidepane-header-color: -jr-icon;

/* Specs for the scrollbars */
-jr-scrollbar-thumb: -fx-outer-border;
-jr-scrollbar-track: -fx-control-inner-background;

/*
Here are redefinitions of the default properties of modena. They should in principle all be derived from the
Expand Down Expand Up @@ -104,7 +110,7 @@

/* A bright blue for highlighting/accenting objects. For example: selected
* text; selected items in menus, lists, trees, and tables; progress bars */
-fx-accent: derive(-jr-theme, 50%);
-fx-accent: -jr-accent;

/* Default buttons color, this is similar to accent but more subtle */
-fx-default-button: derive(-fx-accent, 50%);
Expand Down Expand Up @@ -227,11 +233,11 @@
/** Focus line for keyboard focus traversal on cell based controls */
-fx-cell-focus-inner-border: derive(-fx-selection-bar,30%);


-fx-focused-text-base-color : -fx-dark-text-color;
-fx-focused-mark-color : -fx-focused-text-base-color;


/* Consistent size for headers of tab-pane and side-panels*/
-jr-header-height: 3em;
}

/*
Expand Down Expand Up @@ -526,21 +532,21 @@

.scroll-bar:horizontal .track,
.scroll-bar:vertical .track {
/*-fx-background-color: derive(-fx-outer-border, 10%);*/
-fx-background-color: -jr-scrollbar-track;
-fx-opacity: 0.2;
-fx-background-radius: 0em;
}

.scroll-bar:horizontal .thumb,
.scroll-bar:vertical .thumb {
-fx-background-color: -fx-outer-border;
-fx-background-color: -jr-scrollbar-thumb;
-fx-background-insets: 0, 0, 0;
-fx-background-radius: 0em;
}

.scroll-bar .thumb:hover,
.scroll-bar .thumb:pressed {
-fx-background-color: derive(-fx-outer-border, -20%);
-fx-background-color: derive(-jr-scrollbar-thumb, -20%);
}

/* Hide increment and decrement buttons */
Expand Down Expand Up @@ -583,13 +589,15 @@
}

.sidePaneComponentHeader {
/*-fx-background-color: -jr-background;*/
-fx-background-color: -jr-sidepane-header-background;
-fx-padding: 0.3em 0.9em 0.3em 0.9em;
-fx-fill: -jr-theme;
-fx-text-fill: -jr-theme;
-fx-font-weight: bold;
-fx-pref-height: -jr-header-height;
}

.sidePaneComponentHeader > .label {
-fx-text-fill: -jr-sidepane-header-color;
-fx-font-weight: bold;
-fx-padding: 0.3em 0.9em 0.3em 0.9em;
}

.sidePaneComponentHeader .glyph-icon{
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jabref/gui/SidePaneComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ public final Node getHeader() {
BorderPane container = new BorderPane();
// container.setLeft(graphic);
final Label label = new Label(title);
label.getStyleClass().add("sidePaneComponentHeader");
container.setCenter(label);
container.setRight(buttonContainer);
container.getStyleClass().add("sidePaneComponentHeader");
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/jabref/gui/groups/GroupTree.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.tree-table-view, .tree-table-row-cell {
-fx-background-color: -fx-control-inner-background;
-fx-background-color: -jr-sidepane-background;
-fx-table-cell-border-color: transparent; /* hide grid lines */
}

Expand Down Expand Up @@ -34,19 +34,19 @@
}

.tree-table-row-cell:dragOver-bottom {
-fx-border-color: -jr-yellow;
-fx-border-color: -jr-drag-target;
-fx-border-width: 0 0 2 0;
-fx-padding: 0 0 -2 0;
}

.tree-table-row-cell:dragOver-center {
-fx-border-color: -jr-yellow;
-fx-border-color: -jr-drag-target;
-fx-border-width: 2 2 2 2;
-fx-padding: -2 -2 -2 -2;
}

.tree-table-row-cell:dragOver-top {
-fx-border-color: -jr-yellow;
-fx-border-color: -jr-drag-target;
-fx-border-width: 2 0 0 0;
-fx-padding: -2 0 0 0;
}
Expand Down