Skip to content

[WIP] Turn editor fontsize customizable#3042

Closed
lenhard wants to merge 13 commits into
masterfrom
editor-fontsize
Closed

[WIP] Turn editor fontsize customizable#3042
lenhard wants to merge 13 commits into
masterfrom
editor-fontsize

Conversation

@lenhard

@lenhard lenhard commented Jul 22, 2017

Copy link
Copy Markdown
Member

Partial fix for #3034

The components in the entry edtor now use the menu font size that can be set in the preferences.

Missing:

  • The text field of the Crossref editor

  • The recommendations by the auto completion

  • The tooltip text for the buttons

  • Change in CHANGELOG.md described

  • Tests created for changes

  • Screenshots added (for bigger UI changes)

  • Manually tested changed features in running JabRef

  • Check documentation status (Issue created for outdated help page at help.jabref.org?)

  • If you changed the localization: Did you run gradle localizationUpdate?

@lenhard lenhard changed the title Turn editor fontsize customizable [WIP] Turn editor fontsize customizable Jul 22, 2017

@tobiasdiez tobiasdiez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should suffice to add the font style globally at https://github.com/JabRef/jabref/blob/master/src/main/java/org/jabref/gui/entryeditor/FieldsEditorTab.java#L180 since the children automatically derive their properties from their parents (similar to css + html).

@lenhard

lenhard commented Jul 25, 2017

Copy link
Copy Markdown
Member Author

Thanks for the tip, I will try it out! :)

@Siedlerchr

Copy link
Copy Markdown
Member

See also this article for an inspiration: https://fxdocs.github.io/docs/index.html#_styleable_properties

@lenhard

lenhard commented Aug 3, 2017

Copy link
Copy Markdown
Member Author

The style inheritance works for some items, but not for all (such as context menu items).

Some of the buttons are defined in FXML and their tooltips are defined in FXML. @Siedlerchr @tobiasdiez Any tipps on how to make the font size customizable for these items? Moreover, how does this work with localization?

@tobiasdiez

tobiasdiez commented Aug 3, 2017

Copy link
Copy Markdown
Member

You should be able to style the context menu (and similar the tooltip) by using appropiate css tags, e.g.

.context-menu {
 -fx-font-size: Globals.prefs.getInt(JabRefPreferences.MENU_FONT_SIZE) + "pt;");
}

It is probably enough to specify this once for the entry editor tab.
See https://stackoverflow.com/questions/11127999/how-do-you-set-the-style-for-a-javafx-contextmenu-using-css.

+ "text-area-foreground: " + convertToHex(GUIGlobals.editorTextColor) + ";"
+ "text-area-highlight: " + convertToHex(GUIGlobals.activeBackgroundColor) + ";");
+ "text-area-highlight: " + convertToHex(GUIGlobals.activeBackgroundColor) + ";"
+ "text-area-font-size: " + Globals.prefs.getInt(JabRefPreferences.MENU_FONT_SIZE) + "pt;");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding + "-fx-font-size: 20pt;" here without any other code changes seems to do the trick.

@lenhard

lenhard commented Aug 8, 2017

Copy link
Copy Markdown
Member Author

#3034 supersedes this PR, therefore I am closing it.

@lenhard lenhard closed this Aug 8, 2017
@koppor koppor deleted the editor-fontsize branch August 18, 2017 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants