forked from plugdata-team/plugdata
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButtons.cpp
More file actions
27 lines (25 loc) · 978 Bytes
/
Buttons.cpp
File metadata and controls
27 lines (25 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
// Copyright (c) 2023 Alexander Mitchell
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "LICENSE.txt," in this distribution.
*/
#include "../PluginEditor.h"
#include "Buttons.h"
String MainToolbarButton::getTooltip()
{
auto setTooltip = TextButton::getTooltip();
if (auto* editor = dynamic_cast<PluginEditor*>(getParentComponent())) {
if (auto const* cnv = editor->getCurrentCanvas()) {
if (isUndo) {
setTooltip = "Undo";
if (cnv->patch.canUndo() && cnv->patch.lastUndoSequence != "")
setTooltip += ": " + cnv->patch.lastUndoSequence.toString();
} else if (isRedo) {
setTooltip = "Redo";
if (cnv->patch.canRedo() && cnv->patch.lastRedoSequence != "")
setTooltip += ": " + cnv->patch.lastRedoSequence.toString();
}
}
}
return setTooltip;
}