mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-10 10:20:44 -07:00
Working Gitlab search
This commit is contained in:
parent
cf6bb51d2c
commit
eee924e915
6 changed files with 26 additions and 30 deletions
|
|
@ -36,11 +36,10 @@ object GitLabPluginFetcher {
|
|||
|
||||
// Parse JSON response
|
||||
val gson = Gson()
|
||||
val treeItems = gson.fromJson(response, Array::class.java)
|
||||
val treeItems = gson.fromJson(response, Array<JsonObject>::class.java)
|
||||
|
||||
// Filter for directories (trees)
|
||||
for (item in treeItems) {
|
||||
val jsonObject = item as JsonObject
|
||||
for (jsonObject in treeItems) {
|
||||
if (jsonObject["type"].asString == "tree") {
|
||||
val folderId = jsonObject["id"].asString
|
||||
val folderPath = jsonObject["path"].asString
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import KondoKit.ImageCanvas
|
|||
import KondoKit.SpriteToBufferedImage
|
||||
import KondoKit.plugin.Companion.WIDGET_COLOR
|
||||
import KondoKit.plugin.Companion.secondaryColor
|
||||
import KondoKit.plugin.StateManager.focusedView
|
||||
import plugin.api.API
|
||||
import java.awt.*
|
||||
import java.awt.datatransfer.DataFlavor
|
||||
|
|
@ -11,10 +12,11 @@ import java.awt.event.*
|
|||
import javax.swing.*
|
||||
|
||||
open class SearchField(
|
||||
private val onSearch: (String) -> Unit,
|
||||
protected val onSearch: (String) -> Unit,
|
||||
private val placeholderText: String = "Search...",
|
||||
private val fieldWidth: Int = 230,
|
||||
private val fieldHeight: Int = 30
|
||||
private val fieldHeight: Int = 30,
|
||||
private val viewName: String? = null
|
||||
) : Canvas() {
|
||||
|
||||
private var cursorVisible: Boolean = true
|
||||
|
|
@ -101,8 +103,11 @@ open class SearchField(
|
|||
|
||||
Timer(500) { _ ->
|
||||
cursorVisible = !cursorVisible
|
||||
SwingUtilities.invokeLater {
|
||||
repaint()
|
||||
// Only repaint if the view is active or if viewName is not specified
|
||||
if (viewName == null || focusedView == viewName) {
|
||||
SwingUtilities.invokeLater {
|
||||
repaint()
|
||||
}
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue