Program Listing for File sectioncontrolwidget.h

Return to documentation for file (src/widget/sectioncontrolwidget.h)

#ifndef SECTIONCONTROLWIDGET_H
#define SECTIONCONTROLWIDGET_H

#include <QWidget>
#include "widget/maestrocontrolwidget.h"

namespace Ui {
    class SectionControlWidget;
}

namespace PixelMaestroStudio {
    class SectionControlWidget : public QWidget {
        Q_OBJECT

        public:
            explicit SectionControlWidget(QWidget *parent = nullptr);
            ~SectionControlWidget();

            void refresh();
            Section& get_active_section();
            uint8_t get_layer_index();
            uint8_t get_layer_index(Section& section);
            uint8_t get_section_index();
            uint8_t get_section_index(Section& section);
            void initialize();
            void set_active_section(Section* section);

        private slots:
            void on_gridSizeXSpinBox_editingFinished();
            void on_gridSizeYSpinBox_editingFinished();
            void on_scrollXSpinBox_editingFinished();
            void on_mixModeComboBox_currentIndexChanged(int index);
            void on_scrollYSpinBox_editingFinished();
            void on_alphaSpinBox_editingFinished();
            void on_offsetXSpinBox_editingFinished();
            void on_offsetYSpinBox_editingFinished();

            void on_brightnessSlider_valueChanged(int value);

            void on_brightnessSpinBox_editingFinished();

            void on_mirrorXCheckBox_toggled(bool checked);

            void on_mirrorYCheckBox_toggled(bool checked);

            void on_wrapCheckBox_stateChanged(int arg1);

            void on_layerListWidget_currentRowChanged(int currentRow);

            void on_addLayerButton_clicked();

            void on_removeLayerButton_clicked();

            void on_sectionListWidget_currentRowChanged(int currentRow);

        private:
            Section* active_section_ = nullptr;

            MaestroControlWidget& maestro_control_widget_;
            Ui::SectionControlWidget *ui;

            uint8_t get_num_layers(Section& section);
            void populate_layer_combobox();
            void set_offset();
            void set_scroll();
            void set_section_size();
            void set_layer_controls_enabled(bool enabled);
    };
}

#endif // SECTIONCONTROLWIDGET_H