54 void setVisible(
bool should_be_visible)
override;
58 void mouseUp(
const MouseEvent& e)
override;
67 file_ = std::move(file);
68 preset_text_->setText(file_.getFileNameWithoutExtension());
88 std::unique_ptr<PlainTextComponent> delete_text_;
89 std::unique_ptr<PlainTextComponent> preset_text_;
91 std::unique_ptr<OpenGlToggleButton> delete_button_;
92 std::unique_ptr<OpenGlToggleButton> cancel_button_;
94 Array<Listener*> listeners_;
Interface for objects that need to respond when a file is deleted.
Definition delete_section.h:32
virtual ~Listener()=default
Virtual destructor for proper cleanup.
virtual void fileDeleted(File save_file)=0
An overlay that asks the user to confirm deletion of a preset file.
Definition delete_section.h:15
static constexpr int kDeleteWidth
Width of the delete confirmation box.
Definition delete_section.h:18
Rectangle< int > getDeleteRect()
Definition delete_section.cpp:111
static constexpr int kPaddingX
Horizontal padding inside the confirmation box.
Definition delete_section.h:24
void buttonClicked(Button *clicked_button) override
Definition delete_section.cpp:98
void mouseUp(const MouseEvent &e) override
Definition delete_section.cpp:91
static constexpr int kPaddingY
Vertical padding inside the confirmation box.
Definition delete_section.h:26
virtual ~DeleteSection()=default
Destructor.
static constexpr int kTextHeight
The height of the text within the confirmation box.
Definition delete_section.h:22
void resized() override
Lays out the components inside the delete confirmation box.
Definition delete_section.cpp:41
void addDeleteListener(Listener *listener)
Definition delete_section.h:77
void setFileToDelete(File file)
Definition delete_section.h:66
void removeDeleteListener(Listener *listener)
Definition delete_section.h:81
DeleteSection(const String &name)
Constructs a DeleteSection overlay with a message, filename, and Delete/Cancel buttons.
Definition delete_section.cpp:10
static constexpr int kDeleteHeight
Height of the delete confirmation box.
Definition delete_section.h:20
void setVisible(bool should_be_visible) override
Sets the visibility of the DeleteSection. Repaints background if becoming visible.
Definition delete_section.cpp:79
static constexpr int kButtonHeight
Height of the buttons inside the confirmation box.
Definition delete_section.h:28
A convenience class for a single quad rendered via OpenGL.
Definition open_gl_multi_quad.h:447
A SynthSection that displays an overlay with a background and optional listeners.
Definition overlay.h:180