add bold font style options to the History settings tab font options

This commit is contained in:
Gered 2016-01-16 22:37:18 -05:00
parent bb68eb53f7
commit fbc1a28068
3 changed files with 22 additions and 0 deletions

View file

@ -233,6 +233,7 @@ public enum Language {
ACCEPT, ACCEPT,
APPLICATION, APPLICATION,
BEST, BEST,
BOLD,
CANCEL, CANCEL,
COMPARE_METHOD, COMPARE_METHOD,
COMPONENTS, COMPONENTS,

View file

@ -69,10 +69,14 @@ class TabHistory extends SettingsTab implements ActionListener, ChangeListener {
private JComboBox nameFont; private JComboBox nameFont;
private JCheckBox nameFontBold;
private JSpinner nameSize; private JSpinner nameSize;
private JComboBox timeFont; private JComboBox timeFont;
private JCheckBox timeFontBold;
private JSpinner timeSize; private JSpinner timeSize;
// ----------------------------------------------------------- CONSTRUCTORS // ----------------------------------------------------------- CONSTRUCTORS
@ -145,6 +149,14 @@ class TabHistory extends SettingsTab implements ActionListener, ChangeListener {
timeFont.setPreferredSize(new Dimension(130, 22)); timeFont.setPreferredSize(new Dimension(130, 22));
timeFont.addActionListener(this); timeFont.addActionListener(this);
nameFontBold = new JCheckBox("" + Language.BOLD);
nameFontBold.setSelected(Settings.historySegmentFont.get().isBold());
nameFontBold.addChangeListener(this);
timeFontBold = new JCheckBox("" + Language.BOLD);
timeFontBold.setSelected(Settings.historyTimeFont.get().isBold());
timeFontBold.addChangeListener(this);
nameSize = new JSpinner(new SpinnerNumberModel( nameSize = new JSpinner(new SpinnerNumberModel(
Settings.historySegmentFont.get().getSize(), 8, 240, 1) Settings.historySegmentFont.get().getSize(), 8, 240, 1)
); );
@ -223,6 +235,12 @@ class TabHistory extends SettingsTab implements ActionListener, ChangeListener {
Settings.historyTimeFont.set( Settings.historyTimeFont.set(
Settings.historyTimeFont.get().deriveFont((float) size) Settings.historyTimeFont.get().deriveFont((float) size)
); );
} else if (source.equals(nameFontBold)) {
int style = nameFontBold.isSelected() ? Font.BOLD : Font.PLAIN;
Settings.historySegmentFont.set(Settings.historySegmentFont.get().deriveFont(style));
} else if (source.equals(timeFontBold)) {
int style = timeFontBold.isSelected() ? Font.BOLD : Font.PLAIN;
Settings.historyTimeFont.set(Settings.historyTimeFont.get().deriveFont(style));
} }
} }
@ -303,12 +321,14 @@ class TabHistory extends SettingsTab implements ActionListener, ChangeListener {
); );
fonts.add(nameFont, GBC.grid(1, 0).anchor(GBC.LINE_START).insets(5, 5)); fonts.add(nameFont, GBC.grid(1, 0).anchor(GBC.LINE_START).insets(5, 5));
fonts.add(nameSize, GBC.grid(2, 0).anchor(GBC.LINE_START)); fonts.add(nameSize, GBC.grid(2, 0).anchor(GBC.LINE_START));
fonts.add(nameFontBold, GBC.grid(3, 0).anchor(GBC.LINE_START));
fonts.add( fonts.add(
new JLabel("" + Language.setting_history_timeFont), new JLabel("" + Language.setting_history_timeFont),
GBC.grid(0, 1).anchor(GBC.LINE_END) GBC.grid(0, 1).anchor(GBC.LINE_END)
); );
fonts.add(timeFont, GBC.grid(1, 1).anchor(GBC.LINE_START).insets(5, 5)); fonts.add(timeFont, GBC.grid(1, 1).anchor(GBC.LINE_START).insets(5, 5));
fonts.add(timeSize, GBC.grid(2, 1).anchor(GBC.LINE_START)); fonts.add(timeSize, GBC.grid(2, 1).anchor(GBC.LINE_START));
fonts.add(timeFontBold, GBC.grid(3, 1).anchor(GBC.LINE_START));
fonts.setBorder( fonts.setBorder(
BorderFactory.createTitledBorder("" + Language.PN_FONTS) BorderFactory.createTitledBorder("" + Language.PN_FONTS)
); );

View file

@ -207,6 +207,7 @@ HUNDREDTH = 100th of a second
ACCEPT = Accept ACCEPT = Accept
APPLICATION = Application APPLICATION = Application
BEST = Best Segment BEST = Best Segment
BOLD = Bold
CANCEL = Cancel CANCEL = Cancel
COMPARE_METHOD = Compare Method COMPARE_METHOD = Compare Method
COMPONENTS = Components COMPONENTS = Components