109 Commits

Author SHA1 Message Date
Pete Schaffner
77e82b4d2a Improve window buttons backdrop with window opacity 2024-02-09 22:46:49 +01:00
Pete Schaffner
20ed099940 Cache new tab button image to improve performance 2024-02-09 00:06:40 +01:00
Pete Schaffner
7e945a52f1 Move separator hiding back into updateConstraintsIfNeeded
I moved this into `update` when doing the tab bar background coloring
but the separators would still show briefly.
2024-02-08 18:16:17 +01:00
Pete Schaffner
95c8541efd Color the new tab button image appropriately 2024-02-08 17:46:16 +01:00
Pete Schaffner
8831c601a4 Use draw rect to do the "plus darker" blending
This is a lot simpler and doesn't require adding Obj-C into the mix.
2024-02-08 16:38:07 +01:00
Pete Schaffner
33a8368a68 Make unselected tabs blend better with background color
This enables the standard effect created by a sytem tab bar, which
ensures unselected tabs blend with the window's/titlebar's background
color. This also ensures the `windowButtonsBackdrop` view matches the
color of the adjacent tab (be it selected or not).
2024-02-08 10:14:15 +01:00
Pete Schaffner
93fb852d9b Add comments/docs and make method name clearer 2024-02-07 21:44:44 +01:00
Pete Schaffner
591c05641b Use shallow search to improve performance 2024-02-07 21:39:36 +01:00
Pete Schaffner
bc946109b7 Hide tab bar shadows which improves light themes
In a light appearance there was a shadow cast on top of the inactive
tabs that looked bad. In a dark appearance the shadow manifests as a
solid line that required a faux border to look right. This removes both
and improves the aesthetics of the tab bar in light themes.
2024-02-07 11:11:34 +01:00
Pete Schaffner
e00197c1bd Add extensions to help finding private subviews 2024-02-07 11:10:43 +01:00
Mitchell Hashimoto
3c0317bf9d macos: small stylistic edits 2024-02-05 19:04:50 -08:00
Qwerasd
1d6b952c8f fix(macOS): Improve updating of transparent titlebar tabs backgrounds
FAR from a perfect fix, as the background seen through the tabs during window drags will be behind by a frame or so still, but definitely a vast improvement over not updating at all.
2024-02-05 17:05:13 -05:00
Qwerasd
878b5be185 fix(macOS): Restore custom titlebar background
Required for when a transparent background is used in conjunction with non-native fullscreen.
2024-02-05 16:15:43 -05:00
Mitchell Hashimoto
7001ef2739 Merge pull request #1458 from qwerasd205/macos-fix-title-label
(macOS) Fixed/improved titlebar tabs custom title label handling
2024-02-04 15:41:38 -08:00
Mitchell Hashimoto
bd38689539 macos: make label fileprivate 2024-02-04 15:41:15 -08:00
Qwerasd
a121549f32 macOS: Improve custom title label centering and overflow appearance. 2024-02-04 17:56:08 -05:00
Qwerasd
fdab397c61 macOS: Simplify native title hiding logic for titlebar tabs. 2024-02-04 16:55:18 -05:00
Qwerasd
4d335a220f fix(macOS): Adjust custom toolbar title to fix clipping problems. 2024-02-04 16:55:07 -05:00
Qwerasd
181d64338d fix(macOS): Restore titlebar tabs when exiting non-native fullscreen 2024-02-03 20:03:34 -05:00
Qwerasd
f590aebdfa fix(macOS): Use better hardcoded colors for light titlebar tabs window button backdrop 2024-02-02 02:00:02 -05:00
Mitchell Hashimoto
98ad832d86 macos: set window button backdrop color based on appearance 2024-02-01 21:41:29 -08:00
Mitchell Hashimoto
e5400bad06 config: add window-theme = auto for automatic choosing based on bg color 2024-02-01 20:49:28 -08:00
Mitchell Hashimoto
6482c25579 macos: titlebar tabs set window appearance based on bg luminance
Fixes #1427
2024-02-01 16:47:45 -08:00
Qwerasd
2944128e05 fix(macOS): restoring tabbed windows with titlebar tabs enabled 2024-01-31 20:07:35 -05:00
Mitchell Hashimoto
50125c0319 macos: whitespace 2024-01-31 15:44:34 -08:00
Mitchell Hashimoto
4a93181b79 macos: minor edits 2024-01-31 15:43:35 -08:00
Qwerasd
308f8cce36 macOS: center window title when titlebar tabs enabled
Uses a custom toolbar that populates itself with a centered text field and provides a method to set the text.
2024-01-31 16:16:41 -05:00
Mitchell Hashimoto
1a3d2d151e macos: fix tabs vs spaces 2024-01-31 12:06:58 -08:00
Mitchell Hashimoto
fbac2d9810 macos: titlebar tab logic shuffling 2024-01-31 10:08:05 -08:00
Qwerasd
dacbdf3f38 fix(macOS): set titlebar background color to support transparent windows with titlebar tabs 2024-01-31 07:58:31 -05:00
Qwerasd
ba16d65d02 macOS: Added titlebar tabs 2024-01-30 18:48:36 -05:00
Mitchell Hashimoto
fa0ba0a354 macos: terminals with custom commands are not restorable
Fixes #1317
2024-01-17 08:26:48 -08:00
Mitchell Hashimoto
875a774d4b macos: remove AppState and unify onto Ghostty.App cross-platform 2024-01-14 19:35:57 -08:00
Mitchell Hashimoto
eba3d5414d macos: Ghostty.Config to store all config-related operations 2024-01-14 15:53:33 -08:00
Thorsten Ball
2bf8dac864 macos: use switch statement instead of if-let 2024-01-13 08:32:50 +01:00
Thorsten Ball
90427a8d22 macos: respect window-new-tab-position configuration 2024-01-12 20:22:53 +01:00
Mitchell Hashimoto
8b0d4312ee macos: invalidate restorable state whenever a terminal window is closed 2024-01-10 21:28:49 -08:00
Mitchell Hashimoto
837b551a92 macos: invalid restorable state whenever surface tree changes
Related to #1177

This detects whenever the surface tree (splits) change in any way and
requests that the restorable state be invalided by macOS.
2024-01-10 21:24:47 -08:00
Mitchell Hashimoto
88c525d593 macos: minor style changes 2024-01-10 09:37:36 -08:00
Thorsten Ball
3e811dad2c macos: stop windows glitching when cascading
Noticed that windows glitch when cascading: they show up in center of
screen, then quickly move to the correct position at last-cascade point.

This fixes the issue, by moving the `showWindow` call to _after_ the
setting of the last cascade point.

Now if you look at the code and think: "shouldn't this work without the
async-dispatch, like this?"

```swift
if (!window.styleMask.contains(.fullScreen)) {
    Self.lastCascadePoint = window.cascadeTopLeft(from: Self.lastCascadePoint)
}
c.showWindow(self)
```

Then, yes, I had the same thought, but it doesn't. And as discussed on
Discord, we probably don't know what's going on behind the scenes.

So this is the simplified code of the version we have to live with:
async dispatching the cascade and non-cascade versions both.
2024-01-10 18:28:19 +01:00
Mitchell Hashimoto
44544f29b2 macos: support Display P3 colorspace through configuration
Fixes #1214

This introduces the `window-colorspace` configuration which allows
configuring the colorspace to use for windows on macOS. The default is
sRGB (same as before) but this can also be set to `display-p3`.
2024-01-09 20:47:07 -08:00
Vivek Roy
3aad646be2 macos: Address window spawning and ordering issues from service. 2024-01-06 00:35:34 +05:30
Mitchell Hashimoto
9bf13c6236 macos: set initial window size in controller window init
Fixes #1227
Fixes #1206

This moves the logic that respects `window-width` and `window-height` to
the controller window initialization. This is where it should've been
all the time but we previously didn't use a controller architecture so
we did our best to use heuristics in the view to do this.

This location now ensures that this only happens on window
initialization and only if we have one surface.
2024-01-05 09:42:50 -08:00
Mitchell Hashimoto
f93c41669e macos: order main window front on restore 2024-01-03 12:10:52 -08:00
Mitchell Hashimoto
c9ff034b62 macos: prevent super hot loop to restore focus state 2024-01-03 12:07:03 -08:00
Mitchell Hashimoto
0008fb0a27 macos: set surface tree on init in restore
This prevents an unnecessary SurfaceView from being created. Creating a
SurfaceView is very expensive because this starts multiple threads,
creates the pty, starts the pty process, etc.

Additionally, this was exposing what I believe to be #497 when restoring
state: a surface view was created and destroyed very quickly causing
hangs on some machines. This still needs to be resolved but the behavior
in this commit was still a bug anyways.
2023-12-27 20:12:46 -08:00
Mitchell Hashimoto
2aa7f12417 macos: increment restorable state version 2023-12-26 14:45:39 -08:00
Mitchell Hashimoto
98041940f0 macos: restore focused split on app restore 2023-12-26 14:45:27 -08:00
Mitchell Hashimoto
a321ef515d macos: assign unique UUID per surface, store in app state 2023-12-26 14:24:05 -08:00
Mitchell Hashimoto
20f9a3baab macos: reset state version to 1 2023-12-23 18:59:19 -08:00