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

@ -253,6 +253,7 @@ void FurnaceGUI::drawInsList(bool asChild) {
}
if (began) {
if (settings.unifiedDataView) settings.horizontalDataView=0;
pushAddColor();
if (ImGui::Button(ICON_FA_PLUS "##InsAdd")) {
if (settings.unifiedDataView) {
switch (lastAssetType) {
@ -270,6 +271,7 @@ void FurnaceGUI::drawInsList(bool asChild) {
doAction(GUI_ACTION_INS_LIST_ADD);
}
}
popAddColor();
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Add");
}
@ -657,9 +659,11 @@ void FurnaceGUI::drawWaveList(bool asChild) {
began=ImGui::Begin("Wavetables",&waveListOpen,globalWinFlags);
}
if (began) {
pushAddColor();
if (ImGui::Button(ICON_FA_PLUS "##WaveAdd")) {
doAction(GUI_ACTION_WAVE_LIST_ADD);
}
popAddColor();
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Add");
}

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;