GUI: fix toggles losing their colors on hover

This commit is contained in:
tildearrow 2022-09-10 23:50:53 -05:00
parent 03e226e52b
commit b82e96ec20
5 changed files with 102 additions and 72 deletions

View file

@ -59,12 +59,12 @@ void FurnaceGUI::drawMobileControls() {
if (!portrait) ImGui::Separator(); if (!portrait) ImGui::Separator();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(e->isPlaying())); pushToggleColors(e->isPlaying());
if (portrait) ImGui::SameLine(); if (portrait) ImGui::SameLine();
if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) { if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) {
play(); play();
} }
ImGui::PopStyleColor(); popToggleColors();
if (portrait) ImGui::SameLine(); if (portrait) ImGui::SameLine();
if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) { if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) {
stop(); stop();
@ -76,27 +76,27 @@ void FurnaceGUI::drawMobileControls() {
} }
bool repeatPattern=e->getRepeatPattern(); bool repeatPattern=e->getRepeatPattern();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(repeatPattern)); pushToggleColors(repeatPattern);
if (portrait) ImGui::SameLine(); if (portrait) ImGui::SameLine();
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) {
e->setRepeatPattern(!repeatPattern); e->setRepeatPattern(!repeatPattern);
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(edit)); pushToggleColors(edit);
if (portrait) ImGui::SameLine(); if (portrait) ImGui::SameLine();
if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) { if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) {
edit=!edit; edit=!edit;
} }
ImGui::PopStyleColor(); popToggleColors();
bool metro=e->getMetronome(); bool metro=e->getMetronome();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(metro)); pushToggleColors(metro);
if (portrait) ImGui::SameLine(); if (portrait) ImGui::SameLine();
if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) { if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) {
e->setMetronome(!metro); e->setMetronome(!metro);
} }
ImGui::PopStyleColor(); popToggleColors();
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
ImGui::End(); ImGui::End();
@ -306,11 +306,11 @@ void FurnaceGUI::drawEditControls() {
ImGui::EndTable(); ImGui::EndTable();
} }
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(e->isPlaying())); pushToggleColors(e->isPlaying());
if (ImGui::Button(ICON_FA_PLAY "##Play")) { if (ImGui::Button(ICON_FA_PLAY "##Play")) {
play(); play();
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_STOP "##Stop")) { if (ImGui::Button(ICON_FA_STOP "##Stop")) {
stop(); stop();
@ -340,12 +340,12 @@ void FurnaceGUI::drawEditControls() {
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(noteInputPoly)); pushToggleColors(noteInputPoly);
if (ImGui::Button(noteInputPoly?("Poly##PolyInput"):("Mono##PolyInput"))) { if (ImGui::Button(noteInputPoly?("Poly##PolyInput"):("Mono##PolyInput"))) {
noteInputPoly=!noteInputPoly; noteInputPoly=!noteInputPoly;
e->setAutoNotePoly(noteInputPoly); e->setAutoNotePoly(noteInputPoly);
} }
ImGui::PopStyleColor(); popToggleColors();
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
ImGui::End(); ImGui::End();
@ -356,11 +356,11 @@ void FurnaceGUI::drawEditControls() {
stop(); stop();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(e->isPlaying())); pushToggleColors(e->isPlaying());
if (ImGui::Button(ICON_FA_PLAY "##Play")) { if (ImGui::Button(ICON_FA_PLAY "##Play")) {
play(); play();
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) { if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
e->stepOne(cursor.y); e->stepOne(cursor.y);
@ -369,26 +369,26 @@ void FurnaceGUI::drawEditControls() {
ImGui::SameLine(); ImGui::SameLine();
bool repeatPattern=e->getRepeatPattern(); bool repeatPattern=e->getRepeatPattern();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(repeatPattern)); pushToggleColors(repeatPattern);
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) {
e->setRepeatPattern(!repeatPattern); e->setRepeatPattern(!repeatPattern);
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(edit)); pushToggleColors(edit);
if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) { if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) {
edit=!edit; edit=!edit;
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
bool metro=e->getMetronome(); bool metro=e->getMetronome();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(metro)); pushToggleColors(metro);
if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) { if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) {
e->setMetronome(!metro); e->setMetronome(!metro);
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text("Octave"); ImGui::Text("Octave");
@ -425,12 +425,12 @@ void FurnaceGUI::drawEditControls() {
unimportant(ImGui::Checkbox("Pattern",&followPattern)); unimportant(ImGui::Checkbox("Pattern",&followPattern));
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(noteInputPoly)); pushToggleColors(noteInputPoly);
if (ImGui::Button(noteInputPoly?("Poly##PolyInput"):("Mono##PolyInput"))) { if (ImGui::Button(noteInputPoly?("Poly##PolyInput"):("Mono##PolyInput"))) {
noteInputPoly=!noteInputPoly; noteInputPoly=!noteInputPoly;
e->setAutoNotePoly(noteInputPoly); e->setAutoNotePoly(noteInputPoly);
} }
ImGui::PopStyleColor(); popToggleColors();
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
ImGui::End(); ImGui::End();
@ -438,11 +438,11 @@ void FurnaceGUI::drawEditControls() {
case 2: // compact vertical case 2: // compact vertical
if (ImGui::Begin("Play/Edit Controls",&editControlsOpen,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|globalWinFlags)) { if (ImGui::Begin("Play/Edit Controls",&editControlsOpen,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|globalWinFlags)) {
ImVec2 buttonSize=ImVec2(ImGui::GetContentRegionAvail().x,0.0f); ImVec2 buttonSize=ImVec2(ImGui::GetContentRegionAvail().x,0.0f);
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(e->isPlaying())); pushToggleColors(e->isPlaying());
if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) { if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) {
play(); play();
} }
ImGui::PopStyleColor(); popToggleColors();
if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) { if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) {
stop(); stop();
} }
@ -452,24 +452,24 @@ void FurnaceGUI::drawEditControls() {
} }
bool repeatPattern=e->getRepeatPattern(); bool repeatPattern=e->getRepeatPattern();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(repeatPattern)); pushToggleColors(repeatPattern);
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) {
e->setRepeatPattern(!repeatPattern); e->setRepeatPattern(!repeatPattern);
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(edit)); pushToggleColors(edit);
if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) { if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) {
edit=!edit; edit=!edit;
} }
ImGui::PopStyleColor(); popToggleColors();
bool metro=e->getMetronome(); bool metro=e->getMetronome();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(metro)); pushToggleColors(metro);
if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) { if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) {
e->setMetronome(!metro); e->setMetronome(!metro);
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::Text("Oct."); ImGui::Text("Oct.");
float avail=ImGui::GetContentRegionAvail().x; float avail=ImGui::GetContentRegionAvail().x;
@ -496,23 +496,23 @@ void FurnaceGUI::drawEditControls() {
} }
ImGui::Text("Foll."); ImGui::Text("Foll.");
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(followOrders)); pushToggleColors(followOrders);
if (ImGui::Button("Ord##FollowOrders",buttonSize)) { handleUnimportant if (ImGui::Button("Ord##FollowOrders",buttonSize)) { handleUnimportant
followOrders=!followOrders; followOrders=!followOrders;
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(followPattern)); pushToggleColors(followPattern);
if (ImGui::Button("Pat##FollowPattern",buttonSize)) { handleUnimportant if (ImGui::Button("Pat##FollowPattern",buttonSize)) { handleUnimportant
followPattern=!followPattern; followPattern=!followPattern;
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(noteInputPoly)); pushToggleColors(noteInputPoly);
if (ImGui::Button(noteInputPoly?("Poly##PolyInput"):("Mono##PolyInput"))) { if (ImGui::Button(noteInputPoly?("Poly##PolyInput"):("Mono##PolyInput"))) {
noteInputPoly=!noteInputPoly; noteInputPoly=!noteInputPoly;
e->setAutoNotePoly(noteInputPoly); e->setAutoNotePoly(noteInputPoly);
} }
ImGui::PopStyleColor(); popToggleColors();
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
ImGui::End(); ImGui::End();
@ -520,11 +520,11 @@ void FurnaceGUI::drawEditControls() {
case 3: // split case 3: // split
if (ImGui::Begin("Play Controls",&editControlsOpen,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|globalWinFlags)) { if (ImGui::Begin("Play Controls",&editControlsOpen,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|globalWinFlags)) {
if (e->isPlaying()) { if (e->isPlaying()) {
ImGui::PushStyleColor(ImGuiCol_Button,uiColors[GUI_COLOR_TOGGLE_ON]); pushToggleColors(true);
if (ImGui::Button(ICON_FA_STOP "##Stop")) { if (ImGui::Button(ICON_FA_STOP "##Stop")) {
stop(); stop();
} }
ImGui::PopStyleColor(); popToggleColors();
} else { } else {
if (ImGui::Button(ICON_FA_PLAY "##Play")) { if (ImGui::Button(ICON_FA_PLAY "##Play")) {
play(oldRow); play(oldRow);
@ -547,35 +547,35 @@ void FurnaceGUI::drawEditControls() {
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(edit)); pushToggleColors(edit);
if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) { if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) {
edit=!edit; edit=!edit;
} }
ImGui::PopStyleColor(); popToggleColors();
bool metro=e->getMetronome(); bool metro=e->getMetronome();
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(metro)); pushToggleColors(metro);
if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) { if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) {
e->setMetronome(!metro); e->setMetronome(!metro);
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
bool repeatPattern=e->getRepeatPattern(); bool repeatPattern=e->getRepeatPattern();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(repeatPattern)); pushToggleColors(repeatPattern);
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) {
e->setRepeatPattern(!repeatPattern); e->setRepeatPattern(!repeatPattern);
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(noteInputPoly)); pushToggleColors(noteInputPoly);
if (ImGui::Button(noteInputPoly?("Poly##PolyInput"):("Mono##PolyInput"))) { if (ImGui::Button(noteInputPoly?("Poly##PolyInput"):("Mono##PolyInput"))) {
noteInputPoly=!noteInputPoly; noteInputPoly=!noteInputPoly;
e->setAutoNotePoly(noteInputPoly); e->setAutoNotePoly(noteInputPoly);
} }
ImGui::PopStyleColor(); popToggleColors();
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
ImGui::End(); ImGui::End();

View file

@ -2408,6 +2408,35 @@ void FurnaceGUI::toggleMobileUI(bool enable, bool force) {
} }
} }
void FurnaceGUI::pushToggleColors(bool status) {
ImVec4 toggleColor=status?uiColors[GUI_COLOR_TOGGLE_ON]:uiColors[GUI_COLOR_TOGGLE_OFF];
ImGui::PushStyleColor(ImGuiCol_Button,toggleColor);
if (settings.guiColorsBase) {
toggleColor.x*=0.8f;
toggleColor.y*=0.8f;
toggleColor.z*=0.8f;
} else {
toggleColor.x=CLAMP(toggleColor.x*1.3f,0.0f,1.0f);
toggleColor.y=CLAMP(toggleColor.y*1.3f,0.0f,1.0f);
toggleColor.z=CLAMP(toggleColor.z*1.3f,0.0f,1.0f);
}
ImGui::PushStyleColor(ImGuiCol_ButtonHovered,toggleColor);
if (settings.guiColorsBase) {
toggleColor.x*=0.8f;
toggleColor.y*=0.8f;
toggleColor.z*=0.8f;
} else {
toggleColor.x=CLAMP(toggleColor.x*1.5f,0.0f,1.0f);
toggleColor.y=CLAMP(toggleColor.y*1.5f,0.0f,1.0f);
toggleColor.z=CLAMP(toggleColor.z*1.5f,0.0f,1.0f);
}
ImGui::PushStyleColor(ImGuiCol_ButtonActive,toggleColor);
}
void FurnaceGUI::popToggleColors() {
ImGui::PopStyleColor(3);
}
int _processEvent(void* instance, SDL_Event* event) { int _processEvent(void* instance, SDL_Event* event) {
return ((FurnaceGUI*)instance)->processEvent(event); return ((FurnaceGUI*)instance)->processEvent(event);
} }

View file

@ -47,8 +47,6 @@
#define MARK_MODIFIED modified=true; #define MARK_MODIFIED modified=true;
#define WAKE_UP drawHalt=16; #define WAKE_UP drawHalt=16;
#define TOGGLE_COLOR(x) ((x)?uiColors[GUI_COLOR_TOGGLE_ON]:uiColors[GUI_COLOR_TOGGLE_OFF])
#define BIND_FOR(x) getKeyName(actionKeys[x],true).c_str() #define BIND_FOR(x) getKeyName(actionKeys[x],true).c_str()
// TODO: // TODO:
@ -1616,6 +1614,9 @@ class FurnaceGUI {
void toggleMobileUI(bool enable, bool force=false); void toggleMobileUI(bool enable, bool force=false);
void pushToggleColors(bool status);
void popToggleColors();
void drawMobileControls(); void drawMobileControls();
void drawEditControls(); void drawEditControls();
void drawSongInfo(); void drawSongInfo();

View file

@ -3400,29 +3400,29 @@ void FurnaceGUI::drawInsEdit() {
if (ins->type==DIV_INS_C64) if (ImGui::BeginTabItem("C64")) { if (ins->type==DIV_INS_C64) if (ImGui::BeginTabItem("C64")) {
ImGui::Text("Waveform"); ImGui::Text("Waveform");
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(ins->c64.triOn)); pushToggleColors(ins->c64.triOn);
if (ImGui::Button("tri")) { PARAMETER if (ImGui::Button("tri")) { PARAMETER
ins->c64.triOn=!ins->c64.triOn; ins->c64.triOn=!ins->c64.triOn;
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(ins->c64.sawOn)); pushToggleColors(ins->c64.sawOn);
if (ImGui::Button("saw")) { PARAMETER if (ImGui::Button("saw")) { PARAMETER
ins->c64.sawOn=!ins->c64.sawOn; ins->c64.sawOn=!ins->c64.sawOn;
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(ins->c64.pulseOn)); pushToggleColors(ins->c64.pulseOn);
if (ImGui::Button("pulse")) { PARAMETER if (ImGui::Button("pulse")) { PARAMETER
ins->c64.pulseOn=!ins->c64.pulseOn; ins->c64.pulseOn=!ins->c64.pulseOn;
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(ins->c64.noiseOn)); pushToggleColors(ins->c64.noiseOn);
if (ImGui::Button("noise")) { PARAMETER if (ImGui::Button("noise")) { PARAMETER
ins->c64.noiseOn=!ins->c64.noiseOn; ins->c64.noiseOn=!ins->c64.noiseOn;
} }
ImGui::PopStyleColor(); popToggleColors();
ImVec2 sliderSize=ImVec2(20.0f*dpiScale,128.0*dpiScale); ImVec2 sliderSize=ImVec2(20.0f*dpiScale,128.0*dpiScale);
@ -3484,29 +3484,29 @@ void FurnaceGUI::drawInsEdit() {
ImGui::Text("Filter Mode"); ImGui::Text("Filter Mode");
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(ins->c64.lp)); pushToggleColors(ins->c64.lp);
if (ImGui::Button("low")) { PARAMETER if (ImGui::Button("low")) { PARAMETER
ins->c64.lp=!ins->c64.lp; ins->c64.lp=!ins->c64.lp;
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(ins->c64.bp)); pushToggleColors(ins->c64.bp);
if (ImGui::Button("band")) { PARAMETER if (ImGui::Button("band")) { PARAMETER
ins->c64.bp=!ins->c64.bp; ins->c64.bp=!ins->c64.bp;
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(ins->c64.hp)); pushToggleColors(ins->c64.hp);
if (ImGui::Button("high")) { PARAMETER if (ImGui::Button("high")) { PARAMETER
ins->c64.hp=!ins->c64.hp; ins->c64.hp=!ins->c64.hp;
} }
ImGui::PopStyleColor(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(ins->c64.ch3off)); pushToggleColors(ins->c64.ch3off);
if (ImGui::Button("ch3off")) { PARAMETER if (ImGui::Button("ch3off")) { PARAMETER
ins->c64.ch3off=!ins->c64.ch3off; ins->c64.ch3off=!ins->c64.ch3off;
} }
ImGui::PopStyleColor(); popToggleColors();
P(ImGui::Checkbox("Volume Macro is Cutoff Macro",&ins->c64.volIsCutoff)); P(ImGui::Checkbox("Volume Macro is Cutoff Macro",&ins->c64.volIsCutoff));
P(ImGui::Checkbox("Absolute Cutoff Macro",&ins->c64.filterIsAbs)); P(ImGui::Checkbox("Absolute Cutoff Macro",&ins->c64.filterIsAbs));

View file

@ -152,20 +152,20 @@ void FurnaceGUI::drawSampleEdit() {
ImGui::BeginDisabled(sample->depth!=DIV_SAMPLE_DEPTH_8BIT && sample->depth!=DIV_SAMPLE_DEPTH_16BIT); ImGui::BeginDisabled(sample->depth!=DIV_SAMPLE_DEPTH_8BIT && sample->depth!=DIV_SAMPLE_DEPTH_16BIT);
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(!sampleDragMode)); pushToggleColors(!sampleDragMode);
if (ImGui::Button(ICON_FA_I_CURSOR "##SSelect")) { if (ImGui::Button(ICON_FA_I_CURSOR "##SSelect")) {
sampleDragMode=false; sampleDragMode=false;
} }
ImGui::PopStyleColor(); popToggleColors();
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Edit mode: Select"); ImGui::SetTooltip("Edit mode: Select");
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(sampleDragMode)); pushToggleColors(sampleDragMode);
if (ImGui::Button(ICON_FA_PENCIL "##SDraw")) { if (ImGui::Button(ICON_FA_PENCIL "##SDraw")) {
sampleDragMode=true; sampleDragMode=true;
} }
ImGui::PopStyleColor(); popToggleColors();
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Edit mode: Draw"); ImGui::SetTooltip("Edit mode: Draw");
} }
@ -687,20 +687,20 @@ void FurnaceGUI::drawSampleEdit() {
ImGui::BeginDisabled(sample->depth!=DIV_SAMPLE_DEPTH_8BIT && sample->depth!=DIV_SAMPLE_DEPTH_16BIT); ImGui::BeginDisabled(sample->depth!=DIV_SAMPLE_DEPTH_8BIT && sample->depth!=DIV_SAMPLE_DEPTH_16BIT);
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(!sampleDragMode)); pushToggleColors(!sampleDragMode);
if (ImGui::Button(ICON_FA_I_CURSOR "##SSelect")) { if (ImGui::Button(ICON_FA_I_CURSOR "##SSelect")) {
sampleDragMode=false; sampleDragMode=false;
} }
ImGui::PopStyleColor(); popToggleColors();
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Edit mode: Select"); ImGui::SetTooltip("Edit mode: Select");
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(sampleDragMode)); pushToggleColors(sampleDragMode);
if (ImGui::Button(ICON_FA_PENCIL "##SDraw")) { if (ImGui::Button(ICON_FA_PENCIL "##SDraw")) {
sampleDragMode=true; sampleDragMode=true;
} }
ImGui::PopStyleColor(); popToggleColors();
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Edit mode: Draw"); ImGui::SetTooltip("Edit mode: Draw");
} }