Skip to content

Commit 637ed6e

Browse files
committed
Merge pull request #44 from tobiasdiez/hideTaskbar
Add entry under the 'View' menu to hide the toolbar
2 parents 5f96f9d + 769090b commit 637ed6e

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[master]
2+
- Feature: Make it possible to hide the toolbar
23
- Fix for bug #1270: Cleanup entries error 3
34
- Fix for bug #919: Accents don't export to RTF (by ruy.takata)
45
- Change the CrossRef content negotiation for bibtex DOI import (by sheffien)

src/main/java/net/sf/jabref/BasePanel.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,12 @@ public void action() {
691691
}
692692
});
693693

694+
// The action for toggling the visibility of the toolbar
695+
actions.put("toggleToolbar", new BaseAction() {
696+
public void action() {
697+
frame.tlb.setVisible(! frame.tlb.isVisible());
698+
}
699+
});
694700

695701
// action for collecting database strings from user
696702
actions.put("dbConnect", new DbConnectAction(this));

src/main/java/net/sf/jabref/JabRefFrame.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ void addAction(Action a) {
270270
editStrings = new GeneralAction("editStrings", "Edit strings",
271271
Globals.lang("Edit strings"),
272272
prefs.getKey("Edit strings")),
273+
toggleToolbar = new GeneralAction("toggleToolbar", "Hide/show toolbar",
274+
Globals.lang("Hide/show toolbar"),
275+
prefs.getKey("Hide/show toolbar")),
273276
toggleGroups = new GeneralAction("toggleGroups",
274277
"Toggle groups interface",
275278
Globals.lang("Toggle groups interface"),
@@ -470,6 +473,8 @@ public void windowClosing(WindowEvent e) {
470473

471474
initActions();
472475

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

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

817+
prefs.putBoolean("toolbarVisible", tlb.isVisible());
812818
prefs.putBoolean("searchPanelVisible", sidePaneManager.isComponentVisible("search"));
813819
// Store divider location for side pane:
814820
int width = contentPane.getDividerLocation();
@@ -1394,6 +1400,7 @@ private void fillMenu() {
13941400
view.add(increaseFontSize);
13951401
view.add(decreseFontSize);
13961402
view.addSeparator();
1403+
view.add(toggleToolbar);
13971404
view.add(toggleGroups);
13981405
view.add(togglePreview);
13991406
view.add(switchPreview);
@@ -1649,7 +1656,6 @@ private void createToolBar() {
16491656
//Insets margin = new Insets(0, 0, 0, 0);
16501657
//for (int i=0; i<tlb.getComponentCount(); i++)
16511658
// ((JButton)tlb.getComponentAtIndex(i)).setMargin(margin);
1652-
16531659
}
16541660

16551661

src/main/java/net/sf/jabref/JabRefPreferences.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ private JabRefPreferences() {
373373
defaults.put(EDIT_GROUP_MEMBERSHIP_MODE, Boolean.FALSE);
374374
defaults.put("highlightGroupsMatchingAny", Boolean.FALSE);
375375
defaults.put("highlightGroupsMatchingAll", Boolean.FALSE);
376+
defaults.put("toolbarVisible", Boolean.TRUE);
376377
defaults.put("searchPanelVisible", Boolean.FALSE);
377378
defaults.put("defaultEncoding", System.getProperty("file.encoding"));
378379
defaults.put("groupsVisibleRows", 8);

0 commit comments

Comments
 (0)