Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[master]
- Feature: Make it possible to hide the toolbar
- Fix for bug #1270: Cleanup entries error 3
- Fix for bug #919: Accents don't export to RTF (by ruy.takata)
- Change the CrossRef content negotiation for bibtex DOI import (by sheffien)
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/net/sf/jabref/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,12 @@ public void action() {
}
});

// The action for toggling the visibility of the toolbar
actions.put("toggleToolbar", new BaseAction() {
public void action() {
frame.tlb.setVisible(! frame.tlb.isVisible());
}
});

// action for collecting database strings from user
actions.put("dbConnect", new DbConnectAction(this));
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/net/sf/jabref/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ void addAction(Action a) {
editStrings = new GeneralAction("editStrings", "Edit strings",
Globals.lang("Edit strings"),
prefs.getKey("Edit strings")),
toggleToolbar = new GeneralAction("toggleToolbar", "Hide/show toolbar",
Globals.lang("Hide/show toolbar"),
prefs.getKey("Hide/show toolbar")),
toggleGroups = new GeneralAction("toggleGroups",
"Toggle groups interface",
Globals.lang("Toggle groups interface"),
Expand Down Expand Up @@ -470,6 +473,8 @@ public void windowClosing(WindowEvent e) {

initActions();

// Show the toolbar if it was visible at last shutdown:
tlb.setVisible(Globals.prefs.getBoolean("toolbarVisible"));

setBounds(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds());
if ( !prefs.getBoolean("windowMaximised") ) {
Expand Down Expand Up @@ -809,6 +814,7 @@ public void quit() {
//prefs.putBoolean("windowMaximised", (getExtendedState()&MAXIMIZED_BOTH)>0);
prefs.putBoolean("windowMaximised", (getExtendedState() == Frame.MAXIMIZED_BOTH));

prefs.putBoolean("toolbarVisible", tlb.isVisible());
prefs.putBoolean("searchPanelVisible", sidePaneManager.isComponentVisible("search"));
// Store divider location for side pane:
int width = contentPane.getDividerLocation();
Expand Down Expand Up @@ -1394,6 +1400,7 @@ private void fillMenu() {
view.add(increaseFontSize);
view.add(decreseFontSize);
view.addSeparator();
view.add(toggleToolbar);
view.add(toggleGroups);
view.add(togglePreview);
view.add(switchPreview);
Expand Down Expand Up @@ -1649,7 +1656,6 @@ private void createToolBar() {
//Insets margin = new Insets(0, 0, 0, 0);
//for (int i=0; i<tlb.getComponentCount(); i++)
// ((JButton)tlb.getComponentAtIndex(i)).setMargin(margin);

}


Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/sf/jabref/JabRefPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ private JabRefPreferences() {
defaults.put(EDIT_GROUP_MEMBERSHIP_MODE, Boolean.FALSE);
defaults.put("highlightGroupsMatchingAny", Boolean.FALSE);
defaults.put("highlightGroupsMatchingAll", Boolean.FALSE);
defaults.put("toolbarVisible", Boolean.TRUE);
defaults.put("searchPanelVisible", Boolean.FALSE);
defaults.put("defaultEncoding", System.getProperty("file.encoding"));
defaults.put("groupsVisibleRows", 8);
Expand Down