mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[glass] Fix CollapsingHeader in Encoder, PCM, and DeviceTree (#3797)
The new storage approach was attempting to save both the name and the open status to the same storage key.
This commit is contained in:
@@ -70,17 +70,17 @@ void glass::DisplayEncoder(EncoderModel* model) {
|
||||
std::string& name = GetStorage().GetString("name");
|
||||
char label[128];
|
||||
if (!name.empty()) {
|
||||
std::snprintf(label, sizeof(label), "%s [%d,%d]###name", name.c_str(), chA,
|
||||
chB);
|
||||
std::snprintf(label, sizeof(label), "%s [%d,%d]###header", name.c_str(),
|
||||
chA, chB);
|
||||
} else {
|
||||
std::snprintf(label, sizeof(label), "Encoder[%d,%d]###name", chA, chB);
|
||||
std::snprintf(label, sizeof(label), "Encoder[%d,%d]###header", chA, chB);
|
||||
}
|
||||
|
||||
// header
|
||||
bool open = CollapsingHeader(label);
|
||||
|
||||
// context menu to change name
|
||||
if (PopupEditName("name", &name)) {
|
||||
if (PopupEditName("header", &name)) {
|
||||
model->SetName(name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user