Changeset 3664 in josm for trunk/src


Ignore:
Timestamp:
2010-11-20T20:26:30+01:00 (14 years ago)
Author:
bastiK
Message:

gui fine tuning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r3662 r3664  
    180180        layerList.setShowGrid(false);
    181181        layerList.setIntercellSpacing(new Dimension(0, 0));
    182         final int ICON_WIDTH = 16;
    183182        layerList.getColumnModel().getColumn(0).setCellRenderer(new ActiveLayerCellRenderer());
    184183        layerList.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(new ActiveLayerCheckBox()));
    185         layerList.getColumnModel().getColumn(0).setMaxWidth(ICON_WIDTH);
    186         layerList.getColumnModel().getColumn(0).setPreferredWidth(ICON_WIDTH);
     184        layerList.getColumnModel().getColumn(0).setMaxWidth(12);
     185        layerList.getColumnModel().getColumn(0).setPreferredWidth(12);
    187186        layerList.getColumnModel().getColumn(0).setResizable(false);
    188187        layerList.getColumnModel().getColumn(1).setCellRenderer(new LayerVisibleCellRenderer());
    189188        layerList.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(new LayerVisibleCheckBox()));
    190         layerList.getColumnModel().getColumn(1).setMaxWidth(ICON_WIDTH);
    191         layerList.getColumnModel().getColumn(1).setPreferredWidth(ICON_WIDTH);
     189        layerList.getColumnModel().getColumn(1).setMaxWidth(16);
     190        layerList.getColumnModel().getColumn(1).setPreferredWidth(16);
    192191        layerList.getColumnModel().getColumn(1).setResizable(false);
    193192        layerList.getColumnModel().getColumn(2).setCellRenderer(new LayerNameCellRenderer());
     
    391390            putValue(SHORT_DESCRIPTION, tr("Toggle visible state of the selected layer."));
    392391            putValue("help", HelpUtil.ht("/Dialog/LayerDialog#ShowHideLayer"));
    393             putValue(NAME, tr("Show/Hide"));
    394392            updateEnabledState();
    395393        }
     
    620618            setRolloverIcon(blank);
    621619            setRolloverSelectedIcon(active);
    622             setPressedIcon(active);
     620            setPressedIcon(ImageProvider.get("dialogs/layerlist", "active-pressed"));
    623621        }
    624622    }
     
    626624    private static class LayerVisibleCheckBox extends JCheckBox {
    627625        public LayerVisibleCheckBox() {
    628             setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
     626            setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    629627            ImageIcon eye = ImageProvider.get("dialogs/layerlist", "eye");
    630628            ImageIcon eye_off = ImageProvider.get("dialogs/layerlist", "eye-off");
     
    683681                label.setFont(label.getFont().deriveFont(Font.BOLD));
    684682            }
    685             //label.setEnabled(layer.isVisible());
    686683            label.setIcon(layer.getIcon());
    687684            label.setToolTipText(layer.getToolTipText());
     
    786783     * the properties {@see Layer#VISIBLE_PROP} and {@see Layer#NAME_PROP}.
    787784     */
    788     public static class LayerListModel extends AbstractTableModel implements MapView.LayerChangeListener, PropertyChangeListener {
     785    public class LayerListModel extends AbstractTableModel implements MapView.LayerChangeListener, PropertyChangeListener {
    789786        /** manages list selection state*/
    790787        private DefaultListSelectionModel selectionModel;
     
    939936            fireTableDataChanged();
    940937            int idx = getLayers().indexOf(layer);
     938            layerList.setRowHeight(idx, Math.max(16, layer.getIcon().getIconHeight()));
    941939            selectionModel.setSelectionInterval(idx, idx);
    942940            ensureSelectedIsVisible();
Note: See TracChangeset for help on using the changeset viewer.