Commit graph

108 commits

Author SHA1 Message Date
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
f378bb5fdd Add alt key control characters 2024-01-22 13:10:01 -07:00
Mattias Eriksson
c749a02df8 Add Focus Follows Mouse 2024-01-22 09:00:08 -07:00
Mohammad AlSaleh
d6946d40bd Fix tab skip rendering
Replace '\t' with a space in text buffers, as tab skip/stop is handled
 by `alacritty_terminal`.

 Also, sending a tab to the shaper causes issues, as fonts either have
 no tab codepoint, or worse, some do, with the glyph produced being
 anyone's guess. Some may render a tab to some random character like
 '0'.

 Fixes #73.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-21 16:08:44 -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
8fabf94f03 Remove debug output 2024-01-18 09:08:20 +01:00
Mattias Eriksson
71af9b7f9b Merge branch 'master_jammy' into split 2024-01-18 08:00:02 +01:00
Mohammad AlSaleh
f5cf7e0040 Set monospace width on text buffers
Make use of the addition to cosmic-text that allows matching
 the widths of fallback Monospace fonts to the default one.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-17 17:40:30 -07:00
Jeremy Soller
d656254282
Update cosmic-text 2024-01-17 13:41:17 -07:00
Mattias Eriksson
580e3d3985 fmt 2024-01-17 19:03:39 +01:00
Mattias Eriksson
3919f87a75 Add back simple shade to unfocused windows 2024-01-17 18:44:40 +01:00
Mattias Eriksson
945581f515 Shading the background didn't work as expected, so not using that 2024-01-17 17:08:26 +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
d3afe3f6bc Merge branch 'master_jammy' into split 2024-01-17 16:41:35 +01:00
Mattias Eriksson
1940f2c056 Support splitting of terminals using a Pane Grid 2024-01-17 16:09:56 +01:00
Mohammad AlSaleh
60b55a076d Support STRIKEOUT, UNDERCURL, and all underline styles
* Add `Metadata` struct to pass bg, underline_color, and flags info via
   metadata.
 * Keep and `IndexSet` of `Metadata` info in Terminal.
 * Use `Metadata` info to render STRIKEOUT, UNDERCURL, and all underline
   styles via `BgRect`.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-16 11:36:05 -07: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
Mohammad AlSaleh
f34116f3f7 Support DIM
* Add a color deriver and derive dim colors for all themes.
 * Derive actual bright colors for the OneHalfDark theme while at it.
 * Use dim colors when the DIM flag is set.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-12 10:40:10 -07:00
Jeremy Soller
679e7ee4f5
Fix searching for a single character 2024-01-11 16:20:15 -07:00
Jeremy Soller
b38927364c
Clear terminal selection on escape 2024-01-11 14:37:18 -07:00
Jeremy Soller
ac4472e45e
Fix warnings 2024-01-11 14:32:11 -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
0eea366410 Add LEFT‑TO‑RIGHT ISOLATE character to the beginning of lines
This zero-width char will force the shaper to treat detected RTL
 lines as LTR.

 RTL text would still be rendered correctly. But this fixes the wrong
 behavior of it being displayed aligned to the right.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-11 10:00:04 -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
fc6e2de78b Hide cursor if TermMode::SHOW_CURSOR is not set
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-11 09:58:18 -07:00
Mohammad AlSaleh
bb95e28899 Support HIDDEN cells
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-11 09:58:18 -07:00
Mohammad AlSaleh
7f5736f56a Use bright colors if bold
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