181 Commits

Author SHA1 Message Date
Mitchell Hashimoto
b65a9ebc45 Merge pull request #2234 from jcollie/gtk-css-no-libadwaita
gtk: load css when libadwaita is not being used
2024-10-09 09:37:30 -07:00
Jeffrey C. Ollie
a559ecf957 gtk: add adw or gtk class to top level windows 2024-10-08 11:17:33 -05:00
Jeffrey C. Ollie
ab0a736089 gtk: load css when libadwaita is not being used 2024-10-08 11:17:32 -05:00
Leah Amelia Chen
fbc621a7d8 gtk: implement splitting leftwards and upwards 2024-10-07 18:19:27 -07:00
Mitchell Hashimoto
1b1589e0c6 apprt/gtk: only run window key events with tab overview shown 2024-10-07 13:17:21 -07:00
Mitchell Hashimoto
9c547dd8cd apprt/gtk: forward window key events to the focused surface 2024-10-07 13:06:35 -07:00
Mitchell Hashimoto
9e435f050e apprt/gtk: setup window key event infrastructure 2024-10-07 13:01:36 -07:00
Paul Berg
f1474c220d bind: add toggle_tab_overview binding 2024-09-27 10:13:05 -07:00
Paul Berg
7b8b58110c apprt/gtk: store tab_overview in Window struct 2024-09-27 10:12:08 -07:00
Paul Berg
6ef87d298c apprt/gtk: remove Window.hasAdwToolbar
this is the same as isAdwWindow
2024-09-27 10:12:08 -07:00
Paul Berg
fe4f4fdc72 apprt/gtk: fix build with -Dgtk-libadwaita=false 2024-09-27 10:12:08 -07:00
Mitchell Hashimoto
4e2781fdec apprt/gtk 2024-09-26 14:13:18 -07:00
Mitchell Hashimoto
26cba70b69 core: no need for hasTabs apprt function 2024-09-26 08:34:20 -07:00
Paul
b41f45d7a3 apprt/gtk: support window-theme != ghostty
- support for gtk-tabs-location=bottom
 - support for gtk-titlebar=false
2024-09-24 08:10:06 +02:00
Tristan Partin
81c50e588c apprt/gtk: override the top bar colors in libadwaita correctly
This is the way to override the color in libadwaita < 1.6. We can
transition to named colors, specifically headerbar-{fg,bg}-color for
libadwaita 1.6.

Fixes: #2266
Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-23 17:09:14 -05:00
Yi Ming
74411511df refactor: remove the unnecessary ./ in imports 2024-09-19 15:35:52 +08:00
Paul Berg
a6cd4b9750 adw: clear stored tab overview timer
This prevents a GTK warning:

```
(process:354789): GLib-CRITICAL **: 19:07:01.853: Source ID 511 was not found when attempting to remove it
```

which happens when trying to clean a timer already used.
2024-09-18 19:11:21 +02:00
Mitchell Hashimoto
9b7395b830 Merge pull request #2260 from ghostty-org/adw-focus
Fix: AdwTabOverview loses focus on close
2024-09-18 09:12:40 -07:00
Mitchell Hashimoto
2dd454b399 apprt/gtk: refocus the current tab after adw tab overview closes
Fixes #2256
2024-09-18 07:56:32 -07:00
Mitchell Hashimoto
4a492f24be apprt/gtk: make focusCurrentTab safe to call at any time 2024-09-18 07:41:11 -07:00
Paul Berg
990bcb9573 gtk: respect window-theme=ghostty when gtk-titlebar=false 2024-09-18 13:52:44 +02:00
Mitchell Hashimoto
fca7ceed03 apprt/gtk: fix non-libadw builds 2024-09-16 15:08:41 -07:00
Tristan Partin
2ad4dcdc01 apprt/gtk: remove redundant adwaita check
We already check if the toast overlay exists before sending a toast.

Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-16 15:42:38 -05:00
Tristan Partin
4f2c1d1b10 apprt/gtk: use adwaita toasts regardless of gtk-titlebar
Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-16 15:36:10 -05:00
Tristan Partin
46fb3d8c9f apprt/gtk: add notebook widget to the main box
Mitchell dropped this as part of a cleanup in the PR which added
AdwToastOverlay.

Fixes: https://github.com/ghostty-org/ghostty/issues/2250
Link: https://github.com/ghostty-org/ghostty/pull/2235
Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-16 15:16:06 -05:00
Mitchell Hashimoto
c48a1801f6 apprt/gtk: only setup the toast overlay if we have it enabled 2024-09-16 10:18:02 -07:00
Mitchell Hashimoto
2f0b48e8ad apprt/gtk: tweaks 2024-09-16 10:12:16 -07:00
Tristan Partin
d0c6c4f367 apprt/gtk: use toast UX from Adwaita if available
Notify the user with in-app notifications if libadwaita is available.

Co-authored-by: Paul Berg <paul@ber.gp>
Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-16 11:57:58 -05:00
Mitchell Hashimoto
9548ae532d Merge pull request #2228 from Pangoraw/window-theme
apprt/gtk: add option to color header bars with theme colors
2024-09-13 10:09:44 -07:00
Mitchell Hashimoto
4a539cf4c9 apprt/gtk: style tweaks 2024-09-13 09:51:51 -07:00
Paul Berg
1037265cd9 apprt/gtk: make Notebook.create not depend on parent box 2024-09-13 09:44:41 -07:00
Paul Berg
b935c7d46c apprt/gtk: remove adw_tab_page from tab 2024-09-13 15:32:17 +02:00
Paul
ac985937cd apprt/gtk: add theme variant in window-theme
this colours the header bar with the config colour.
2024-09-13 10:06:42 +02:00
Jeffrey C. Ollie
80c1fd436f adw: allow creating new tabs in a tab overview with no open tabs
Repro:
1) Start up Ghostty and create two windows.
2) On one window, open up the tab overview and close all of the tabs.
3) The window will not dissapear and should show that you have no open
   tabs because the 2nd Ghostty window is keeping Ghostty from quitting.
4) Clicking on the "New Tab" button has no effect.

Fix is to allow creating a new tab even though there is no action surface.
2024-09-12 21:04:06 -05:00
Mitchell Hashimoto
415f5cfe1b Merge pull request #2233 from tristan957/about
apprt/gtk: use AdwAboutDialog if available
2024-09-12 16:23:56 -07:00
Mitchell Hashimoto
fced4370d3 apprt/gtk: some tweaks, avoid uninitialized memory access, use optionals 2024-09-12 16:14:48 -07:00
Tristan Partin
f35671417c apprt/gtk: use AdwTabOverview
An additional way to manage tabs.

Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-12 15:59:07 -07:00
Mitchell Hashimoto
3a60fd6550 apprt/gtk: use GtkWidget so there is a common ancestor 2024-09-12 15:54:07 -07:00
Tristan Partin
b7d26a3ac3 apprt/gtk: use AdwAboutDialog if available
Matches the libadwaita theme and UX.

Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-12 23:34:34 +01:00
Tristan Partin
a30fad7c59 apprt/gtk: use AdwHeaderBar if available
Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-12 20:29:50 +01:00
Mitchell Hashimoto
15924b285d Merge pull request #2221 from TheOnlyMrCat/gtk_opacity_2
Fix background-opacity for the GTK backend, again
2024-09-12 09:42:35 -07:00
Mitchell Hashimoto
4cacea3813 apprt/gtk: inline adwaita checks so comptime disables conditional paths
This fixes building without libadwaita or building with an older version
of libadwaita. This also updates the CI to test this.
2024-09-12 09:34:39 -07:00
Mitchell Hashimoto
21460e5ded apprt/gtk: hide header bar when window decorations are disabled
Fixes #2023
Fixes regression from #2051

#2051 introduced a regression where `window-decoration=false` had no
effect when libadwaita was in use. Further, the
`toggle_window_decorations` keybinding also had no effect whatsoever.

This commit fixes this and #2023 by explicitly hiding the header bar
when window decorations are disabled. We hide the header bar rather than
the full top bar because we still want the tab bar to show up with
window decorations disabled.
2024-09-11 21:05:12 -07:00
Max Guppy
b6198e37f2 Reapply "Merge pull request #1690 from TheOnlyMrCat/gtk_opacity"
This reverts commit 57bf0b08ffe04578feb087fab739a48543c0ac75.
2024-09-12 13:36:31 +10:00
Paul
f0ca0e551e adw: show performance warning banner 2024-09-11 12:04:12 -07:00
Paul
fa81445701 adw: add option to choose toolbar style 2024-09-11 12:04:12 -07:00
Mitchell Hashimoto
c27f427e02 apprt/gtk: the comptimeEnabled check is redundant 2024-09-11 09:50:37 -07:00
Mitchell Hashimoto
afc95fefe2 apprt/gtk: use adwaita helpers, move out some complicated logic 2024-09-11 09:38:05 -07:00
Mitchell Hashimoto
1ab850fa94 apprt/gtk: move adw enabling and version checks into shared file 2024-09-11 09:21:51 -07:00
Paul Berg
7aa6b0008a adw: add support for gtk-tabs-location = bottom
this falls back to top when using either right or left.
2024-09-11 17:23:56 +02:00