System File Chooser: Linux: show file dialog in dark if current FlatLaf theme is dark (PR #988)
Some checks failed
CI / build (push) Has been cancelled
CI / release (push) Has been cancelled
Error Prone / error-prone (push) Has been cancelled
Native Libraries / Natives (macos-latest) (push) Has been cancelled
Native Libraries / Natives (ubuntu-24.04-arm) (push) Has been cancelled
Native Libraries / Natives (ubuntu-latest) (push) Has been cancelled
Native Libraries / Natives (windows-latest) (push) Has been cancelled

This commit is contained in:
Karl Tauber
2025-12-02 14:11:10 +01:00
parent 58e073a05b
commit 9e8b8697d1
6 changed files with 60 additions and 10 deletions

View File

@@ -24,6 +24,7 @@ import java.awt.Window;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;
import javax.swing.*;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.extras.components.*;
import com.formdev.flatlaf.extras.components.FlatTriStateCheckBox.State;
import com.formdev.flatlaf.testing.FlatSystemFileChooserTest.DummyModalDialog;
@@ -121,8 +122,9 @@ public class FlatSystemFileChooserLinuxTest
System.out.println( FlatNativeLinuxLibrary.isGtk3Available() );
int dark = FlatLaf.isLafDark() ? 1 : 0;
if( direct ) {
String[] files = FlatNativeLinuxLibrary.showFileChooser( owner, open,
String[] files = FlatNativeLinuxLibrary.showFileChooser( owner, dark, open,
title, okButtonLabel, currentName, currentFolder,
optionsSet.get(), optionsClear.get(), callback, fileTypeIndex, fileTypes );
@@ -132,7 +134,7 @@ public class FlatSystemFileChooserLinuxTest
String[] fileTypes2 = fileTypes;
new Thread( () -> {
String[] files = FlatNativeLinuxLibrary.showFileChooser( owner, open,
String[] files = FlatNativeLinuxLibrary.showFileChooser( owner, dark, open,
title, okButtonLabel, currentName, currentFolder,
optionsSet.get(), optionsClear.get(), callback, fileTypeIndex, fileTypes2 );