-
Notifications
You must be signed in to change notification settings - Fork 323
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
A drop-down that allows changing the execution mode. #6130
Changes from 3 commits
11945cd
a47b113
739e2f9
2abc196
6426666
d811fd2
883cb43
37ec08f
6632a6f
2031123
ed2e4f5
f39f74d
b4f06ca
70a12ce
39ce6a2
9fda421
9d38b2b
2781f0a
71f3bf0
1748b1f
a004adb
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "debug-scene-execution-mode-dropdown" | ||
version = "0.1.0" | ||
authors = ["Enso Team <[email protected]>"] | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[dependencies] | ||
ensogl = { path = "../../../../../lib/rust/ensogl" } | ||
ensogl-drop-down-menu = { path = "../../../../../lib/rust/ensogl/component/drop-down-menu" } | ||
ensogl-list-view = { path = "../../../../../lib/rust/ensogl/component/list-view" } | ||
ensogl-hardcoded-theme = { path = "../../../../../lib/rust/ensogl/app/theme/hardcoded" } | ||
ide-view = { path = "../.." } | ||
ensogl-text-msdf = { path = "../../../../../lib/rust/ensogl/component/text/src/font/msdf" } | ||
ide-view-execution-mode-selector = { path = "../../execution-mode-selector" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
//! This is a visualization example scene which creates a sinusoidal graph. | ||
|
||
// === Standard Linter Configuration === | ||
#![deny(non_ascii_idents)] | ||
#![warn(unsafe_code)] | ||
#![allow(clippy::bool_to_int_with_if)] | ||
#![allow(clippy::let_and_return)] | ||
// === Non-Standard Linter Configuration === | ||
#![warn(missing_copy_implementations)] | ||
#![warn(missing_debug_implementations)] | ||
#![warn(missing_docs)] | ||
#![warn(trivial_casts)] | ||
#![warn(trivial_numeric_casts)] | ||
#![warn(unused_import_braces)] | ||
#![warn(unused_qualifications)] | ||
|
||
use ensogl::prelude::*; | ||
|
||
use ensogl::animation; | ||
use ensogl::application::Application; | ||
use ensogl_text_msdf::run_once_initialized; | ||
use ide_view_execution_mode_selector as execution_mode_selector; | ||
|
||
|
||
|
||
fn make_entries() -> execution_mode_selector::ExecutionModes { | ||
Rc::new(vec!["development".to_string(), "production".to_string()]) | ||
} | ||
|
||
fn init(app: &Application) { | ||
let app = app.clone_ref(); | ||
let world = &app.display; | ||
let _scene = &world.default_scene; | ||
|
||
let execution_mode_selector = execution_mode_selector::ExecutionModeSelector::new(&app); | ||
world.add_child(&execution_mode_selector); | ||
execution_mode_selector.set_execution_modes(make_entries()); | ||
|
||
world | ||
.on | ||
.before_frame | ||
.add(move |_time_info: animation::TimeInfo| { | ||
let _keep_alive = &execution_mode_selector; | ||
}) | ||
.forget(); | ||
} | ||
|
||
|
||
// =================== | ||
// === Entry Point === | ||
// =================== | ||
|
||
/// Entry point for the demo scene. | ||
#[entry_point] | ||
#[allow(dead_code)] | ||
pub fn main() { | ||
run_once_initialized(|| { | ||
let app = Application::new("root"); | ||
init(&app); | ||
mem::forget(app); | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,6 +254,13 @@ fn init(app: &Application) { | |
graph_editor.set_node_profiling_status(node3_id, node3_status); | ||
|
||
|
||
// === Execution Modes === | ||
|
||
graph_editor.set_execution_modes(vec!["development".to_string(), "production".to_string()]); | ||
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. These strings ar defiend in another file as well 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. These are dummy strings anyway. The ones in the demo scene will only be used there, while the other ones will be removed during integration. |
||
|
||
|
||
// === Rendering === | ||
|
||
// let tgt_type = dummy_type_generator.get_dummy_type(); | ||
let mut was_rendered = false; | ||
let mut loader_hidden = false; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "ide-view-execution-mode-selector" | ||
version = "0.1.0" | ||
authors = ["Enso Team <[email protected]>"] | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[dependencies] | ||
enso-frp = { path = "../../../../lib/rust/frp" } | ||
enso-prelude = { path = "../../../../lib/rust/prelude" } | ||
enso-shapely = { path = "../../../../lib/rust/shapely" } | ||
enso-text = { path = "../../../../lib/rust/text" } | ||
ensogl = { path = "../../../../lib/rust/ensogl" } | ||
ensogl-hardcoded-theme = { path = "../../../../lib/rust/ensogl/app/theme/hardcoded" } | ||
ensogl-text-msdf = { path = "../../../../lib/rust/ensogl/component/text/src/font/msdf" } | ||
failure = { workspace = true } | ||
indexmap = "1.9.2" | ||
nalgebra = { workspace = true } | ||
ordered-float = { workspace = true } | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde-wasm-bindgen = { workspace = true } | ||
serde_json = { workspace = true } | ||
ensogl-drop-down-menu = { path = "../../../../lib/rust/ensogl/component/drop-down-menu" } | ||
ensogl-list-view = { path = "../../../../lib/rust/ensogl/component/list-view" } | ||
ensogl-gui-component = { path = "../../../../lib/rust/ensogl/component/gui" } | ||
farmaazon marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
no section