mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-184075 Resize the terminal relative to the bottom-left corner
GitOrigin-RevId: 12dbcb528c511b72de239376071cce2b9e71005e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c161a522a1
commit
4d4e19e450
+10
-1
@@ -52,6 +52,7 @@ import org.jetbrains.plugins.terminal.fus.TerminalStartupFusInfo
|
||||
import org.jetbrains.plugins.terminal.util.terminalProjectScope
|
||||
import java.awt.Component
|
||||
import java.awt.Dimension
|
||||
import java.awt.Point
|
||||
import java.awt.event.*
|
||||
import java.util.concurrent.CompletableFuture
|
||||
import javax.swing.JComponent
|
||||
@@ -392,7 +393,7 @@ internal class ReworkedTerminalView(
|
||||
|
||||
TerminalFontSizeProviderImpl.getInstance().addListener(parentDisposable, object : TerminalFontSizeProvider.Listener {
|
||||
override fun fontChanged() {
|
||||
result.setFontSize(TerminalFontSizeProviderImpl.getInstance().getFontSize())
|
||||
result.setFontSize(TerminalFontSizeProviderImpl.getInstance().getFontSize(), result.bottomLeftCornerOrNull())
|
||||
result.resizeIfShowing()
|
||||
}
|
||||
})
|
||||
@@ -400,6 +401,14 @@ internal class ReworkedTerminalView(
|
||||
return result
|
||||
}
|
||||
|
||||
private fun EditorImpl.bottomLeftCornerOrNull(): Point? =
|
||||
if (component.isShowing) {
|
||||
Point(0, scrollingModel.visibleArea.height)
|
||||
}
|
||||
else {
|
||||
null
|
||||
}
|
||||
|
||||
private fun EditorImpl.resizeIfShowing() {
|
||||
if (component.isShowing) { // to avoid sending the resize event twice, for the regular and alternate buffer editors
|
||||
sendResizeEvent()
|
||||
|
||||
Reference in New Issue
Block a user