-
Notifications
You must be signed in to change notification settings - Fork 222
Fix various EF dialog issues. #4688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
0ff4fdd
010b788
9be8e90
48429eb
dfdfb48
cdb67b6
ad9e98f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ | |
| #include <AdskUsdEditForwardUi/StageEntry.h> | ||
| #include <QtCore/QPointer> | ||
| #include <QtCore/QTimer> | ||
| #include <QtCore/QVariant> | ||
| #include <QtWidgets/QVBoxLayout> | ||
|
|
||
| #include <vector> | ||
|
|
@@ -79,12 +80,18 @@ struct SelectionObserver : Ufe::Observer | |
| } // namespace | ||
|
|
||
| EditForwardDialog::EditForwardDialog(const QString& title, QWidget* parent) | ||
| : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint) | ||
| : QDialog(parent) | ||
| { | ||
| setAttribute(Qt::WA_DeleteOnClose); | ||
| setWindowTitle(title); | ||
| resize( | ||
| static_cast<int>(MQtUtil::dpiScale(1250.0f)), static_cast<int>(MQtUtil::dpiScale(1000.0f))); | ||
| // Maya keys saved window preferences off the object name. | ||
| setObjectName("EditForwardConfigDialog"); | ||
|
|
||
| // Tell Maya to treat this as a Maya-managed window. This is the same | ||
| // mechanism Maya uses internally to keep its own dialogs from going behind | ||
| // the main window. This should not be combined with other flags. | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same fix as in AR 3aa943c
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "This should not be combined with other flags." what does this mean?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Per Maya dev guidance these two calls should be applied alone, without combining with any other Qt window flags." Is what that other commit wrote.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AramAzhari-adsk Do you know specifics?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the late reply as I was OoO. For the record, we are referring to the line after: I hope that clears it up. |
||
| setWindowFlags(Qt::Window); | ||
| setProperty("saveWindowPref", QVariant::fromValue(true)); | ||
|
|
||
| _forwardWidget = new AdskUsdEditForwardUi::ForwardWidget(this); | ||
| _forwardWidget->setSourceLayerDefault( | ||
|
|
@@ -127,6 +134,12 @@ EditForwardDialog::~EditForwardDialog() | |
| } | ||
| } | ||
|
|
||
| QSize EditForwardDialog::sizeHint() const | ||
| { | ||
| return QSize( | ||
| static_cast<int>(MQtUtil::dpiScale(1250.0f)), static_cast<int>(MQtUtil::dpiScale(1000.0f))); | ||
| } | ||
|
|
||
| void EditForwardDialog::processNodeAdded(MObject& /*node*/) | ||
| { | ||
| QTimer::singleShot(0, this, &EditForwardDialog::refreshStages); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -733,22 +733,32 @@ void LayerEditorWidget::onSplitterMoved(int pos, int index) | |
| void LayerEditorWidget::openEditForwardDialog() | ||
| { | ||
| auto* ss = &_sessionState; | ||
| if (_editForwardDialog) { | ||
| if (!_editForwardDialog) { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes here are also bascially the same as what was done in AR 3aa943c |
||
| _editForwardDialog = new UsdEditForwardConfig::EditForwardDialog( | ||
| StringResources::getAsQString(StringResources::kConfigureEditForwardingTitle), | ||
| MQtUtil::mainWindow()); | ||
| // While the layer editor is open, follow its current stage. | ||
| QObject::connect(ss, &SessionState::currentStageChangedSignal, this, [this, ss]() { | ||
| if (_editForwardDialog) { | ||
| _editForwardDialog->setActiveStage(ss->stage()); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| // If the dialog was previously minimized, restore it before showing. | ||
| if (_editForwardDialog->isMinimized()) { | ||
| _editForwardDialog->setWindowState( | ||
| (_editForwardDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive); | ||
| } | ||
|
|
||
| // Only show() a dialog that is actually hidden. Showing a saveWindowPref | ||
| // window re-applies its stored position, which would move an already-open | ||
| // dialog away from where the user last dragged it. | ||
| if (!_editForwardDialog->isVisible()) { | ||
| _editForwardDialog->show(); | ||
| _editForwardDialog->raise(); | ||
| _editForwardDialog->activateWindow(); | ||
| return; | ||
| } | ||
| _editForwardDialog = new UsdEditForwardConfig::EditForwardDialog( | ||
| StringResources::getAsQString(StringResources::kConfigureEditForwardingTitle), | ||
| MQtUtil::mainWindow()); | ||
| // While the layer editor is open, follow its current stage. | ||
| QObject::connect(ss, &SessionState::currentStageChangedSignal, this, [this, ss]() { | ||
| if (_editForwardDialog) { | ||
| _editForwardDialog->setActiveStage(ss->stage()); | ||
| } | ||
| }); | ||
| _editForwardDialog->show(); | ||
| _editForwardDialog->raise(); | ||
| _editForwardDialog->activateWindow(); | ||
| } | ||
|
|
||
| #endif // WANT_ADSK_USD_EDIT_FORWARD_BUILD | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stop forcing the size everytime. Via size hint and with the other changes below, keeps the user size