Move WidgetType from output.rs to lib.rs

This commit is contained in:
Emil Ernerfeldt 2021-05-30 22:52:13 +02:00
parent e6fe6a6f6a
commit 4964d762a7
2 changed files with 26 additions and 24 deletions

View file

@ -1,5 +1,7 @@
//! All the data egui returns to the backend at the end of each frame. //! All the data egui returns to the backend at the end of each frame.
use crate::WidgetType;
/// What egui emits each frame. /// What egui emits each frame.
/// The backend should use this. /// The backend should use this.
#[derive(Clone, Default, PartialEq)] #[derive(Clone, Default, PartialEq)]
@ -380,26 +382,3 @@ impl WidgetInfo {
description.trim().to_owned() description.trim().to_owned()
} }
} }
/// The different types of built-in widgets in egui
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WidgetType {
Label, // TODO: emit Label events
Hyperlink,
TextEdit,
Button,
Checkbox,
RadioButton,
SelectableLabel,
ComboBox,
Slider,
DragValue,
ColorButton,
ImageButton,
CollapsingHeader,
/// If you cannot fit any of the above slots.
///
/// If this is something you think should be added, file an issue.
Other,
}

View file

@ -360,7 +360,7 @@ pub use {
context::{Context, CtxRef}, context::{Context, CtxRef},
data::{ data::{
input::*, input::*,
output::{self, CursorIcon, Output, WidgetInfo, WidgetType}, output::{self, CursorIcon, Output, WidgetInfo},
}, },
grid::Grid, grid::Grid,
id::Id, id::Id,
@ -494,3 +494,26 @@ pub mod special_emojis {
// I really would like to have ferris here. // I really would like to have ferris here.
} }
/// The different types of built-in widgets in egui
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WidgetType {
Label, // TODO: emit Label events
Hyperlink,
TextEdit,
Button,
Checkbox,
RadioButton,
SelectableLabel,
ComboBox,
Slider,
DragValue,
ColorButton,
ImageButton,
CollapsingHeader,
/// If you cannot fit any of the above slots.
///
/// If this is something you think should be added, file an issue.
Other,
}