Skip to content

Commit

Permalink
EMSUSD-877 UI tweaks
Browse files Browse the repository at this point in the history
- Move add-layer button left to the border of the panel.
- Don't show context-menu mouse cursor over action buttons.
- Make hover highlight even over muted rows.
- Make hover highlight less dark.
- Rename some paint context flag to be clearer.
- Move "USD Stage" label to the left border.
- Don't draw text under icons with hovering.
- Make text lighter when selected.
- Simplify and centralize the action icon rectangle calculations.
- Improve arrow appearance: smaller, more square, in 6x6 square.
- Adjustment of spacing.
- Remove unnecessary error log when a layer cannot be found. The UI
  already shows a warning icon.
  • Loading branch information
pierrebai-adsk committed Mar 8, 2024
1 parent 54b2575 commit 1690bbb
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 140 deletions.
3 changes: 1 addition & 2 deletions lib/usd/ui/layerEditor/layerEditorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ LayerEditorWidget::LayerEditorWidget(SessionState& in_sessionState, QMainWindow*
QLayout* LayerEditorWidget::setupLayout_toolbar()
{
auto buttonSize = DPIScale(24);
auto margin = DPIScale(12);
auto toolbar = new QHBoxLayout();
toolbar->setContentsMargins(margin, 0, 0, 0);
toolbar->setContentsMargins(0, 0, 0, 0);
auto buttonAlignment = Qt::AlignLeft | Qt::AlignRight;

auto addHIGButton
Expand Down
28 changes: 3 additions & 25 deletions lib/usd/ui/layerEditor/layerTreeItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,37 +140,15 @@ void LayerTreeItem::populateChildren(RecursionDetector* recursionDetector)
for (auto const path : subPaths) {
std::string actualPath = SdfComputeAssetPathRelativeToLayer(_layer, path);
auto subLayer = SdfLayer::FindOrOpen(actualPath);
if (subLayer) {
if (recursionDetector->contains(subLayer->GetRealPath())) {
MString msg;
msg.format(
StringResources::getAsMString(StringResources::kErrorRecursionDetected),
subLayer->GetRealPath().c_str());
puts(msg.asChar());
} else {
auto item = new LayerTreeItem(
subLayer,
LayerType::SubLayer,
path,
&_incomingLayers,
_isSharedStage,
&_sharedLayers,
recursionDetector);
appendRow(item);
}
} else {
MString msg;
msg.format(
StringResources::getAsMString(StringResources::kErrorDidNotFind),
std::string(path).c_str());
puts(msg.asChar());
if (!subLayer || !recursionDetector->contains(subLayer->GetRealPath())) {
auto item = new LayerTreeItem(
subLayer,
LayerType::SubLayer,
path,
&_incomingLayers,
_isSharedStage,
&_sharedLayers);
&_sharedLayers,
recursionDetector);
appendRow(item);
}
}
Expand Down
6 changes: 6 additions & 0 deletions lib/usd/ui/layerEditor/layerTreeItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ class LayerTreeItem : public QStandardItem
// refresh our data from the USD Layer
void fetchData(RebuildChildren in_rebuild, RecursionDetector* in_recursionDetector = nullptr);

enum Roles
{
// Data role containing a boolean indicating if the mouse is over an action button.
kHoverActionRole = Qt::UserRole + 1
};

// QStandardItem API
int type() const override;
QVariant data(int role) const override;
Expand Down
Loading

0 comments on commit 1690bbb

Please sign in to comment.