#ifndef FEDIPOTATO_GUI_WIDGET_POST_HPP #define FEDIPOTATO_GUI_WIDGET_POST_HPP #include "../ui/ui_widget_post.h" #include #include namespace FediPotato { class PostWidget : public QWidget, private Ui::PostWidget { Q_OBJECT public: //! Default constructor explicit PostWidget(QWidget *parent = nullptr) : QWidget{parent} { setupUi(this); } //! Copy constructor PostWidget(const PostWidget &other) = delete; //! Move constructor PostWidget(PostWidget &&other) noexcept = delete; //! Destructor ~PostWidget() noexcept override = default; //! Copy assignment operator PostWidget& operator=(const PostWidget &other) = delete; //! Move assignment operator PostWidget& operator=(PostWidget &&other) noexcept = delete; public: inline void set_user(const QString &user) { label_user->setText(user); } inline void set_avatar(const QString &avatar) { label_avatar->setPixmap(QIcon(avatar).pixmap(QSize(50, 50))); } inline void set_subject(const QString &subject) { label_subject->setText(subject); } inline void set_content(const QString &content) { label_content->setText(content); } void show_hide_elements(); private slots: void toggled_button_show_more(const bool &toggled); }; } // namespace FediPotato #endif // FEDIPOTATO_GUI_WIDGET_POST_HPP