par-term-settings-ui 0.18.0

Settings UI for par-term terminal emulator
Documentation
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
//! Window settings tab.
//!
//! Consolidates: window_tab (original), tab_bar_tab, panes_tab, arrangements_tab
//!
//! Contains:
//! - Display settings (title, dimensions, padding)
//! - Transparency settings (opacity, blur)
//! - Performance settings (FPS, VSync, power saving)
//! - Window behavior (decorations, always on top, etc.)
//! - Tab bar settings
//! - Split panes settings
//! - Window arrangements (save and restore layouts)

use crate::SettingsUI;
use crate::section::section_matches;
use std::collections::HashSet;

mod behavior;
mod display;
mod panes;
mod performance;
mod scrollbar;
mod tab_bar;
mod tab_bar_appearance;
mod tab_bar_behavior;
mod transparency;

/// Show the window 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();

    // Display section
    if section_matches(
        &query,
        "Display",
        &[
            "title",
            "columns",
            "rows",
            "padding",
            "size",
            "window title",
            "allow title change",
        ],
    ) {
        display::show_display_section(ui, settings, changes_this_frame, collapsed);
    }

    // Transparency section
    if section_matches(
        &query,
        "Transparency",
        &[
            "opacity",
            "blur",
            "transparent",
            "background",
            "default background",
            "text opaque",
        ],
    ) {
        transparency::show_transparency_section(ui, settings, changes_this_frame, collapsed);
    }

    // Performance section (collapsed by default)
    if section_matches(
        &query,
        "Performance",
        &[
            "fps",
            "vsync",
            "refresh",
            "power",
            "unfocused",
            "gpu",
            "flicker",
            "reduce",
            "throughput",
            "render interval",
            "batch",
            "mailbox",
            "fifo",
            "gpu preference",
            "power saving",
        ],
    ) {
        performance::show_performance_section(ui, settings, changes_this_frame, collapsed);
    }

    // Window Behavior section (collapsed by default)
    if section_matches(
        &query,
        "Window Behavior",
        &[
            "decorations",
            "always on top",
            "window type",
            "monitor",
            "lock",
            "edge-anchored",
            "primary monitor",
            "window number",
        ],
    ) {
        behavior::show_behavior_section(ui, settings, changes_this_frame, collapsed);
    }

    // Tab Bar section
    if section_matches(
        &query,
        "Tab Bar",
        &[
            "tab",
            "tabs",
            "bar",
            "index",
            "close button",
            "profile drawer",
            "stretch",
            "html titles",
            "inherit directory",
            "max tabs",
            "remote tab title",
            "ssh title",
            "remote host",
            "user at host",
            "remote format",
            "osc priority",
        ],
    ) {
        tab_bar::show_tab_bar_section(ui, settings, changes_this_frame, collapsed);
    }

    // Tab Bar Appearance section (collapsed by default)
    if section_matches(
        &query,
        "Tab Bar Appearance",
        &[
            "tab color",
            "tab border",
            "inactive tab",
            "dimming",
            "tab style",
            "minimum tab width",
            "active indicator",
            "activity indicator",
            "bell indicator",
        ],
    ) {
        tab_bar::show_tab_bar_appearance_section(ui, settings, changes_this_frame, collapsed);
    }

    // Split Panes section
    if section_matches(
        &query,
        "Split Panes",
        &[
            "pane",
            "split",
            "divider",
            "focus indicator",
            "hit width",
            "drag area",
            "max panes",
            "min pane size",
            "pane padding",
        ],
    ) {
        panes::show_panes_section(ui, settings, changes_this_frame, collapsed);
    }

    // Pane Appearance section (collapsed by default)
    if section_matches(
        &query,
        "Pane Appearance",
        &[
            "pane color",
            "pane title",
            "inactive pane",
            "pane opacity",
            "hover color",
            "dim inactive",
            "title height",
            "title position",
            "pane background",
        ],
    ) {
        panes::show_pane_appearance_section(ui, settings, changes_this_frame, collapsed);
    }

    // Scrollbar section
    if section_matches(
        &query,
        "Scrollbar",
        &[
            "scrollbar",
            "thumb",
            "track",
            "autohide",
            "marker",
            "command markers",
            "shell integration",
            "tooltips",
            "scrollbar width",
        ],
    ) {
        scrollbar::show_scrollbar_section(ui, settings, changes_this_frame, collapsed);
    }

    // Arrangements section (absorbed from arrangements_tab)
    crate::arrangements_tab::show(ui, settings, changes_this_frame, collapsed);
}

/// Search keywords for the Window settings tab.
pub fn keywords() -> &'static [&'static str] {
    &[
        // Display
        "window",
        "title",
        "size",
        "columns",
        "rows",
        "padding",
        "hide padding on split",
        "snap",
        "snap to grid",
        "grid snap",
        "resize snap",
        "allow title change",
        // Transparency
        "opacity",
        "transparency",
        "transparent",
        "blur",
        "blur radius",
        "keep text opaque",
        // Performance
        "fps",
        "max fps",
        "vsync",
        "refresh",
        "power",
        "gpu",
        "unfocused",
        "inactive tab",
        "inactive tab fps",
        "pause shaders",
        "reduce flicker",
        "flicker",
        "maximize throughput",
        "throughput",
        "render interval",
        // Window behavior
        "decorations",
        "always on top",
        "lock window size",
        "window number",
        "window type",
        "monitor",
        "target monitor",
        "space",
        "spaces",
        "mission control",
        "virtual desktop",
        "macos space",
        "target space",
        // Tab bar
        "tab bar",
        "tabs",
        "tab bar mode",
        "tab title mode",
        "tab title",
        "osc only",
        "cwd title",
        "rename tab",
        "tab height",
        "tab index",
        "close button",
        "stretch",
        "html titles",
        "inherit cwd",
        "inherit directory",
        "profile drawer",
        "new tab shortcut",
        "profile picker",
        "new tab profile",
        "max tabs",
        "remote tab title",
        "ssh title",
        "remote host",
        "user at host",
        "remote format",
        "osc priority",
        // Tab bar appearance
        "tab min width",
        "tab border",
        "tab color",
        "inactive tab",
        "outline only",
        "outline tab",
        "dimming",
        "dim inactive",
        "tab background",
        "tab text",
        "tab indicator",
        "activity indicator",
        "bell indicator",
        "close button color",
        "tab style",
        "auto tab style",
        "automatic tab",
        "system tab style",
        // Tab bar layout
        "tab bar position",
        "tab bar width",
        "new tab position",
        "after active",
        "tab order",
        "insert tab",
        // Split panes
        "panes",
        "split",
        "divider",
        "divider width",
        "hit width",
        "pane padding",
        "divider style",
        "focus indicator",
        "focus indicator color",
        "focus indicator width",
        "pane focus",
        "max panes",
        "min pane size",
        // Pane appearance
        "divider color",
        "hover color",
        "dim inactive panes",
        "inactive pane",
        "pane opacity",
        "pane title",
        "pane title height",
        "pane title position",
        "pane title color",
        "pane background",
        // Performance extras
        "latency",
        // Scrollbar
        "scrollbar",
        "thumb",
        "track",
        "autohide",
        "command marks",
        "marker",
        "mark",
        "tooltips",
        "scrollbar width",
        "scroll",
        // Arrangements (absorbed from arrangements_tab)
        "arrangement",
        "arrangements",
        "layout",
        "workspace",
        "save",
        "restore",
        "window layout",
        "auto-restore",
        "rename",
        "delete",
        "reorder",
        "move up",
        "move down",
        "overwrite",
        "startup",
        // Section titles and section keywords
        "display",
        "window title",
        "default background",
        "performance",
        "batch",
        "mailbox",
        "fifo",
        "gpu preference",
        "power saving",
        "window behavior",
        "edge-anchored",
        "primary monitor",
        "tab bar appearance",
        "minimum tab width",
        "active indicator",
        "split panes",
        "drag area",
        "pane appearance",
        "pane color",
        "command markers",
        "shell integration",
        "save current layout",
        "snapshot",
        "saved arrangements",
        "launch",
    ]
}