mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-16 03:20:21 -07:00
Edge snap fix
This commit is contained in:
parent
5240963743
commit
0c1e445a95
2 changed files with 64 additions and 39 deletions
BIN
plugin-playground/src/main/kotlin/KondoKit/.DS_Store
vendored
BIN
plugin-playground/src/main/kotlin/KondoKit/.DS_Store
vendored
Binary file not shown.
|
|
@ -320,10 +320,27 @@ class plugin : Plugin() {
|
|||
}
|
||||
|
||||
private fun updateDisplaySettings() {
|
||||
val applyDisplaySettings = {
|
||||
val mode = GetWindowMode()
|
||||
val currentScrollPaneWidth = if (mainContentPanel.isVisible) NAVBAR_WIDTH + MAIN_CONTENT_WIDTH else NAVBAR_WIDTH
|
||||
lastUIOffset = uiOffset
|
||||
|
||||
// Ensure the scroll wrapper stays attached on the EAST edge even if the game resets the layout
|
||||
rightPanelWrapper?.let { wrapper ->
|
||||
val needsLayoutReset = frame.layout !is BorderLayout
|
||||
val needsAttach = wrapper.parent != frame
|
||||
if (needsLayoutReset || needsAttach) {
|
||||
wrapper.parent?.remove(wrapper)
|
||||
frame.layout = BorderLayout()
|
||||
frame.add(wrapper, BorderLayout.EAST)
|
||||
if (altCanvas != null) {
|
||||
moveAltCanvasToFront()
|
||||
} else {
|
||||
moveCanvasToFront()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(mode != WindowMode.FIXED) {
|
||||
destroyAltCanvas()
|
||||
} else if (useScaledFixed && altCanvas == null) {
|
||||
|
|
@ -366,6 +383,14 @@ class plugin : Plugin() {
|
|||
rightPanelWrapper?.isDoubleBuffered = true
|
||||
rightPanelWrapper?.revalidate()
|
||||
rightPanelWrapper?.repaint()
|
||||
frame.validate()
|
||||
}
|
||||
|
||||
if (SwingUtilities.isEventDispatchThread()) {
|
||||
applyDisplaySettings()
|
||||
} else {
|
||||
SwingUtilities.invokeLater { applyDisplaySettings() }
|
||||
}
|
||||
}
|
||||
|
||||
fun OnKondoValueUpdated(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue