mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
renderer: add support for metal
This commit is contained in:
@ -123,6 +123,7 @@ pub const DerivedConfig = struct {
|
|||||||
foreground: terminal.color.RGB,
|
foreground: terminal.color.RGB,
|
||||||
selection_background: ?terminal.color.RGB,
|
selection_background: ?terminal.color.RGB,
|
||||||
selection_foreground: ?terminal.color.RGB,
|
selection_foreground: ?terminal.color.RGB,
|
||||||
|
invert_selection_fg_bg: bool,
|
||||||
|
|
||||||
pub fn init(
|
pub fn init(
|
||||||
alloc_gpa: Allocator,
|
alloc_gpa: Allocator,
|
||||||
@ -161,6 +162,7 @@ pub const DerivedConfig = struct {
|
|||||||
|
|
||||||
.background = config.background.toTerminalRGB(),
|
.background = config.background.toTerminalRGB(),
|
||||||
.foreground = config.foreground.toTerminalRGB(),
|
.foreground = config.foreground.toTerminalRGB(),
|
||||||
|
.invert_selection_fg_bg = config.@"invert-selection-fg-bg",
|
||||||
|
|
||||||
.selection_background = if (config.@"selection-background") |bg|
|
.selection_background = if (config.@"selection-background") |bg|
|
||||||
bg.toTerminalRGB()
|
bg.toTerminalRGB()
|
||||||
@ -1306,8 +1308,8 @@ pub fn updateCell(
|
|||||||
const colors: BgFg = colors: {
|
const colors: BgFg = colors: {
|
||||||
// If we are selected, we our colors are just inverted fg/bg
|
// If we are selected, we our colors are just inverted fg/bg
|
||||||
const selection_res: ?BgFg = if (selected) .{
|
const selection_res: ?BgFg = if (selected) .{
|
||||||
.bg = self.config.selection_background orelse self.foreground_color,
|
.bg = if (self.config.invert_selection_fg_bg) cell.fg else self.config.selection_background orelse self.foreground_color,
|
||||||
.fg = self.config.selection_foreground orelse self.background_color,
|
.fg = if (self.config.invert_selection_fg_bg) cell.bg else self.config.selection_foreground orelse self.background_color,
|
||||||
} else null;
|
} else null;
|
||||||
|
|
||||||
const res: BgFg = selection_res orelse if (!cell.attrs.inverse) .{
|
const res: BgFg = selection_res orelse if (!cell.attrs.inverse) .{
|
||||||
|
Reference in New Issue
Block a user