-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c531142
commit 55169a9
Showing
6 changed files
with
57 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,46 @@ | ||
#pragma once | ||
#include "GUI/button.hpp" | ||
#include "editor/color_picker/color_picker.hpp" | ||
#include "GUI/container.hpp" | ||
#include "editor/GUI/named_container.hpp" | ||
#include "editor/GUI/toggle.hpp" | ||
#include "slider.hpp" | ||
#include "common/dynamic_blur.hpp" | ||
|
||
|
||
namespace edtr | ||
{ | ||
|
||
struct Toolbox : public GUI::Container | ||
struct Toolbox : public GUI::NamedContainer | ||
{ | ||
explicit | ||
Toolbox(sf::Vector2f size_, sf::Vector2f position_ = {}) | ||
: GUI::Container(GUI::Container::Orientation::Vertical, size_, position_) | ||
{} | ||
|
||
void render(sf::RenderTarget& target) override | ||
: GUI::NamedContainer("Toolbox", GUI::Container::Orientation::Vertical) | ||
{ | ||
sf::RectangleShape background(size); | ||
background.setPosition(position); | ||
background.setFillColor(sf::Color(100, 100, 100, 200)); | ||
GUI::Item::draw(target, background); | ||
header->addItem(create<GUI::EmptyItem>()); | ||
auto tools_toggle = create<GUI::Toggle>(); | ||
tools_toggle->color_on = {240, 180, 0}; | ||
tools_toggle->setState(true); | ||
watch(tools_toggle, [this, tools_toggle]{ | ||
if (tools_toggle->state) { | ||
showRoot(); | ||
} else { | ||
hideRoot(); | ||
} | ||
}); | ||
header->addItem(tools_toggle); | ||
|
||
setPosition(position_); | ||
background_intensity = 180; | ||
setWidth(size_.x); | ||
} | ||
|
||
// void render(sf::RenderTarget& target) override | ||
// { | ||
// sf::RectangleShape background(size); | ||
// background.setPosition(position); | ||
// background.setFillColor(sf::Color(100, 100, 100, 200)); | ||
// GUI::Item::draw(target, background); | ||
// } | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters