Skip to content

Commit

Permalink
Merge pull request #626 from shyamjayakannan/icons_for_widgets
Browse files Browse the repository at this point in the history
added multiple widget icons
  • Loading branch information
mrDIMAS committed Apr 7, 2024
2 parents e194dc5 + bc42c6b commit 7de5a31
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 4 deletions.
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

0 comments on commit 7de5a31

Please sign in to comment.