3
0

ResolutionSettingWidget.cpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "ResolutionSettingWidget.h"
  9. #include <Source/Editor/ui_ResolutionSettingWidget.h>
  10. #include <QVBoxLayout>
  11. namespace ImageProcessingAtomEditor
  12. {
  13. using namespace ImageProcessingAtom;
  14. ResolutionSettingWidget::ResolutionSettingWidget(ResoultionWidgetType type, EditorTextureSetting& textureSetting, QWidget* parent /*= nullptr*/)
  15. : QWidget(parent)
  16. , m_ui(new Ui::ResolutionSettingWidget)
  17. , m_textureSetting(&textureSetting)
  18. {
  19. m_ui->setupUi(this);
  20. m_type = type;
  21. //Put default platform in the first row
  22. ResolutionSettingItemWidget* item = new ResolutionSettingItemWidget(ResoultionWidgetType::TexturePropety, this);
  23. item->Init(BuilderSettingManager::s_defaultPlatform, m_textureSetting);
  24. m_ui->listLayout->addWidget(item);
  25. //Add the other platforms in the list
  26. for (auto& it : m_textureSetting->m_settingsMap)
  27. {
  28. AZStd::string platform = it.first;
  29. if (platform != BuilderSettingManager::s_defaultPlatform)
  30. {
  31. ResolutionSettingItemWidget* item2 = new ResolutionSettingItemWidget(ResoultionWidgetType::TexturePropety, this);
  32. item2->Init(platform, m_textureSetting);
  33. m_ui->listLayout->addWidget(item2);
  34. }
  35. }
  36. // Tooltips
  37. m_ui->platformLabel->setToolTip(QString("Each row displays the resolution and pixel format settings for the relative target platform in this column."));
  38. m_ui->downResLabel->setToolTip(QString("Adjust the maximum resolution based on the target platform.\n\
  39. Values range from 0 (full resolution) to 5 (lowest resolution) with each step being half the resolution of the preceding step."));
  40. m_ui->resolutionLabel->setToolTip(QString("The maximum texture resolution for the target platform based on the Resolution Limit setting."));
  41. m_ui->formatLabel->setToolTip(QString("The pixel format of the processed texture for the target platform."));
  42. }
  43. ResolutionSettingWidget::~ResolutionSettingWidget()
  44. {
  45. }
  46. }//namespace ImageProcessingAtomEditor
  47. #include <Source/Editor/moc_ResolutionSettingWidget.cpp>