Commit graph

84 commits

Author SHA1 Message Date
Mattias Eriksson
b13b949e8d Ensure terminal is focused after paste 2024-02-05 09:10:43 -07:00
Mattias Eriksson
05ee3dca4a Clippy fixes 2024-02-05 09:09:23 -07:00
Mattias Eriksson
623a193ad4 Make context menu work better with panes 2024-02-02 08:51:01 -07:00
Mattias Eriksson
e322fc86f7 Fix some pane focus and find related issues
* If a context_page was shown, the focus for the panes didn't work.
  By clicking all panes you could get input in all of them as long as
  the context_page prevented focus updated.
* Find was drawn in all panes, with typed text being entered in all of
  them. Changed this to only show find in the focused pane.
* Also, when I was going find related stuff, I populate the find entry
  with selected text, and clear the find search value on close.
2024-02-02 08:50:41 -07:00
Jeremy Soller
4401a7dbef
Workaround for dead terminal event channel 2024-02-02 08:44:28 -07:00
Jeremy Soller
1ffb449bde
Capture theme content changes in addition to mode changes 2024-01-31 15:18:20 -07:00
Jeremy Soller
e73236fdac
Fix cached window background order 2024-01-31 15:11:42 -07:00
Jeremy Soller
d043f45b0f
Fix selection when using window background as terminal background 2024-01-31 15:05:21 -07:00
Jeremy Soller
470437e55a
Set minimum size to 360x180 (#91) 2024-01-31 10:52:56 -07:00
Jeremy Soller
6ec3e499cb
Add new tab button next to window controls (#89) 2024-01-31 10:37:10 -07:00
Jeremy Soller
ff6ad163d6
Settings re-org 2024-01-31 10:29:35 -07:00
Mattias Eriksson
8d7d074933 Add support for Mouse Events 2024-01-31 06:34:55 -07:00
Mohammad AlSaleh
cb26aedfa2 Disable window content container and set style on pane grid container
* Presumably, the TODO about window resizing interfering with scrolling
   is not applicable anymore with the existence of padding from the pane
   grid container. So, set `core.window.content_container` to false.

 * Pane grid container didn't follow the selected theme. So, set style
   on it to fix that.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-25 13:54:40 -07:00
Mattias Eriksson
c749a02df8 Add Focus Follows Mouse 2024-01-22 09:00:08 -07:00
Jeremy Soller
6d519018a0
Show shortcuts in context menu 2024-01-19 11:44:59 -07:00
Jeremy Soller
834a385235
Show bindings in menu, finish #26 2024-01-19 11:03:14 -07:00
Jeremy Soller
ff06e6105d
Simplify definition of key bindings 2024-01-19 10:45:35 -07:00
Jeremy Soller
2a020221fd
Update dependencies 2024-01-19 09:46:06 -07:00
Jeremy Soller
e41bdd5b7f Merge remote-tracking branch 'origin/master_jammy' into snaggen-split 2024-01-18 20:43:47 -07:00
Josh Megnauth
c2f06a975a Add shift as a modifier to the new tab shortcuts 2024-01-18 20:20:39 -07:00
Josh Megnauth
9dffe2543e Add keyboard shortcut ctrl+[1-9] to select tabs
`ctrl`+`N` is a common shortcut to switch to a specific tab. 1-8
switches to the exact tab or the last tab. `ctrl`+`9` always switches to
the last tab.
2024-01-18 20:20:39 -07:00
Josh Megnauth
f1d442dfea Add hot keys to cycle tabs forward or backward
Port of: https://github.com/pop-os/cosmic-files/pull/20
2024-01-18 20:20:39 -07:00
Josh Megnauth
1f7b17e4d1 Add hotkey ctrl-shift-w to close tabs. 2024-01-18 20:20:39 -07:00
Mattias Eriksson
41e61a10b4 Correct comments 2024-01-18 10:15:46 +01:00
Mattias Eriksson
35dcdc686c Avoid doing duplicate focus 2024-01-18 10:15:16 +01:00
Mattias Eriksson
d9ae46598e Break out terminal creation to remove duplicate code 2024-01-18 10:14:32 +01:00
Mattias Eriksson
0d1a2d2bc6 Cleanup not-needed terminal ids, when a pane is closed 2024-01-17 16:54:42 +01:00
Mattias Eriksson
9ed2dc45c4 Re-focus teminal after context drawer is closed 2024-01-17 16:48:15 +01:00
Mattias Eriksson
1940f2c056 Support splitting of terminals using a Pane Grid 2024-01-17 16:09:56 +01:00
Jeremy Soller
7f37ede453
Allow specifying startup command with -e, --command, or -- 2024-01-14 12:33:28 -07:00
Mohammad AlSaleh
5159b130f9 Fix broken UI if font not found at startup
Change was not reflected in settings.

 Noticed while investigating #46.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-12 12:42:51 -07:00
Mohammad AlSaleh
e56e582f90 Add option for setting dim font weight
Allows users to set this to a value lower than default font weight.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-12 10:40:10 -07:00
Jeremy Soller
9b2ab1202a
Implement search 2024-01-11 14:31:20 -07:00
Jeremy Soller
928269a239
Add find stub 2024-01-11 13:20:16 -07:00
Jeremy Soller
2a679ab96f
Fix warnings 2024-01-11 11:40:22 -07:00
Jeremy Soller
3f09e17156
Normalize scrollbar style with figma designs 2024-01-11 11:33:39 -07:00
Mohammad AlSaleh
b161db94d1 Add a disabled-by-default toggle for using bright colors for bold text
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-11 09:58:18 -07:00
Mohammad AlSaleh
9188f3c0bf Use log::warn!() instead of println!()
This causes a functional change that may not be obvious.

 When running `cosmic-term` from a shell prompt as a detached
 process, `stdout`/`stderr` descriptors get deleted, and a `println!()`
 message would take the `cosmic-term` process down.

 No such an issue with log messages.

 This can be tested by running `htop` then exiting the tool, which
 would trigger a "TODO: CursorBlinkingChange" message.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-10 17:07:32 -07:00
Mohammad AlSaleh
9b185c9610 Sleep for 50ms before sending first Message::TabNew
This fixes the issue of two tabs being created at startup.

 Should fix #36.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-10 17:07:32 -07:00
Jeremy Soller
4bde45bcdc
Improve scrollbar 2024-01-10 16:17:52 -07:00
Mohammad AlSaleh
4ec3e5b2f3 Consider stretch/weight settings advanced and hide them with a toggle
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-09 17:18:04 -07:00
Mohammad AlSaleh
59804dc8ab Handle the case where configured font name is not available
This can happen if configured font name is uninstalled for example.

 Pick the first font name available if that's the case.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-09 17:18:04 -07:00
Mohammad AlSaleh
5eba6eb4d6 Configurable font stretch, font weight, and bold font weight
* Store a font name => font faces map

 * Only list font names that have `NORMAL` and `BOLD` faces with
   `Normal` stretch. This will give us defaults and fall-backs that are
   guaranteed to always exist.

 * Filter by stretch first, with `Normal` chosen as the always existing
   default.

 * Then only list font weights supported by the font name stretch
   selected, for the normal and bold cases.

 * When changing the font name selected, the stretch/weight options
   will stay the same if supported by the new font name, or revert to
   the always existing fall-backs.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-09 17:18:04 -07:00
Jeremy Soller
c74d5d6f56
Remove extra items from header 2024-01-09 13:48:12 -07:00
Jeremy Soller
db738371ac
Add menu 2024-01-09 10:16:32 -07:00
Jeremy Soller
556c32e33f
Use flag to determine when terminal needs update, only update once before draw 2024-01-04 14:25:31 -07:00
Mohammad AlSaleh
ff5c46cd19 Move zoom_adj to App so it doesn't persist between runs
Addresses comments from #22.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-03 11:29:49 -07:00
Mohammad AlSaleh
1c8a058e82 Implement ZoomIn/ZoomOut/ZoomReset with configurable step
Implements #14.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-03 08:31:41 -07:00
Jeremy Soller
1e0ce2b7e7 Revert "Check if a Config message was handled before creating first tab"
This reverts commit 7b152bd218.
2024-01-02 13:04:06 -07:00
Mohammad AlSaleh
7b152bd218 Check if a Config message was handled before creating first tab
In `Application::subscription()`, `subscription::channel()` would
 create a dead terminal tab if it was called before
 `config_subscription()`.

 Then `subscription::channel()` would be triggered a second time
 creating a second terminal tab that works.

 This commit fixes this issue by only creating the first terminal
 tab after a `Message::Config{}` was handled, i.e. after
 `config_subscription()` was run.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-02 13:01:10 -07:00