Commit Graph

1281 Commits

Author SHA1 Message Date
Alexandre Bury
7dd55eb126 Update enumset to 1.0.0 2020-04-15 10:34:10 -07:00
Alexandre Bury
34e8bb1f15 Update crossterm to 0.17 2020-04-05 12:31:51 -07:00
Daniel Xu
750a7af6c7
theme: Add PaletteColor::HighlightText (#438)
You generally want to stick to default colors because of terminal color
schemes. If you don't, you risk getting suboptimal contrast and
difficult-to-read text. When you _do_ want to peg something to a color,
you need to fully specify the foreground and background to ensure you
have enough contrast for text to be readable.

Our project, below
(https://github.com/facebookincubator/resctl/tree/master/resctl/below),
wants to set a less jarring highlight color than red. In order to
effectively do this, we need a way to specify the highlighted text color
without causing a cascade of pegged colors. In other words, if we were
to manually set PaletteColor::View, we would need to manually set
everything PaletteColor::View is `ColorStyle`'d with, and so forth.

I realize this is an API breaking change. I spent some time considering
alternatives (such as detecting whether or not `HighlightText` is set,
and if not, use `View` as the highlighted text color). The problem with
the other options is that you'd need to:

  1) Document the fallback behavior
  2) Maintain backwards compat code paths

Seeing as cursive is pre-1.0 release, I figure this is the best way
forward.
2020-03-31 12:45:01 -07:00
Alexandre Bury
0c1244f580 Use git version of crossterm until next version is released 2020-03-06 08:24:26 -08:00
Alexandre Bury
602bffba15 Bump crossterm to 0.16 2020-03-03 14:24:18 -08:00
Alexandre Bury
4c5e4abe49 Make AnyCb take a &mut dyn View and add Cursive::debug_name 2020-03-03 13:47:31 -08:00
Will Page
5423a9a003
Fix for cursive issue #428, "Rendering an empty SelectView..." (#429)
This change fixes cursive issue #428, caused by indexing into an empty
list.  The issue is corrected by using the .get() method to safely
handle the case where the requested index doesn't exist, and renders
no label in that case.
2020-02-26 08:43:47 -08:00
Daniel Xu
833ad6889e
Fix Event::CtrlChar('z') binding for ncurses backend (#427)
This patch fixes an off by one error where we don't handle ctrl-z
correctly.
2020-02-19 14:26:09 -08:00
Alexandre Bury
a8f31665fc Update pulldown-cmark 2020-02-12 15:34:59 -08:00
Alexandre Bury
a3583ae62e Update ahash crate 2020-02-10 10:35:31 -08:00
Alexandre Bury
4b0b9265ee Crossterm: use button from upstream rather than last_button 2020-02-10 09:53:50 -08:00
Johannes Wünsche
9de4d206bf Add Display & Eq trait for ObservedScreen (#422)
* Add Display&Eq trait for ObservedScreen
2020-01-27 17:53:23 -05:00
Alexandre Bury
5afefb8645 Move ctrl-C handling from backend to cursive callbacks 2020-01-26 14:51:34 -08:00
Alexandre Bury
54882989e4 Add ScreensView 2020-01-26 14:43:24 -08:00
Alexandre Bury
11d4c865c6 Add PaletteColor: FromStr 2020-01-20 15:38:37 -08:00
Alexandre Bury
7d77786317 Add toml and markdown features to rustdoc 2020-01-20 15:38:10 -08:00
Alexandre Bury
209468c478 Update CHANGELOG 2020-01-14 09:58:47 -08:00
Alexandre Bury
3f90fa0a77 (cargo-release) start next development iteration 0.14.1-alpha.0 2020-01-14 09:57:41 -08:00
Alexandre Bury
e2d1b23a92 (cargo-release) version 0.14.0 2020-01-14 09:57:22 -08:00
Alexandre Bury
13a63684f2 Fix ScrollView offset after change of focus 2020-01-14 09:56:03 -08:00
Alexandre Bury
d499bab941 Remove From implementations for Margins 2020-01-10 10:51:48 -08:00
Alexandre Bury
29f85a4398 Add tests for Color::parse 2020-01-08 17:20:00 -08:00
Alexandre Bury
45a9d54801 Ncurses: fix bad grayscale projection for very dark or very bright colors 2020-01-08 16:49:46 -08:00
Alexandre Bury
8ed3085772 Update crossbeam-channel to 0.4.0 2020-01-07 14:40:00 -08:00
Alexandre Bury
5e23c85f7a Fix clippy lints 2020-01-07 14:38:14 -08:00
Alexandre Bury
d72584718b Replace last vec::Vec2 2020-01-06 16:01:02 -08:00
Alexandre Bury
4c00dd3b72 Directly use crate::Vec2 2020-01-06 15:51:38 -08:00
Alexandre Bury
cd26e40fcb Rename id to name: phase 3 2020-01-06 15:41:51 -08:00
Alexandre Bury
6824cc4299 Rename id to name: phase 2 2020-01-06 15:39:30 -08:00
Alexandre Bury
ddac91373c Rename id to name: phase 1 2020-01-06 12:10:24 -08:00
Alexandre Bury
9aee7d374c Rename some types
BoxView => ResizedView
SizedView => LastSizeView
ViewBox => BoxedView
Boxable => Resizable
Boxable::box => Resizable::resize

Old names are still re-exported, but deprecated.
2020-01-06 11:55:16 -08:00
Alexandre Bury
237c6c8e33 Crossterm: define platform-dependant Stdout type 2020-01-06 11:25:32 -08:00
Eric Izoita
f1fe477e6d crossterm: fix scroll up event conversion (#417) 2020-01-02 18:41:19 -08:00
Timon
54de6ca6c0 Crossterm 0.14 (#406)
Refactor and update crossterm backend.
2020-01-02 00:08:53 -08:00
mara
8a018dbe4d Change tertiary color to white instead of grey (#408)
Change the tertiary color in the default theme to white instead of grey.

Currently, the tertiary color is the same as the view background color,
making it invisible as foreground color. This makes the Outset effect
not work as (I think) intended.
2019-12-02 08:45:09 -08:00
Alexandre Bury
b3f913391a Add color option to Layer 2019-11-17 00:12:04 -08:00
Alexandre Bury
bf0fb488a1 Use IntoBoxedView as bound for LinearLayout 2019-11-04 13:45:15 -08:00
Alexandre Bury
0e4d4c5fbb Fix out-of-bounds access in MenuPopup 2019-11-03 10:40:10 -08:00
Riey
1b47784b2a Fix crossterm mouse event position (#403) 2019-11-03 10:37:08 -08:00
Alexandre Bury
6244d6e28c Add doc for focus and important_area 2019-10-30 09:04:49 -07:00
mara
1f66ac0faa crossterm, termion: Reset bold with SGR 22 instead of 21 (#402)
NoBold (21) doesn't work in many terminals
22 (named NormalIntensity in crossterm, and NoFaint in termion) seems to do a better job.

Attempt at fixing #401.
2019-10-28 14:46:47 -07:00
mara
fee2768777 crossterm: Correct attribute for end of underline and reverse effect (#399)
- `NoUnderline` instead of `Underline`
- `NoInverse` instead of `Reverse`
2019-10-27 11:36:24 -07:00
mara
0b56f423d8 crossterm: Stop mouse mode and show cursor at finish (#400)
Something is wrong at the moment when finishing up, when
the crossterm backend is used.

The terminal is left in a strange state: the previous contents of the
terminal (as before the program) are visible, however the cursor is
invisible (and reset to the top left), and clicking the mouse spams
escape codes.

For some reason the `execute!` block in `finish` is failing. But it
doesn't seem to be necessary: crossterm already restores the alternative
screen at shutdown, which also restores the original cursor position and
attributes.

Do make sure that mouse mode is stopped and that the cursor is visible.
2019-10-27 11:36:00 -07:00
Alexandre Bury
a708e99ba6 Add missing get_inner to EnableableView 2019-10-25 19:53:43 -07:00
Alexandre Bury
884796fb02 Add PaddedView::get_inner(_mut) and fix clippy warnings 2019-10-25 19:46:49 -07:00
mara
985e4ebf96 Make enter and tab key work again in crossterm backend (#395)
It looks like new crossterm returns a dedicated enum item for the enter
and tab key instead of the `\n` and `\t` character.

Fixes #394.
2019-10-25 11:22:23 -07:00
Alexandre Bury
dac0f5a67e Update changelog 2019-10-22 16:20:06 -07:00
Alexandre Bury
92d63c71f1 Update crossterm to 0.12 2019-10-22 14:44:45 -07:00
Alexandre Bury
f15f36cc1b Add ScrollView::scroll_to_important_area 2019-10-22 13:58:59 -07:00
Alexandre Bury
14f2c962af Also mention send_wrapper in doc for CbSink 2019-10-14 10:04:50 -07:00