mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Replace wasmer_enumset with enumset 1.0.3
This commit is contained in:
parent
96ac21cbaa
commit
aedfc9e0c1
@ -22,7 +22,7 @@ repository = "gyscos/cursive"
|
||||
|
||||
[dependencies]
|
||||
enum-map = "0.6"
|
||||
wasmer_enumset = "1"
|
||||
enumset = "1.0.3"
|
||||
log = "0.4"
|
||||
owning_ref = "0.4"
|
||||
syn = "1.0"
|
||||
@ -33,7 +33,7 @@ libc = "0.2"
|
||||
crossbeam-channel = "0.5"
|
||||
lazy_static = "1"
|
||||
chrono = "0.4"
|
||||
ahash = "0.6"
|
||||
ahash = "0.7"
|
||||
|
||||
[dependencies.toml]
|
||||
optional = true
|
||||
|
@ -9,7 +9,7 @@
|
||||
//! [`cursive`]: https://docs.rs/cursive
|
||||
#![deny(missing_docs)]
|
||||
|
||||
extern crate wasmer_enumset as enumset;
|
||||
pub use enumset;
|
||||
|
||||
macro_rules! new_default(
|
||||
($c:ident<$t:ident>) => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
use enumset::EnumSetType;
|
||||
use enumset::{EnumSet, EnumSetType};
|
||||
|
||||
/// Text effect
|
||||
#[allow(clippy::derive_hash_xor_eq)] // We do derive it through EnumSetType
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::iter::FromIterator;
|
||||
|
||||
use super::{Color, ColorStyle, ColorType, Effect, PaletteColor};
|
||||
use enumset::{enum_set, EnumSet};
|
||||
use enumset::EnumSet;
|
||||
|
||||
/// Combine a color and an effect.
|
||||
///
|
||||
@ -53,7 +53,7 @@ impl Style {
|
||||
impl From<Effect> for Style {
|
||||
fn from(effect: Effect) -> Self {
|
||||
Style {
|
||||
effects: enum_set!(effect),
|
||||
effects: EnumSet::only(effect),
|
||||
color: ColorStyle::inherit_parent(),
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ struct Child {
|
||||
|
||||
last_size: Vec2,
|
||||
|
||||
weight: usize,
|
||||
_weight: usize,
|
||||
}
|
||||
|
||||
impl Child {
|
||||
@ -150,14 +150,14 @@ impl LinearLayout {
|
||||
///
|
||||
/// Panics if `i >= self.len()`.
|
||||
pub fn set_weight(&mut self, i: usize, weight: usize) {
|
||||
self.children[i].weight = weight;
|
||||
self.children[i]._weight = weight;
|
||||
}
|
||||
|
||||
/// Modifies the weight of the last child added.
|
||||
///
|
||||
/// It is an error to call this before adding a child (and it will panic).
|
||||
pub fn weight(mut self, weight: usize) -> Self {
|
||||
self.children.last_mut().unwrap().weight = weight;
|
||||
self.children.last_mut().unwrap()._weight = weight;
|
||||
|
||||
self
|
||||
}
|
||||
@ -175,7 +175,7 @@ impl LinearLayout {
|
||||
view: view.into_boxed_view(),
|
||||
required_size: Vec2::zero(),
|
||||
last_size: Vec2::zero(),
|
||||
weight: 0,
|
||||
_weight: 0,
|
||||
});
|
||||
self.invalidate();
|
||||
}
|
||||
@ -196,7 +196,7 @@ impl LinearLayout {
|
||||
view: view.into_boxed_view(),
|
||||
required_size: Vec2::zero(),
|
||||
last_size: Vec2::zero(),
|
||||
weight: 0,
|
||||
_weight: 0,
|
||||
},
|
||||
);
|
||||
self.invalidate();
|
||||
|
@ -40,7 +40,6 @@ pub struct ListView {
|
||||
focus: usize,
|
||||
// This callback is called when the selection is changed.
|
||||
on_select: Option<Rc<dyn Fn(&mut Cursive, &String)>>,
|
||||
last_size: Vec2,
|
||||
}
|
||||
|
||||
new_default!(ListView);
|
||||
@ -53,7 +52,6 @@ impl ListView {
|
||||
children_heights: Vec::new(),
|
||||
focus: 0,
|
||||
on_select: None,
|
||||
last_size: Vec2::zero(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -332,8 +330,6 @@ impl View for ListView {
|
||||
}
|
||||
|
||||
fn layout(&mut self, size: Vec2) {
|
||||
self.last_size = size;
|
||||
|
||||
// We'll show 2 columns: the labels, and the views.
|
||||
let label_width = self
|
||||
.children
|
||||
|
@ -201,7 +201,6 @@ pub struct TextView {
|
||||
wrap: bool,
|
||||
|
||||
// ScrollBase make many scrolling-related things easier
|
||||
last_size: Vec2,
|
||||
width: Option<usize>,
|
||||
}
|
||||
|
||||
@ -237,7 +236,6 @@ impl TextView {
|
||||
rows: Vec::new(),
|
||||
wrap: true,
|
||||
align: Align::top_left(),
|
||||
last_size: Vec2::zero(),
|
||||
width: None,
|
||||
}
|
||||
}
|
||||
@ -424,7 +422,6 @@ impl View for TextView {
|
||||
|
||||
fn layout(&mut self, size: Vec2) {
|
||||
// Compute the text rows.
|
||||
self.last_size = size;
|
||||
self.compute_rows(size);
|
||||
|
||||
// The entire "virtual" size (includes all rows)
|
||||
|
@ -18,7 +18,7 @@ features = ["unstable_scroll", "markdown", "toml"]
|
||||
cursive_core = { path = "../cursive-core", version= "0.2.2"}
|
||||
crossbeam-channel = "0.5"
|
||||
cfg-if = "1"
|
||||
wasmer_enumset = "1"
|
||||
enumset = "1.0.3"
|
||||
unicode-segmentation = "1"
|
||||
unicode-width = "0.1"
|
||||
lazy_static = "1"
|
||||
|
@ -64,7 +64,7 @@
|
||||
//! [`cursive::theme`]: ./theme/index.html
|
||||
#![deny(missing_docs)]
|
||||
|
||||
extern crate wasmer_enumset as enumset;
|
||||
pub use enumset;
|
||||
|
||||
pub use cursive_core::*;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user