style(about): apply dark frosted glass appearance for minimal/dark themes#632
style(about): apply dark frosted glass appearance for minimal/dark themes#632kud wants to merge 1 commit into
Conversation
|
Once I have properly tested it and added a screenshot, I will move it out of draft. |
|
The core idea (frosted glass for dark themes) is reasonable, but this PR needs significant rework:
|
|
@gnachman Thanks for the feedback; I will adjust the PR. Also, for now, I publish draft PRs to ensure people are aware of the work I'm doing. Perhaps opening an issue and stating that I will work on it would be better? Regarding the commits, I will certainly polish the PR at the end. |
Enhances the About window with dynamic dark mode adaptation using app theme preference and improves sponsor section UI. Updates window and content view appearance to support vibrancy, adds conditional styling for dark/light themes, refactors sponsor logo layout, and updates font and colour in About xib for improved readability.
61c726f to
e1e4429
Compare
gnachman
left a comment
There was a problem hiding this comment.
Thanks for the contribution! The idea of making the About panel respect dark themes is welcome. However, there are several issues that need to be addressed before this can be merged.
Use the existing theme API
The PR manually checks tab styles and queries currentTerminal to determine dark/light mode, but iTerm2 already has a centralized API for this in NSAppearance+iTerm.h:
self.window.appearance = [NSAppearance it_appearanceForCurrentTheme];This is what iTermOpenQuicklyWindowController and other non-terminal windows use. It correctly handles all tab styles (including Automatic and Compact, which this PR misses) and doesn't require a terminal window to exist. The current approach would silently fall through to light mode for Automatic/Compact users in dark mode, and has undefined behavior when no terminal is open under Minimal.
Using it_appearanceForCurrentTheme would also eliminate most of the new #imports (iTermController.h, PseudoTerminal.h, PTYWindow.h, PreferencePanel.h) which create unnecessary coupling between the About window and the terminal infrastructure.
To determine the BOOL dark value for configureForDark:, you can use:
BOOL isDark = [NSAppearance it_appearanceForCurrentTheme].it_isDark;Unconditional HUD material
awakeFromNib unconditionally sets NSVisualEffectMaterialHUDWindow on the content view. This material is designed for dark floating panels and will affect the appearance even in light mode. The material/blending configuration should be conditional, or use a material that works well in both modes (or skip the vibrancy for light themes entirely).
Hardcoded magic numbers
The alpha values (0.18, 0.22, 0.07, 0.05), corner radii (10, 8), insets (16, 12) are scattered without explanation. Please define these as named static const values at file scope with comments explaining the intent.
Duplicated constants
kWrapperInset and kWrapperGap are defined identically in both updateSponsorWrapperLayout and configureForDark:. Hoist them to file-scope static const values.
PR description vs. actual diff
The description mentions two changes that aren't in the diff:
- "switch version-string attributes to
secondaryLabelColor+NSFontWeightMedium" — the version text still usescontrolTextColor - "tighten line spacing from 3 → 2 pt" —
setLineSpacing:3is unchanged
Please either include these changes or update the description.
_sponsorWrapper lifecycle
Once created, the sponsor wrapper is never hidden or removed. If the theme changes from dark to light at runtime, it remains visible with a slightly different background. Consider hiding it for light themes or making it truly transparent.
Minor
The XIB changes (22→26pt bold title, labelColor → secondaryLabelColor subtitle) are cosmetic choices I'll defer to @gnachman on.
|
@gnachman haha the last comment :D I see you using AI :P (as I do) |
🎟️ Ticket
Ticket: N/A
📄 Description
Applies a frosted-glass dark appearance to the About panel when the user is running a dark or minimal theme (Minimal/Dark/Dark High Contrast). Without this change the About window renders with an opaque white/system background that looks visually inconsistent on dark-themed setups.
Changes:
iTermAboutWindow.m: OverrideisOpaqueto returnNOso the window composites correctly behind aNSVisualEffectView.iTermAboutWindowController.m: Configure the visual effect view withNSVisualEffectMaterialHUDWindow+NSVisualEffectBlendingModeBehindWindow; set the window background toclearColor; conditionally assignNSAppearanceNameVibrantDarkwhen the active tab style is Minimal (and system appearance is dark), Dark, or Dark High Contrast; switch version-string attributes tosecondaryLabelColor+NSFontWeightMediumfor better legibility on the frosted surface; tighten line spacing from 3 → 2 pt.AboutWindow.xib: Bump the title field from 22 pt system to 26 pt bold for a more prominent heading; switch subtitle colour fromlabelColortosecondaryLabelColorto match the new hierarchy.📽️ Screencast
No visual changes included in this PR description — the difference is visible only at runtime when iTerm2 is using a dark/minimal theme.
✅ How to Validate
tools/build.sh).🛠️ Developer Checklist