Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-345 Restores original spacing between button and dropdown arrow in toolbar #362

Merged
merged 2 commits into from
Jun 18, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ public class SwingController extends ComponentAdapter
private JLabel numberOfPagesLabel;
private JButton zoomInButton;
private JButton zoomOutButton;
private JComboBox zoomComboBox;
private JComboBox annotationPrivacyComboBox;
private JComboBox<String> zoomComboBox;
private JComboBox<String> annotationPrivacyComboBox;
private JToggleButton fitActualSizeButton;
private JToggleButton fitHeightButton;
private JToggleButton fitWidthButton;
Expand Down Expand Up @@ -1017,7 +1017,7 @@ public void setZoomOutButton(JButton btn) {
* @param zcb zoom level combo box values.
* @param zl default zoom level.
*/
public void setZoomComboBox(JComboBox zcb, float[] zl) {
public void setZoomComboBox(JComboBox<String> zcb, float[] zl) {
zoomComboBox = zcb;
documentViewController.setZoomLevels(zl);
zoomComboBox.setSelectedItem(NumberFormat.getPercentInstance().format(1.0));
Expand All @@ -1034,7 +1034,7 @@ public void setZoomInButton(JButton btn) {
btn.addActionListener(this);
}

public void setAnnotationPermissionComboBox(JComboBox zcb) {
public void setAnnotationPermissionComboBox(JComboBox<String> zcb) {
annotationPrivacyComboBox = zcb;
zcb.addItemListener(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ public JButton buildZoomOutButton() {
return btn;
}

public JComboBox buildZoomCombBox() {
public JComboBox<String> buildZoomCombBox() {
// Get the properties manager in preparation for trying to get the zoom levels
doubleCheckPropertiesManager();

Expand All @@ -1465,7 +1465,7 @@ public JComboBox buildZoomCombBox() {

JComboBox<String> tmp = new JComboBox<>();
tmp.setToolTipText(messageBundle.getString("viewer.toolbar.zoom.tooltip"));
tmp.setPreferredSize(new Dimension(90, tmp.getPreferredSize().height));
tmp.setPreferredSize(new Dimension(115, tmp.getPreferredSize().height));
for (float zoomLevel : zoomLevels)
tmp.addItem(NumberFormat.getPercentInstance().format(zoomLevel));
tmp.setEditable(true);
Expand All @@ -1484,11 +1484,11 @@ public JButton buildZoomInButton() {
return btn;
}

public JComboBox buildAnnotationPermissionCombBox() {
public JComboBox<String> buildAnnotationPermissionCombBox() {
JComboBox<String> tmp = new JComboBox<>();
tmp.setToolTipText(messageBundle.getString(
"viewer.utilityPane.markupAnnotation.view.publicToggleButton.tooltip.label"));
tmp.setPreferredSize(new Dimension(65, tmp.getPreferredSize().height));
tmp.setPreferredSize(new Dimension(105, tmp.getPreferredSize().height));
tmp.addItem(messageBundle.getString("viewer.utilityPane.markupAnnotation.view.publicToggleButton.label"));
tmp.addItem(messageBundle.getString("viewer.utilityPane.markupAnnotation.view.privateToggleButton.label"));
tmp.setEditable(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ public abstract class AbstractColorButton extends AbstractButton

public AbstractColorButton(Controller controller,
ResourceBundle messageBundle) {
super();
this.controller = controller;

dropDownArrowButton = new JButton(new MetalComboBoxIcon());
dropDownArrowButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
dropDownArrowButton.setContentAreaFilled(false);
dropDownArrowButton.setRolloverEnabled(false);
dropDownArrowButton.setFocusPainted(false);
Expand Down