diff --git a/app/src/processing/app/gradle/GradleService.kt b/app/src/processing/app/gradle/GradleService.kt index 2739a7519..23d25fba8 100644 --- a/app/src/processing/app/gradle/GradleService.kt +++ b/app/src/processing/app/gradle/GradleService.kt @@ -29,6 +29,8 @@ class GradleService( ) { val active = mutableStateOf(Preferences.getBoolean("run.use_gradle")) + val settings = GradleSettings() + var sketch: Sketch? = null set (value) { field = value @@ -77,5 +79,11 @@ class GradleService( fun setEnabled(active: Boolean) { if(!active) stopJobs() this.active.value = active + val editor = editor ?: return + if(active){ + editor.footer?.addPanel(settings, text("gradle.settings"), "/lib/footer/settings") + }else{ + editor.footer?.removePanel(settings) + } } } \ No newline at end of file diff --git a/app/src/processing/app/gradle/GradleSettings.kt b/app/src/processing/app/gradle/GradleSettings.kt new file mode 100644 index 000000000..9c05658ed --- /dev/null +++ b/app/src/processing/app/gradle/GradleSettings.kt @@ -0,0 +1,23 @@ +package processing.app.gradle + +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.awt.ComposePanel +import javax.swing.JPanel + +class GradleSettings : JPanel() { + init{ + val compose = ComposePanel() + compose.setContent { + Panel() + } + this.add(compose) + } + companion object{ + @Composable + fun Panel(){ + Text("Gradle settings will be here soon") + } + + } +} \ No newline at end of file diff --git a/app/src/processing/app/ui/EditorFooter.java b/app/src/processing/app/ui/EditorFooter.java index 276b78364..827fd90a8 100644 --- a/app/src/processing/app/ui/EditorFooter.java +++ b/app/src/processing/app/ui/EditorFooter.java @@ -154,11 +154,16 @@ public class EditorFooter extends Box { cardPanel.add(name, comp); } - -// public void setPanel(int index) { -// cardLayout.show(cardPanel, tabs.get(index).name); -// } - + /** + * Remove a panel from the footer. + * @param comp Component that links to this tab. + * */ + public void removePanel(Component comp){ + cardLayout.show(cardPanel, tabs.get(0).title); + tabs.removeIf(tab -> tab.comp == comp); + cardPanel.remove(comp); + repaint(); + } public void setPanel(Component comp) { for (Tab tab : tabs) { diff --git a/build/shared/lib/footer/settings.svg b/build/shared/lib/footer/settings.svg new file mode 100644 index 000000000..e2d89118a --- /dev/null +++ b/build/shared/lib/footer/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/build/shared/lib/languages/PDE.properties b/build/shared/lib/languages/PDE.properties index 8dcc6bae7..a4b6fedf6 100644 --- a/build/shared/lib/languages/PDE.properties +++ b/build/shared/lib/languages/PDE.properties @@ -324,6 +324,7 @@ debugger.type = Type gradle.instructions = About this file: \nProcessing creates this file when you run your sketch. \nIt configures the tools needed to build and export your code. \nLearn more: [Gradle Primer link]\n \nTo customize this file: \n1. Delete the line above that begins with '@processing-auto-generated'. \nThis will prevent Processing from overwriting this file in the future. \n2. Make your desired changes. gradle.using_gradle = Building sketch using the new build system. (See settings to switch to the legacy build system.) gradle.using_eclipse = Building sketch using the legacy build system. (See settings to switch to the new build system.) +gradle.settings = Settings # --------------------------------------- # Toolbars diff --git a/java/gradle/src/main/kotlin/ProcessingPlugin.kt b/java/gradle/src/main/kotlin/ProcessingPlugin.kt index 0af297e95..f84662820 100644 --- a/java/gradle/src/main/kotlin/ProcessingPlugin.kt +++ b/java/gradle/src/main/kotlin/ProcessingPlugin.kt @@ -69,7 +69,7 @@ class ProcessingPlugin @Inject constructor(private val objectFactory: ObjectFact extension.extensions.getByType(DesktopExtension::class.java).application { application -> // Set the class to be executed initially application.mainClass = sketchName - application.nativeDistributions.modules("java.management","jdk.jdwp.agent") + application.nativeDistributions.includeAllModules = true if(debugPort != null) { application.jvmArgs("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$debugPort") }