56 lines
2.2 KiB
Kotlin
56 lines
2.2 KiB
Kotlin
package io.gitlab.jfronny.inceptum.gtk.window.settings.instance
|
|
|
|
import io.gitlab.jfronny.inceptum.gtk.control.ILabel
|
|
import io.gitlab.jfronny.inceptum.gtk.control.KDropDown
|
|
import io.gitlab.jfronny.inceptum.gtk.control.settings.SettingsTab
|
|
import io.gitlab.jfronny.inceptum.launcher.system.instance.Instance
|
|
import org.gnome.adw.Leaflet
|
|
import org.gnome.adw.LeafletTransitionType
|
|
import org.gnome.gtk.Box
|
|
import org.gnome.gtk.Orientation
|
|
import org.gnome.gtk.SearchBar
|
|
import org.gnome.gtk.SearchEntry
|
|
import org.gnome.gtk.Separator
|
|
|
|
class ModsTab(instance: Instance?, window: InstanceSettingsWindow?) : SettingsTab<Leaflet>(window, Leaflet()) {
|
|
init {
|
|
content.apply {
|
|
homogeneous = false
|
|
canNavigateBack = true
|
|
transitionType = LeafletTransitionType.OVER
|
|
append(Box(Orientation.VERTICAL, 6).apply {
|
|
content.visibleChild = this
|
|
append(KDropDown("instance.settings.mods.local", "instance.settings.mods.modrinth", "instance.settings.mods.curseforge").apply {
|
|
onChange { newFilter ->
|
|
when (newFilter) {
|
|
0 -> switchToLocalMods()
|
|
1 -> switchToModrinthMods()
|
|
2 -> switchToCurseforgeMods()
|
|
}
|
|
}
|
|
})
|
|
append(SearchBar().apply {
|
|
hexpand = false
|
|
showCloseButton = false
|
|
searchMode = false
|
|
val entry = SearchEntry().apply {
|
|
onSearchChanged { updateSearch(text) }
|
|
}
|
|
child = entry
|
|
keyCaptureWidget = entry
|
|
})
|
|
})
|
|
append(Separator(Orientation.VERTICAL)).navigatable = false
|
|
append(Box(Orientation.VERTICAL, 6).apply {
|
|
append(ILabel("instance.settings.mods.unsupported"))
|
|
//TODO content
|
|
})
|
|
}
|
|
}
|
|
|
|
fun switchToLocalMods(): Unit = TODO("set up")
|
|
fun switchToModrinthMods(): Unit = TODO("set up")
|
|
fun switchToCurseforgeMods(): Unit = TODO("set up")
|
|
fun updateSearch(search: String): Unit = TODO("set up")
|
|
}
|