Changeset 17730 in josm for trunk/src/org


Ignore:
Timestamp:
2021-04-09T21:22:52+02:00 (4 years ago)
Author:
simon04
Message:

see #16163 - MainApplication: apply component orientation based on locale

File:
1 edited

Legend:

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

    r17704 r17730  
    66import java.awt.BorderLayout;
    77import java.awt.Component;
     8import java.awt.ComponentOrientation;
    89import java.awt.Image;
    910import java.awt.Rectangle;
     
    1516import java.beans.PropertyChangeListener;
    1617import java.util.List;
     18import java.util.Locale;
    1719import java.util.Objects;
    1820import java.util.stream.Collectors;
     
    7375        this.panel = new MainPanel(MainApplication.getLayerManager());
    7476        setContentPane(new JPanel(new BorderLayout()));
     77        setComponentOrientation();
     78    }
     79
     80    private void setComponentOrientation() {
     81        ComponentOrientation orientation = ComponentOrientation.getOrientation(Locale.getDefault());
     82        if (orientation == ComponentOrientation.RIGHT_TO_LEFT) {
     83            Logging.info(tr("Setting component orientation to right-to-left"));
     84        }
     85        applyComponentOrientation(orientation);
    7586    }
    7687
Note: See TracChangeset for help on using the changeset viewer.