mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
add quick-terminal-animate-duration option
This commit is contained in:
@ -197,7 +197,7 @@ class QuickTerminalController: BaseTerminalController {
|
|||||||
// Run the animation that moves our window into the proper place and makes
|
// Run the animation that moves our window into the proper place and makes
|
||||||
// it visible.
|
// it visible.
|
||||||
NSAnimationContext.runAnimationGroup({ context in
|
NSAnimationContext.runAnimationGroup({ context in
|
||||||
context.duration = 0.2
|
context.duration = ghostty.config.quickTerminalAnimateDuration
|
||||||
context.timingFunction = .init(name: .easeIn)
|
context.timingFunction = .init(name: .easeIn)
|
||||||
position.setFinal(in: window.animator(), on: screen)
|
position.setFinal(in: window.animator(), on: screen)
|
||||||
}, completionHandler: {
|
}, completionHandler: {
|
||||||
@ -287,7 +287,7 @@ class QuickTerminalController: BaseTerminalController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NSAnimationContext.runAnimationGroup({ context in
|
NSAnimationContext.runAnimationGroup({ context in
|
||||||
context.duration = 0.2
|
context.duration = ghostty.config.quickTerminalAnimateDuration
|
||||||
context.timingFunction = .init(name: .easeIn)
|
context.timingFunction = .init(name: .easeIn)
|
||||||
position.setInitial(in: window.animator(), on: screen)
|
position.setInitial(in: window.animator(), on: screen)
|
||||||
}, completionHandler: {
|
}, completionHandler: {
|
||||||
|
@ -343,6 +343,14 @@ extension Ghostty {
|
|||||||
let str = String(cString: ptr)
|
let str = String(cString: ptr)
|
||||||
return QuickTerminalScreen(fromGhosttyConfig: str) ?? .main
|
return QuickTerminalScreen(fromGhosttyConfig: str) ?? .main
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var quickTerminalAnimateDuration: Double {
|
||||||
|
guard let config = self.config else { return 0.2 }
|
||||||
|
var v: Double = 0.2
|
||||||
|
let key = "quick-terminal-animate-duration"
|
||||||
|
_ = ghostty_config_get(config, &v, key, UInt(key.count))
|
||||||
|
return v
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
var resizeOverlay: ResizeOverlay {
|
var resizeOverlay: ResizeOverlay {
|
||||||
|
@ -1270,6 +1270,10 @@ keybind: Keybinds = .{},
|
|||||||
/// by the operating system.
|
/// by the operating system.
|
||||||
@"quick-terminal-screen": QuickTerminalScreen = .main,
|
@"quick-terminal-screen": QuickTerminalScreen = .main,
|
||||||
|
|
||||||
|
/// Duration (in seconds) of the quick terminal enter and exit animation.
|
||||||
|
/// Set it to 0 to disable animation.
|
||||||
|
@"quick-terminal-animate-duration": f64 = 0.2,
|
||||||
|
|
||||||
/// Whether to enable shell integration auto-injection or not. Shell integration
|
/// Whether to enable shell integration auto-injection or not. Shell integration
|
||||||
/// greatly enhances the terminal experience by enabling a number of features:
|
/// greatly enhances the terminal experience by enabling a number of features:
|
||||||
///
|
///
|
||||||
|
Reference in New Issue
Block a user