1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
//! Effects settings tab.
//!
//! Consolidates: background_tab (refactored)
//!
//! Contains:
//! - Background mode (default/color/image)
//! - Background image settings
//! - Background shader settings
//! - Shader channel textures
//! - Inline image settings (Sixel, iTerm2, Kitty)
//! - Cursor shader settings
use par_term_config::ImageScalingMode;
use std::collections::HashSet;
use super::SettingsUI;
use super::section::{collapsing_section, section_matches};
/// Show the effects tab content.
pub fn show(
ui: &mut egui::Ui,
settings: &mut SettingsUI,
changes_this_frame: &mut bool,
collapsed: &mut HashSet<String>,
) {
let query = settings.search_query.trim().to_lowercase();
// Background section
if section_matches(
&query,
"Background",
&[
"background",
"image",
"color",
"mode",
"wallpaper",
"shader",
"glsl",
"fit",
"fill",
"stretch",
"tile",
"center",
],
) {
// Delegate to the existing background_tab implementation
super::background_tab::show_background(ui, settings, changes_this_frame, collapsed);
}
// Per-Pane Background section
if section_matches(
&query,
"Per-Pane Background",
&[
"per-pane",
"pane background",
"pane image",
"split background",
"per pane",
],
) {
super::background_tab::show_pane_backgrounds(ui, settings, changes_this_frame, collapsed);
}
// Inline Images section (Sixel, iTerm2, Kitty)
if section_matches(
&query,
"Inline Images",
&[
"inline",
"image",
"sixel",
"iterm",
"kitty",
"scaling",
"aspect",
"graphics protocol",
"nearest neighbor",
"linear",
],
) {
show_inline_images(ui, settings, changes_this_frame, collapsed);
}
// Cursor Shader section
if section_matches(
&query,
"Cursor Shader",
&[
"cursor shader",
"trail",
"glow",
"cursor effect",
"glsl",
"animation",
],
) {
// Delegate to the existing cursor shader implementation
super::background_tab::show_cursor_shader(ui, settings, changes_this_frame, collapsed);
}
}
/// Show inline image settings (Sixel, iTerm2, Kitty protocols).
fn show_inline_images(
ui: &mut egui::Ui,
settings: &mut SettingsUI,
changes_this_frame: &mut bool,
collapsed: &mut HashSet<String>,
) {
collapsing_section(
ui,
"Inline Images (Sixel, iTerm2, Kitty)",
"inline_images",
true,
collapsed,
|ui| {
ui.label("Settings for inline graphics rendered in the terminal.");
ui.add_space(4.0);
// Image scaling mode (nearest vs linear)
ui.horizontal(|ui| {
ui.label("Scaling quality:");
let current = settings.config.image_scaling_mode;
egui::ComboBox::from_id_salt("image_scaling_mode")
.selected_text(current.display_name())
.show_ui(ui, |ui| {
for mode in ImageScalingMode::all() {
if ui
.selectable_label(current == *mode, mode.display_name())
.clicked()
{
settings.config.image_scaling_mode = *mode;
settings.has_changes = true;
*changes_this_frame = true;
}
}
});
});
// Preserve aspect ratio
if ui
.checkbox(
&mut settings.config.image_preserve_aspect_ratio,
"Preserve aspect ratio",
)
.on_hover_text(
"Maintain image proportions when scaling. When disabled, images stretch to fill their cell grid.",
)
.changed()
{
settings.has_changes = true;
*changes_this_frame = true;
}
},
);
}
/// Search keywords for the Effects settings tab.
pub fn keywords() -> &'static [&'static str] {
&[
// Background
"background",
"background mode",
"background image",
"background color",
"image",
"image mode",
"fit",
"fill",
"stretch",
"tile",
"center",
// Background shader
"shader",
"custom shader",
"animation",
"animation speed",
"hot reload",
"brightness",
"text opacity",
"full content",
// Shader channels
"channel",
"ichannel",
"texture",
"cubemap",
// Inline images
"inline image",
"sixel",
"iterm",
"kitty",
"scaling",
"aspect ratio",
"nearest",
"linear",
// Cursor shader
"cursor shader",
"cursor effect",
"trail",
"glow",
"hides cursor",
"alt screen",
// Per-pane background
"per-pane background",
"pane image",
"split background",
"per pane",
"darken",
"pane darken",
// Hot reload extras
"hot reload delay",
"reload delay",
// Shader overrides
"per-shader",
"shader override",
"shader defaults",
// Cubemap extras
"cubemap enabled",
"enable cubemap",
// Per-pane extras
"identify panes",
// Background as texture
"background as ichannel",
"background as texture",
]
}