GUI: some improvements

- mobile UI work
- highlight channel at cursor in orders
This commit is contained in:
tildearrow 2022-11-05 16:22:15 -05:00
parent 086d9a12b0
commit bd77bd0a81
6 changed files with 24 additions and 5 deletions

View file

@ -410,7 +410,7 @@ void FurnaceGUI::drawInsList(bool asChild) {
curIns=i; curIns=i;
wavePreviewInit=true; wavePreviewInit=true;
} }
if (ImGui::IsItemHovered() && i>=0) { if (ImGui::IsItemHovered() && i>=0 && !mobileUI) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_TEXT]); ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_TEXT]);
ImGui::SetTooltip("%s",insType); ImGui::SetTooltip("%s",insType);
ImGui::PopStyleColor(); ImGui::PopStyleColor();
@ -679,7 +679,7 @@ void FurnaceGUI::actualSampleList() {
updateSampleTex=true; updateSampleTex=true;
} }
if (wantScrollList && curSample==i) ImGui::SetScrollHereY(); if (wantScrollList && curSample==i) ImGui::SetScrollHereY();
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered() && !mobileUI) {
ImGui::SetTooltip("Bank %d: %s",i/12,sampleNote[i%12]); ImGui::SetTooltip("Bank %d: %s",i/12,sampleNote[i%12]);
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) { if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
sampleEditOpen=true; sampleEditOpen=true;

View file

@ -3896,8 +3896,12 @@ bool FurnaceGUI::loop() {
if (fileDialog->isError()) { if (fileDialog->isError()) {
#if defined(_WIN32) || defined(__APPLE__) #if defined(_WIN32) || defined(__APPLE__)
showError("there was an error in the file dialog! you may want to report this issue to:\nhttps://github.com/tildearrow/furnace/issues\ncheck the Log Viewer (window > log viewer) for more information.\n\nfor now please disable the system file picker in Settings > General."); showError("there was an error in the file dialog! you may want to report this issue to:\nhttps://github.com/tildearrow/furnace/issues\ncheck the Log Viewer (window > log viewer) for more information.\n\nfor now please disable the system file picker in Settings > General.");
#else
#ifdef ANDROID
showError("can't do anything without Storage permissions!");
#else #else
showError("Zenity/KDialog not available!\nplease install one of these, or disable the system file picker in Settings > General."); showError("Zenity/KDialog not available!\nplease install one of these, or disable the system file picker in Settings > General.");
#endif
#endif #endif
} }
if (fileDialog->accepted()) { if (fileDialog->accepted()) {

View file

@ -1212,6 +1212,7 @@ class FurnaceGUI {
int midiOutMode; int midiOutMode;
int maxRecentFile; int maxRecentFile;
int centerPattern; int centerPattern;
int ordersCursor;
unsigned int maxUndoSteps; unsigned int maxUndoSteps;
String mainFontPath; String mainFontPath;
String patFontPath; String patFontPath;
@ -1338,6 +1339,7 @@ class FurnaceGUI {
midiOutMode(1), midiOutMode(1),
maxRecentFile(10), maxRecentFile(10),
centerPattern(0), centerPattern(0),
ordersCursor(1),
maxUndoSteps(100), maxUndoSteps(100),
mainFontPath(""), mainFontPath(""),
patFontPath(""), patFontPath(""),

View file

@ -102,7 +102,7 @@ void FurnaceGUI::drawOrders() {
//} //}
ImGui::PushStyleColor(ImGuiCol_Text,(curOrder==i || e->curOrders->ord[j][i]==e->curOrders->ord[j][curOrder])?uiColors[GUI_COLOR_ORDER_SIMILAR]:uiColors[GUI_COLOR_ORDER_INACTIVE]); ImGui::PushStyleColor(ImGuiCol_Text,(curOrder==i || e->curOrders->ord[j][i]==e->curOrders->ord[j][curOrder])?uiColors[GUI_COLOR_ORDER_SIMILAR]:uiColors[GUI_COLOR_ORDER_INACTIVE]);
if (ImGui::Selectable(selID,(orderEditMode!=0 && curOrder==i && orderCursor==j))) { if (ImGui::Selectable(selID,settings.ordersCursor?(cursor.xCoarse==j && oldOrder1!=i):false)) {
if (curOrder==i) { if (curOrder==i) {
if (orderEditMode==0) { if (orderEditMode==0) {
prepareUndo(GUI_UNDO_CHANGE_ORDER); prepareUndo(GUI_UNDO_CHANGE_ORDER);
@ -135,6 +135,11 @@ void FurnaceGUI::drawOrders() {
} }
} }
ImGui::PopStyleColor(); ImGui::PopStyleColor();
if (orderEditMode!=0 && curOrder==i && orderCursor==j) {
// draw a border
ImDrawList* dl=ImGui::GetWindowDrawList();
dl->AddRect(ImGui::GetItemRectMin(),ImGui::GetItemRectMax(),ImGui::GetColorU32(uiColors[GUI_COLOR_TEXT]),2.0f*dpiScale);
}
if (!pat->name.empty() && ImGui::IsItemHovered()) { if (!pat->name.empty() && ImGui::IsItemHovered()) {
ImGui::SetTooltip("%s",pat->name.c_str()); ImGui::SetTooltip("%s",pat->name.c_str());
} }

View file

@ -437,7 +437,7 @@ void FurnaceGUI::drawPattern() {
if (ImGui::Selectable((extraChannelButtons==2)?" --##ExtraChannelButtons":" ++##ExtraChannelButtons",false,ImGuiSelectableFlags_NoPadWithHalfSpacing,ImVec2(0.0f,lineHeight+1.0f*dpiScale))) { if (ImGui::Selectable((extraChannelButtons==2)?" --##ExtraChannelButtons":" ++##ExtraChannelButtons",false,ImGuiSelectableFlags_NoPadWithHalfSpacing,ImVec2(0.0f,lineHeight+1.0f*dpiScale))) {
if (++extraChannelButtons>2) extraChannelButtons=0; if (++extraChannelButtons>2) extraChannelButtons=0;
} }
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered() && !mobileUI) {
if (extraChannelButtons==2) { if (extraChannelButtons==2) {
ImGui::SetTooltip("Pattern names (click to collapse)\nRight-click for visualizer"); ImGui::SetTooltip("Pattern names (click to collapse)\nRight-click for visualizer");
} else if (extraChannelButtons==1) { } else if (extraChannelButtons==1) {
@ -706,7 +706,7 @@ void FurnaceGUI::drawPattern() {
if (extraChannelButtons==0 || settings.channelVolStyle!=0) ImGui::PopStyleVar(); if (extraChannelButtons==0 || settings.channelVolStyle!=0) ImGui::PopStyleVar();
if (displayTooltip && ImGui::IsItemHovered()) { if (displayTooltip && ImGui::IsItemHovered() && !mobileUI) {
ImGui::SetTooltip("%s",e->getChannelName(i)); ImGui::SetTooltip("%s",e->getChannelName(i));
} }
if (settings.channelFont==0) ImGui::PopFont(); if (settings.channelFont==0) ImGui::PopFont();

View file

@ -1460,6 +1460,11 @@ void FurnaceGUI::drawSettings() {
settings.sysSeparators=sysSeparatorsB; settings.sysSeparators=sysSeparatorsB;
}*/ }*/
bool ordersCursorB=settings.ordersCursor;
if (ImGui::Checkbox("Highlight channel at cursor in Orders",&ordersCursorB)) {
settings.ordersCursor=ordersCursorB;
}
bool partyTimeB=settings.partyTime; bool partyTimeB=settings.partyTime;
if (ImGui::Checkbox("About screen party time",&partyTimeB)) { if (ImGui::Checkbox("About screen party time",&partyTimeB)) {
settings.partyTime=partyTimeB; settings.partyTime=partyTimeB;
@ -2371,6 +2376,7 @@ void FurnaceGUI::syncSettings() {
settings.midiOutClock=e->getConfInt("midiOutClock",0); settings.midiOutClock=e->getConfInt("midiOutClock",0);
settings.midiOutMode=e->getConfInt("midiOutMode",1); settings.midiOutMode=e->getConfInt("midiOutMode",1);
settings.centerPattern=e->getConfInt("centerPattern",0); settings.centerPattern=e->getConfInt("centerPattern",0);
settings.ordersCursor=e->getConfInt("ordersCursor",1);
clampSetting(settings.mainFontSize,2,96); clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.patFontSize,2,96); clampSetting(settings.patFontSize,2,96);
@ -2475,6 +2481,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.midiOutClock,0,1); clampSetting(settings.midiOutClock,0,1);
clampSetting(settings.midiOutMode,0,2); clampSetting(settings.midiOutMode,0,2);
clampSetting(settings.centerPattern,0,1); clampSetting(settings.centerPattern,0,1);
clampSetting(settings.ordersCursor,0,1);
String initialSys2=e->getConfString("initialSys2",""); String initialSys2=e->getConfString("initialSys2","");
if (initialSys2.empty()) { if (initialSys2.empty()) {
@ -2640,6 +2647,7 @@ void FurnaceGUI::commitSettings() {
e->setConf("midiOutClock",settings.midiOutClock); e->setConf("midiOutClock",settings.midiOutClock);
e->setConf("midiOutMode",settings.midiOutMode); e->setConf("midiOutMode",settings.midiOutMode);
e->setConf("centerPattern",settings.centerPattern); e->setConf("centerPattern",settings.centerPattern);
e->setConf("ordersCursor",settings.ordersCursor);
// colors // colors
for (int i=0; i<GUI_COLOR_MAX; i++) { for (int i=0; i<GUI_COLOR_MAX; i++) {