Skip to content
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

added multiple widget icons #626

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added editor/resources/border-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/resources/checkbox-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/resources/fileBrowser-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/resources/image-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/resources/inspector-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/resources/list-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/resources/menu-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/resources/messageBox-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/resources/popup-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/resources/stackPanel-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/resources/window-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 35 additions & 4 deletions editor/src/ui_scene/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ use crate::fyrox::{
},
graph::{BaseSceneGraph, SceneGraph},
gui::{
button::Button, canvas::Canvas, grid::Grid, screen::Screen, text::Text, UiNode,
UserInterface, UserInterfaceResourceExtension,
border::Border, button::Button, canvas::Canvas, check_box::CheckBox,
file_browser::FileBrowser, grid::Grid, image::Image, inspector::Inspector,
list_view::ListView, menu::Menu, messagebox::MessageBox, popup::Popup, screen::Screen,
stack_panel::StackPanel, text::Text, window::Window, UiNode, UserInterface,
UserInterfaceResourceExtension,
},
};
use crate::{
Expand Down Expand Up @@ -97,16 +100,44 @@ impl<'a> WorldViewerDataProvider for UiSceneWorldViewerDataProvider<'a> {

// all icons are able to be used freely
// todo: add more icons

// Containers
if node.cast::<Canvas>().is_some() {
load_image(include_bytes!("../../resources/canvas-icon.png"))
} else if node.cast::<Screen>().is_some() {
load_image(include_bytes!("../../resources/screen-icon.png"))
} else if node.cast::<Grid>().is_some() {
load_image(include_bytes!("../../resources/grid-icon.png"))
} else if node.cast::<Text>().is_some() {
} else if node.cast::<StackPanel>().is_some() {
load_image(include_bytes!("../../resources/stackPanel-icon.png"))
} else if node.cast::<Window>().is_some() {
load_image(include_bytes!("../../resources/window-icon.png"))
} else if node.cast::<MessageBox>().is_some() {
load_image(include_bytes!("../../resources/messageBox-icon.png"))
} else if node.cast::<Menu>().is_some() {
load_image(include_bytes!("../../resources/menu-icon.png"))
} else if node.cast::<Popup>().is_some() {
load_image(include_bytes!("../../resources/popup-icon.png"))
}
// Visual
else if node.cast::<Text>().is_some() {
load_image(include_bytes!("../../resources/text-icon.png"))
} else if node.cast::<Button>().is_some() {
} else if node.cast::<Image>().is_some() {
load_image(include_bytes!("../../resources/image-icon.png"))
} else if node.cast::<Border>().is_some() {
load_image(include_bytes!("../../resources/border-icon.png"))
}
// Controls
else if node.cast::<Button>().is_some() {
load_image(include_bytes!("../../resources/button-icon.png"))
} else if node.cast::<CheckBox>().is_some() {
load_image(include_bytes!("../../resources/checkbox-icon.png"))
} else if node.cast::<ListView>().is_some() {
load_image(include_bytes!("../../resources/list-icon.png"))
} else if node.cast::<FileBrowser>().is_some() {
load_image(include_bytes!("../../resources/fileBrowser-icon.png"))
} else if node.cast::<Inspector>().is_some() {
load_image(include_bytes!("../../resources/inspector-icon.png"))
} else {
None
}
Expand Down
Loading