some pushaddcolor's and improve grooves

This commit is contained in:
Eknous-P 2023-08-26 16:01:56 +04:00
parent 9e405e86fa
commit 0dbe1b401f
2 changed files with 15 additions and 2 deletions

View file

@ -47,13 +47,14 @@ void FurnaceGUI::drawGrooves() {
ImGui::TableNextColumn();
ImGui::Text("pattern");
ImGui::TableNextColumn();
ImGui::Text("remove");
// ImGui::Text("remove"); removed because the text clips from the fixed width
int index=0;
for (DivGroovePattern& i: e->song.grooves) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::PushFont(patFont);
ImGui::AlignTextToFramePadding();
ImGui::Text("%.2X",index);
ImGui::PopFont();
@ -79,6 +80,7 @@ void FurnaceGUI::drawGrooves() {
ImGui::SetKeyboardFocusHere();
}
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
ImGui::AlignTextToFramePadding();
if (ImGui::InputText(grooveStr.c_str(),&grooveListString)) {
decodeMMLStr(grooveListString,intVersion,intVersionLen,ignoredLoop,1,255,ignoredRel);
if (intVersionLen<1) {
@ -120,10 +122,15 @@ void FurnaceGUI::drawGrooves() {
}
ImGui::TableNextColumn();
String grooveID=fmt::sprintf(ICON_FA_TIMES "##GRR%d",index);
pushDestColor();
String grooveID=fmt::sprintf(ICON_FA_MINUS "##GRR%d",index);
if (ImGui::Button(grooveID.c_str())) {
delGroove=index;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("remove");
}
popDestColor();
index++;
}
@ -138,12 +145,14 @@ void FurnaceGUI::drawGrooves() {
MARK_MODIFIED;
}
pushAddColor();
if (ImGui::Button(ICON_FA_PLUS "##AddGroove")) {
e->lockEngine([this]() {
e->song.grooves.push_back(DivGroovePattern());
});
MARK_MODIFIED;
}
popAddColor();
}
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) {
curWindow=GUI_WINDOW_GROOVES;