Lines 46-52
Link Here
|
46 |
|
46 |
|
47 |
import java.awt.Color; |
47 |
import java.awt.Color; |
48 |
import java.awt.Component; |
48 |
import java.awt.Component; |
49 |
import java.awt.Frame; |
|
|
50 |
import java.awt.GridLayout; |
49 |
import java.awt.GridLayout; |
51 |
import java.awt.Point; |
50 |
import java.awt.Point; |
52 |
import java.awt.Rectangle; |
51 |
import java.awt.Rectangle; |
Lines 76-82
Link Here
|
76 |
import org.netbeans.spi.settings.Saver; |
75 |
import org.netbeans.spi.settings.Saver; |
77 |
import org.openide.awt.Actions; |
76 |
import org.openide.awt.Actions; |
78 |
import org.openide.awt.Mnemonics; |
77 |
import org.openide.awt.Mnemonics; |
79 |
import org.openide.windows.WindowManager; |
|
|
80 |
|
78 |
|
81 |
/** |
79 |
/** |
82 |
* Toolbar configuration, it contains toolbar panel with a list of toolbar rows. |
80 |
* Toolbar configuration, it contains toolbar panel with a list of toolbar rows. |
Lines 202-235
Link Here
|
202 |
|
200 |
|
203 |
//Bigger toolbar icons |
201 |
//Bigger toolbar icons |
204 |
boolean smallToolbarIcons = (getToolbarPool().getPreferredIconSize() == 16); |
202 |
boolean smallToolbarIcons = (getToolbarPool().getPreferredIconSize() == 16); |
|
|
203 |
final String stiName = NbBundle.getMessage(ToolbarConfiguration.class, "CTL_SmallIcons"); |
205 |
|
204 |
|
206 |
JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem( NbBundle.getMessage(ToolbarConfiguration.class, "PROP_smallToolbarIcons"), smallToolbarIcons ); |
205 |
if (!stiName.isEmpty()) { |
|
|
206 |
JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem( stiName, smallToolbarIcons ); |
207 |
cbmi.addActionListener (new ActionListener () { |
208 |
@Override |
209 |
public void actionPerformed (ActionEvent ev) { |
210 |
if (ev.getSource() instanceof JCheckBoxMenuItem) { |
211 |
JCheckBoxMenuItem cb = (JCheckBoxMenuItem) ev.getSource(); |
212 |
// toggle big/small icons |
213 |
boolean state = cb.getState(); |
214 |
if (state) { |
215 |
ToolbarPool.getDefault().setPreferredIconSize(16); |
216 |
} else { |
217 |
ToolbarPool.getDefault().setPreferredIconSize(24); |
218 |
} |
219 |
//Rebuild toolbar panel |
220 |
//#43652: Find current toolbar configuration |
221 |
String name = ToolbarPool.getDefault().getConfiguration(); |
222 |
ToolbarConfiguration tbConf = findConfiguration(name); |
223 |
if (tbConf != null) { |
224 |
tbConf.refresh(); |
225 |
} |
226 |
} |
227 |
} |
228 |
}); |
229 |
cbmi.setEnabled( !fullScreen ); |
230 |
menu.add (cbmi); |
231 |
menu.add( new JPopupMenu.Separator() ); |
232 |
} |
207 |
|
233 |
|
208 |
cbmi.addActionListener (new ActionListener () { |
|
|
209 |
public void actionPerformed (ActionEvent ev) { |
210 |
if (ev.getSource() instanceof JCheckBoxMenuItem) { |
211 |
JCheckBoxMenuItem cb = (JCheckBoxMenuItem) ev.getSource(); |
212 |
// toggle big/small icons |
213 |
boolean state = cb.getState(); |
214 |
if (state) { |
215 |
ToolbarPool.getDefault().setPreferredIconSize(16); |
216 |
} else { |
217 |
ToolbarPool.getDefault().setPreferredIconSize(24); |
218 |
} |
219 |
//Rebuild toolbar panel |
220 |
//#43652: Find current toolbar configuration |
221 |
String name = ToolbarPool.getDefault().getConfiguration(); |
222 |
ToolbarConfiguration tbConf = findConfiguration(name); |
223 |
if (tbConf != null) { |
224 |
tbConf.refresh(); |
225 |
} |
226 |
} |
227 |
} |
228 |
}); |
229 |
cbmi.setEnabled( !fullScreen ); |
230 |
menu.add (cbmi); |
231 |
|
232 |
menu.add( new JPopupMenu.Separator() ); |
233 |
|
234 |
|
234 |
JMenuItem menuItem = new JMenuItem( new ResetToolbarsAction() ); |
235 |
JMenuItem menuItem = new JMenuItem( new ResetToolbarsAction() ); |
235 |
menuItem.setEnabled( !fullScreen ); |
236 |
menuItem.setEnabled( !fullScreen ); |