Skip to content

Commit

Permalink
Merge pull request #44 from tobiasdiez/hideTaskbar
Browse files Browse the repository at this point in the history
Add entry under the 'View' menu to hide the toolbar
  • Loading branch information
koppor committed May 13, 2015
2 parents 5f96f9d + 769090b commit 637ed6e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
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

0 comments on commit 637ed6e

Please sign in to comment.