3
0

TexturePresetSelectionWidget.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #pragma once
  9. #if !defined(Q_MOC_RUN)
  10. #include <QWidget>
  11. #include <AzCore/Memory/SystemAllocator.h>
  12. #include <Source/BuilderSettings/BuilderSettingManager.h>
  13. #include <Source/Editor/EditorCommon.h>
  14. #include <Editor/PresetInfoPopup.h>
  15. #endif
  16. class QCheckBox;
  17. namespace Ui
  18. {
  19. class TexturePresetSelectionWidget;
  20. }
  21. namespace ImageProcessingAtomEditor
  22. {
  23. class TexturePresetSelectionWidget
  24. : public QWidget
  25. , protected EditorInternalNotificationBus::Handler
  26. {
  27. Q_OBJECT
  28. public:
  29. AZ_CLASS_ALLOCATOR(TexturePresetSelectionWidget, AZ::SystemAllocator);
  30. explicit TexturePresetSelectionWidget(EditorTextureSetting& texureSetting, QWidget* parent = nullptr);
  31. ~TexturePresetSelectionWidget();
  32. public slots:
  33. void OnCheckBoxStateChanged(bool checked);
  34. void OnRestButton();
  35. void OnChangePreset(int index);
  36. void OnPresetInfoButton();
  37. void OnTagAdded();
  38. void OnTagRemoved();
  39. protected:
  40. ////////////////////////////////////////////////////////////////////////
  41. //EditorInternalNotificationBus
  42. void OnEditorSettingsChanged(bool needRefresh, const AZStd::string& platform);
  43. ////////////////////////////////////////////////////////////////////////
  44. private:
  45. QScopedPointer<Ui::TexturePresetSelectionWidget> m_ui;
  46. AZStd::unordered_set<ImageProcessingAtom::PresetName> m_presetList;
  47. EditorTextureSetting* m_textureSetting;
  48. QScopedPointer<PresetInfoPopup> m_presetPopup;
  49. void SetPresetConvention(const ImageProcessingAtom::PresetSettings* presetSettings);
  50. void SetCheckBoxReadOnly(QCheckBox* checkBox, bool readOnly);
  51. bool m_listAllPresets = true;
  52. };
  53. } //namespace ImageProcessingAtomEditor