Only case (I know of) to hide the Edit button is if we're both running Linux and confined to a snap

This commit is contained in:
JoePfeiffer 2023-01-25 09:24:20 -07:00
parent 9692400b9d
commit 8a0ba46624
2 changed files with 6 additions and 4 deletions

View File

@ -32,6 +32,8 @@ import net.sf.openrocket.appearance.AppearanceBuilder;
import net.sf.openrocket.appearance.Decal.EdgeMode;
import net.sf.openrocket.appearance.DecalImage;
import net.sf.openrocket.appearance.defaults.DefaultAppearance;
import net.sf.openrocket.arch.SystemInfo;
import net.sf.openrocket.arch.SystemInfo.Platform;
import net.sf.openrocket.document.OpenRocketDocument;
import net.sf.openrocket.gui.SpinnerEditor;
import net.sf.openrocket.gui.adaptors.BooleanModel;
@ -576,14 +578,14 @@ public class AppearancePanel extends JPanel {
p.add(textureDropDown, "grow");
panel.add(p, "spanx 3, growx, wrap");
order.add(textureDropDown);
//// Edit button
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.EDIT)) {
if ((SystemInfo.getPlatform() != Platform.UNIX) || !SystemInfo.isConfined()) {
JButton editBtn = new SelectColorButton(
trans.get("AppearanceCfg.but.edit"));
editBtn.setEnabled(!materialDefault.isSelected() && builder.getImage() != null);
// Enable the editBtn only when the appearance builder has an Image
// assigned to it.
editBtn.setEnabled(!materialDefault.isSelected() && builder.getImage() != null);
builder.addChangeListener(new StateChangeListener() {
@Override
public void stateChanged(EventObject e) {

View File

@ -145,7 +145,7 @@ public class GraphicsPreferencesPanel extends PreferencesPanel {
* we will rely on using the xdg-open command which allows the user to pick
* their preferred application.
*/
if (SystemInfo.getPlatform() != Platform.UNIX || !SystemInfo.isConfined()) {
if ((SystemInfo.getPlatform() != Platform.UNIX) || !SystemInfo.isConfined()) {
this.add(editorPrefPanel, "growx, span");
}