1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 13:50:04 -04:00

This PR has a smaller scope, and this are some reverts

Will no longer change egui::Window!
This commit is contained in:
Konkitoman
2023-08-31 19:37:01 +03:00
parent c10a4cd79a
commit 78a0ae879e
14 changed files with 615 additions and 1261 deletions

View File

@@ -81,7 +81,7 @@ impl Demos {
#[cfg_attr(feature = "serde", serde(default))]
struct Tests {
#[cfg_attr(feature = "serde", serde(skip))]
demos: Vec<Box<dyn Demo + Sync + Send>>,
demos: Vec<Box<dyn Demo>>,
open: BTreeSet<String>,
}
@@ -101,7 +101,7 @@ impl Default for Tests {
}
impl Tests {
pub fn from_demos(demos: Vec<Box<dyn Demo + Sync + Send>>) -> Self {
pub fn from_demos(demos: Vec<Box<dyn Demo>>) -> Self {
let mut open = BTreeSet::new();
open.insert(
super::widget_gallery::WidgetGallery::default()
@@ -146,7 +146,6 @@ fn set_open(open: &mut BTreeSet<String>, key: &'static str, is_open: bool) {
// ----------------------------------------------------------------------------
/// A menu bar in which you can select different demo windows to show.
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[cfg_attr(feature = "serde", serde(default))]
pub struct DemoWindows {

View File

@@ -70,6 +70,7 @@ pub fn drop_target<R>(
InnerResponse::new(ret, response)
}
#[derive(Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct DragAndDropDemo {
/// columns with items

View File

@@ -94,7 +94,7 @@ enum WidgetType {
TextEdit,
}
#[derive(Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq)]
pub struct ManualLayoutTest {
widget_offset: egui::Vec2,
widget_size: egui::Vec2,
@@ -133,7 +133,7 @@ impl super::View for ManualLayoutTest {
fn ui(&mut self, ui: &mut egui::Ui) {
egui::reset_button(ui, self);
let ManualLayoutTest {
let Self {
widget_offset,
widget_size,
widget_type,

View File

@@ -1,4 +1,5 @@
/// Showcase [`TextEdit`].
#[derive(PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[cfg_attr(feature = "serde", serde(default))]
pub struct TextEdit {

View File

@@ -74,6 +74,7 @@ impl super::View for WidgetGallery {
self.gallery_grid_contents(ui);
});
});
ui.separator();
ui.horizontal(|ui| {