#ifndef RENAMEDIALOG_H
#define RENAMEDIALOG_H

#include <QDialog>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout>

class RenameDialog : public QDialog
{
    Q_OBJECT

public:
    explicit RenameDialog(const QString& originalName, QWidget *parent = nullptr);

    QString getNewName() const;
    virtual void keyPressEvent(QKeyEvent *event);

private slots:
    void accept() override;

private:
    QString m_newName = nullptr;

    QLabel *m_textLabel = nullptr;
    QLineEdit *m_nameEdit = nullptr;
    QPushButton *m_closeBtn = nullptr;
    QPushButton *m_cancelBtn = nullptr;
    QPushButton *m_okBtn = nullptr;

    QWidget *m_titleWidget = nullptr;
    QWidget *m_contentWidget = nullptr;
    QHBoxLayout *m_titleLayout = nullptr;
    QVBoxLayout *m_contentLayout = nullptr;
    QHBoxLayout *m_btnLayout = nullptr;
    QVBoxLayout *m_vLayout = nullptr;

    void setupUI(const QString& originalName);
};

#endif // RENAMEDIALOG_H
