diff --git a/src/config/Config.zig b/src/config/Config.zig index d32740783..facbdb21d 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -39,6 +39,7 @@ pub const Path = @import("path.zig").Path; pub const RepeatablePath = @import("path.zig").RepeatablePath; const ClipboardCodepointMap = @import("ClipboardCodepointMap.zig"); const KeyRemapSet = @import("../input/key_mods.zig").RemapSet; +pub const WindowPaddingBalance = @import("../renderer/size.zig").PaddingBalance; const string = @import("string.zig"); // We do this instead of importing all of terminal/main.zig to @@ -5245,12 +5246,6 @@ pub const Fullscreen = enum(c_int) { @"non-native-padded-notch", }; -pub const WindowPaddingBalance = enum { - false, - true, - equal, -}; - pub const WindowPaddingColor = enum { background, extend, diff --git a/src/renderer/size.zig b/src/renderer/size.zig index 7a022cdb4..6cf05f58a 100644 --- a/src/renderer/size.zig +++ b/src/renderer/size.zig @@ -1,10 +1,22 @@ const std = @import("std"); const Allocator = std.mem.Allocator; -const configpkg = @import("../config.zig"); const terminal_size = @import("../terminal/size.zig"); const log = std.log.scoped(.renderer_size); +/// Controls how extra whitespace around the terminal grid is distributed. +pub const PaddingBalance = enum { + /// No balancing; padding is applied as specified explicitly. + false, + /// Balances padding but caps the top padding so the first row doesn't + /// drift too far from the top of the window. Excess vertical space is + /// shifted to the bottom. + true, + /// Distributes leftover space equally on all sides so the grid is + /// centered within the screen. + equal, +}; + /// All relevant sizes for a rendered terminal. These are all the sizes that /// any functionality should need to know about the terminal in order to /// convert between any coordinate systems. @@ -37,7 +49,7 @@ pub const Size = struct { pub fn balancePadding( self: *Size, explicit: Padding, - mode: configpkg.Config.WindowPaddingBalance, + mode: PaddingBalance, ) void { // This ensure grid() does the right thing self.padding = explicit;