#pragma once #include "UI/CameraRawSlider.h" #include #include class PickerField; class QLabel; // Swift's Camera Raw rows: title, slider, exact field. class CameraRawRow : public QWidget { Q_OBJECT public: struct Spec { QString name; QString title; QString help; double low = -100; double high = 100; int decimals = 0; CameraRawSliderTrack track = {}; // The title's width: at least this, or exactly when fixed. int titleWidth = 96; bool fixedTitle = false; // No field at zero. int fieldWidth = 56; // A double click on the title resets it. bool titleResets = false; }; // `slide` takes the slider's own value, `type` a typed number. CameraRawRow(Spec spec, std::function value, std::function slide, std::function type, std::function reset, QWidget *parent = nullptr); // Shows the value; a focused field keeps its typing. void synchronize(); protected: bool eventFilter(QObject *watched, QEvent *event) override; private: const Spec m_spec; const std::function m_value; const std::function m_reset; QLabel *const m_title; CameraRawSlider *const m_slider; PickerField *m_field = nullptr; };