Rename GuiGrouping to GuiPath

Add GuiPath to existing scenegraph nodes
Add option to toggle tree representation
Add caption font to UI
This commit is contained in:
Alexander Bock
2017-10-13 13:08:59 -04:00
parent ebd506975c
commit bb5f4d4381
57 changed files with 600 additions and 418 deletions

View File

@@ -60,6 +60,8 @@ std::unique_ptr<ghoul::opengl::ProgramObject> _program;
std::unique_ptr<ghoul::opengl::Texture> _fontTexture;
char* iniFileBuffer = nullptr;
ImFont* captionFont = nullptr;
static void RenderDrawLists(ImDrawData* drawData) {
// Avoid rendering when minimized, scale coordinates for retina displays
// (screen coordinates != framebuffer coordinates)
@@ -234,10 +236,20 @@ void addScreenSpaceRenderableOnline(std::string texturePath) {
namespace openspace::gui {
void CaptionText(const char* text) {
ImGui::PushFont(captionFont);
ImGui::Text("%s", text);
ImGui::PopFont();
}
GUI::GUI()
: GuiComponent("Main")
, _globalProperty("Global")
, _property("Properties", GuiPropertyComponent::UseTreeLayout::Yes)
, _property(
"Properties",
GuiPropertyComponent::UseTreeLayout::Yes,
GuiPropertyComponent::IsTopLevelWindow::Yes
)
, _screenSpaceProperty("ScreenSpace Properties")
, _virtualProperty("Virtual Properties")
, _featuredProperties("Featured Properties")
@@ -301,6 +313,11 @@ void GUI::initialize() {
FontSize
);
captionFont = io.Fonts->AddFontFromFileTTF(
absPath(GuiFont).c_str(),
FontSize * 1.5f
);
ImGuiStyle& style = ImGui::GetStyle();
style.WindowPadding = { 4.f, 4.f };
style.WindowRounding = 0.f;