-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
separated tabs from ui crate #269
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,17 +14,12 @@ repository = "https://github.com/rewin123/space_editor" | |
|
||
[workspace] | ||
members = [ | ||
"crates/prefab", | ||
"crates/shared", | ||
"crates/undo", | ||
"crates/persistence", | ||
"crates/editor_core", | ||
"crates/editor_ui", | ||
"crates/*", | ||
"modules/bevy_xpbd_plugin" | ||
] | ||
, "crates/editor_tabs"] | ||
|
||
[workspace.package] | ||
version = "0.5.0" | ||
version = "0.6.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🥁 |
||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
authors = ["rewin <rewin1996@gmail.com>", "Julia Naomi <jnboeira@outlook.com>"] | ||
|
@@ -37,12 +32,13 @@ homepage = "https://github.com/rewin123/space_editor" | |
bevy = "0.13" | ||
|
||
# Editor Crates | ||
space_prefab = { version = "0.5.0", path = "crates/prefab" } | ||
space_shared = { version = "0.5.0", path = "crates/shared" } | ||
space_undo = { version = "0.5.0", path = "crates/undo" } | ||
space_persistence = { version = "0.5.0", path = "crates/persistence"} | ||
space_editor_core = { version = "0.5.0", path = "crates/editor_core", features = ["persistence_editor"] } | ||
space_editor_ui = { version = "0.5.0", path = "crates/editor_ui", features = ["persistence_editor"] } | ||
space_prefab = { version = "0.6.0", path = "crates/prefab" } | ||
space_shared = { version = "0.6.0", path = "crates/shared" } | ||
space_undo = { version = "0.6.0", path = "crates/undo" } | ||
space_persistence = { version = "0.6.0", path = "crates/persistence"} | ||
space_editor_core = { version = "0.6.0", path = "crates/editor_core", features = ["persistence_editor"] } | ||
space_editor_ui = { version = "0.6.0", path = "crates/editor_ui", features = ["persistence_editor"] } | ||
space_editor_tabs = { version = "0.6.0", path = "crates/editor_tabs" } | ||
|
||
# Crates inner libraries | ||
anyhow = "1.0" | ||
|
@@ -74,7 +70,7 @@ ron = "0.8" | |
serde = "1" | ||
|
||
# Community Modules | ||
space_bevy_xpbd_plugin = { version = "0.5.0", path = "modules/bevy_xpbd_plugin"} | ||
space_bevy_xpbd_plugin = { version = "0.6.0", path = "modules/bevy_xpbd_plugin"} | ||
|
||
[dependencies] | ||
bevy.workspace = true | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "space_editor_tabs" | ||
version.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
authors.workspace = true | ||
keywords.workspace = true | ||
categories.workspace = true | ||
repository.workspace = true | ||
homepage.workspace = true | ||
|
||
[dependencies] | ||
bevy.workspace = true | ||
bevy_egui.workspace = true | ||
egui_extras.workspace = true | ||
convert_case.workspace = true | ||
egui_dock.workspace = true | ||
bevy-inspector-egui.workspace = true | ||
|
||
[lints] | ||
workspace = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/// Colors used in editor | ||
use bevy_egui::egui::{Color32, Stroke}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think color, sizing and typography would live better in the UI crate, as they are ui elements. If this crate is the one responsible for the application ui, maybe call this editor_ui and the other editor_ui_extensions/editor_ui_components? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is undoubtedly better located in editor_ui crate. However, these colours are referenced by editor_tabs. However, the PR is already quite large, so I decided to stop with just shuffling the code for now. And the improvement of the separations will be in multiple PRs |
||
|
||
pub fn stroke_default_color() -> Stroke { | ||
Stroke::new(1., STROKE_COLOR) | ||
} | ||
pub const STROKE_COLOR: Color32 = Color32::from_rgb(70, 70, 70); | ||
pub const SPECIAL_BG_COLOR: Color32 = Color32::from_rgb(20, 20, 20); | ||
pub const DEFAULT_BG_COLOR: Color32 = Color32::from_rgb(27, 27, 27); | ||
pub const PLAY_COLOR: Color32 = Color32::from_rgb(0, 194, 149); | ||
pub const ERROR_COLOR: Color32 = Color32::from_rgb(255, 59, 33); | ||
pub const HYPERLINK_COLOR: Color32 = Color32::from_rgb(99, 235, 231); | ||
pub const WARM_COLOR: Color32 = Color32::from_rgb(225, 206, 67); | ||
pub const SELECTED_ITEM_COLOR: Color32 = Color32::from_rgb(76, 93, 235); | ||
pub const TEXT_COLOR: Color32 = Color32::WHITE; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use crate::NewTabBehaviour; | ||
/// This module contains the implementation of the editor tabs | ||
use bevy::prelude::*; | ||
use bevy_egui::egui; | ||
|
||
pub const TAB_MODES: [NewTabBehaviour; 3] = [ | ||
NewTabBehaviour::Pop, | ||
NewTabBehaviour::SameNode, | ||
NewTabBehaviour::SplitNode, | ||
]; | ||
|
||
pub trait EditorTab { | ||
fn ui(&mut self, ui: &mut egui::Ui, commands: &mut Commands, world: &mut World); | ||
fn title(&self) -> egui::WidgetText; | ||
} | ||
|
||
#[derive(Clone, Hash, PartialEq, Eq, Debug, PartialOrd, Ord)] | ||
pub enum EditorTabName { | ||
CameraView, | ||
EventDispatcher, | ||
GameView, | ||
Hierarchy, | ||
Inspector, | ||
Resource, | ||
RuntimeAssets, | ||
Settings, | ||
ToolBox, | ||
Other(String), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already included in
"crates/*"