mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-13 06:28:36 +00:00
Removed i32 and f32 variants of input and slider.
This commit is contained in:
parent
ad943962e5
commit
bbb46c7446
@ -241,7 +241,7 @@ fn show_test_window<'a>(ui: &Ui<'a>, state: &mut State, opened: &mut bool) {
|
||||
ui.same_line(300.0);
|
||||
ui.checkbox(im_str!("no collapse"), &mut state.no_collapse);
|
||||
ui.checkbox(im_str!("no menu"), &mut state.no_menu);
|
||||
ui.slider_f32(im_str!("bg alpha"), &mut state.bg_alpha, 0.0, 1.0).build();
|
||||
ui.slider_float(im_str!("bg alpha"), &mut state.bg_alpha, 0.0, 1.0).build();
|
||||
|
||||
ui.tree_node(im_str!("Style")).build(|| {
|
||||
// TODO: Reimplement style editor
|
||||
@ -289,7 +289,7 @@ fn show_test_window<'a>(ui: &Ui<'a>, state: &mut State, opened: &mut bool) {
|
||||
suitable for English and possibly other languages."));
|
||||
ui.spacing();
|
||||
|
||||
ui.slider_f32(im_str!("Wrap width"), &mut state.wrap_width, -20.0, 600.0)
|
||||
ui.slider_float(im_str!("Wrap width"), &mut state.wrap_width, -20.0, 600.0)
|
||||
.display_format(im_str!("%.0f"))
|
||||
.build();
|
||||
|
||||
@ -423,7 +423,7 @@ fn show_example_app_auto_resize<'a>(ui: &Ui<'a>, state: &mut AutoResizeState, op
|
||||
ui.text(im_str!("Window will resize every-ui to the size of its content.
|
||||
Note that you probably don't want to query the window size to
|
||||
output your content because that would create a feedback loop."));
|
||||
ui.slider_i32(im_str!("Number of lines"), &mut state.lines, 1, 20).build();
|
||||
ui.slider_int(im_str!("Number of lines"), &mut state.lines, 1, 20).build();
|
||||
for i in 0 .. state.lines {
|
||||
ui.text(im_str!("{:2$}This is line {}", "", i, i as usize * 4));
|
||||
}
|
||||
|
||||
10
src/lib.rs
10
src/lib.rs
@ -499,9 +499,6 @@ impl<'ui> Ui<'ui> {
|
||||
pub fn input_text<'p>(&self, label: ImStr<'p>, buf: &'p mut str) -> InputText<'ui, 'p> {
|
||||
InputText::new(label, buf)
|
||||
}
|
||||
pub fn input_f32<'p>(&self, label: ImStr<'p>, value: &'p mut f32) -> InputFloat<'ui, 'p> {
|
||||
InputFloat::new(label, value)
|
||||
}
|
||||
pub fn input_float<'p>(&self, label: ImStr<'p>, value: &'p mut f32) -> InputFloat<'ui, 'p> {
|
||||
InputFloat::new(label, value)
|
||||
}
|
||||
@ -514,9 +511,6 @@ impl<'ui> Ui<'ui> {
|
||||
pub fn input_float4<'p>(&self, label: ImStr<'p>, value: &'p mut [f32;4]) -> InputFloat4<'ui, 'p> {
|
||||
InputFloat4::new(label, value)
|
||||
}
|
||||
pub fn input_i32<'p>(&self, label: ImStr<'p>, value: &'p mut i32) -> InputInt<'ui, 'p> {
|
||||
InputInt::new(label, value)
|
||||
}
|
||||
pub fn input_int<'p>(&self, label: ImStr<'p>, value: &'p mut i32) -> InputInt<'ui, 'p> {
|
||||
InputInt::new(label, value)
|
||||
}
|
||||
@ -533,11 +527,11 @@ impl<'ui> Ui<'ui> {
|
||||
|
||||
// Widgets: Sliders
|
||||
impl<'ui> Ui<'ui> {
|
||||
pub fn slider_f32<'p>(&self, label: ImStr<'p>,
|
||||
pub fn slider_float<'p>(&self, label: ImStr<'p>,
|
||||
value: &'p mut f32, min: f32, max: f32) -> SliderFloat<'ui, 'p> {
|
||||
SliderFloat::new(label, value, min, max)
|
||||
}
|
||||
pub fn slider_i32<'p>(&self, label: ImStr<'p>,
|
||||
pub fn slider_int<'p>(&self, label: ImStr<'p>,
|
||||
value: &'p mut i32, min: i32, max: i32) -> SliderInt<'ui, 'p> {
|
||||
SliderInt::new(label, value, min, max)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user