forked from TheCherno/Hazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Hazelnut will now prompt to open project on startup if no command line args are set - Fixed crash when editing already set script module class name - Added UI::ScopedStyleColor utility class
- Loading branch information
Showing
5 changed files
with
73 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include <imgui/imgui.h> | ||
|
||
namespace Hazel::UI { | ||
|
||
struct ScopedStyleColor | ||
{ | ||
ScopedStyleColor() = default; | ||
|
||
ScopedStyleColor(ImGuiCol idx, ImVec4 color, bool predicate = true) | ||
: m_Set(predicate) | ||
{ | ||
if (predicate) | ||
ImGui::PushStyleColor(idx, color); | ||
} | ||
|
||
ScopedStyleColor(ImGuiCol idx, ImU32 color, bool predicate = true) | ||
: m_Set(predicate) | ||
{ | ||
if (predicate) | ||
ImGui::PushStyleColor(idx, color); | ||
} | ||
|
||
~ScopedStyleColor() | ||
{ | ||
if (m_Set) | ||
ImGui::PopStyleColor(); | ||
} | ||
private: | ||
bool m_Set = false; | ||
}; | ||
|
||
|
||
} |
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