mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-18 20:40:20 -07:00
Working Gitlab search
This commit is contained in:
parent
cf6bb51d2c
commit
eee924e915
6 changed files with 26 additions and 30 deletions
|
|
@ -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