Skip to content

Commit

Permalink
Change createShortcutsInterface to createDocumentationInterface
Browse files Browse the repository at this point in the history
Modify layouts so we can add the Documentation label without additional margins/indents.
  • Loading branch information
juandejoya committed Sep 27, 2024
1 parent 917623d commit bc9b138
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions source/MaterialXView/Viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,14 +676,25 @@ void Viewer::createPropertyEditorInterface(Widget* parent, const std::string& la
});
}

void Viewer::createShortcutsInterface(Widget* parent, ng::VScrollPanel* scrollPanel)
void Viewer::createDocumentationInterface(Widget* parent, ng::VScrollPanel* scrollPanel)
{

ng::Button* shortcutsButton = new ng::Button(parent, "Keyboard Shortcuts");
ng::GridLayout* documentationLayout = new ng::GridLayout(ng::Orientation::Vertical, 3,
ng::Alignment::Minimum, 13, 5);
documentationLayout->set_row_alignment({ ng::Alignment::Minimum, ng::Alignment::Maximum });

ng::Widget* documentationGroup = new ng::Widget(parent);
documentationGroup->set_layout(documentationLayout);
ng::Label* documentationLabel = new ng::Label(documentationGroup, "Documentation");
documentationLabel->set_font_size(20);
documentationLabel->set_font("sans-bold");

ng::Button* shortcutsButton = new ng::Button(documentationGroup, "Keyboard Shortcuts");
shortcutsButton->set_flags(ng::Button::ToggleButton);
shortcutsButton->set_icon(FA_CARET_RIGHT);
shortcutsButton->set_fixed_width(230);

ng::Widget* shortcutsTable = new ng::Widget(parent);
ng::Widget* shortcutsTable = new ng::Widget(documentationGroup);
shortcutsTable->set_layout(new ng::GroupLayout(13));
shortcutsTable->set_visible(false);

Expand Down Expand Up @@ -1131,7 +1142,7 @@ void Viewer::createAdvancedSettings(Widget* parent)
wedgeCountBox->set_value(8);
wedgeCountBox->set_editable(true);

createShortcutsInterface(advancedPopup, scrollPanel);
createDocumentationInterface(advancedPopup, scrollPanel);
}

void Viewer::updateGeometrySelections()
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXView/Viewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class Viewer : public ng::Screen
void createSaveMaterialsInterface(Widget* parent, const std::string& label);
void createPropertyEditorInterface(Widget* parent, const std::string& label);
void createAdvancedSettings(Widget* parent);
void createShortcutsInterface(Widget* parent, ng::VScrollPanel* scrollPanel);
void createDocumentationInterface(Widget* parent, ng::VScrollPanel* scrollPanel);

// Return the ambient occlusion image, if any, associated with the given material.
mx::ImagePtr getAmbientOcclusionImage(mx::MaterialPtr material);
Expand Down

0 comments on commit bc9b138

Please sign in to comment.