GUI: improve patchbay colors

This commit is contained in:
tildearrow 2023-01-11 13:37:26 -05:00
parent 9f0d8dba20
commit 9d327cacd8
4 changed files with 49 additions and 7 deletions

View File

@ -272,7 +272,10 @@ enum FurnaceGUIColors {
GUI_COLOR_PATCHBAY_PORTSET,
GUI_COLOR_PATCHBAY_PORT,
GUI_COLOR_PATCHBAY_PORT_HIDDEN,
GUI_COLOR_PATCHBAY_CONNECTION,
GUI_COLOR_PATCHBAY_CONNECTION_BG,
GUI_COLOR_PATCHBAY_CONNECTION_HI,
GUI_COLOR_LOGLEVEL_ERROR,
GUI_COLOR_LOGLEVEL_WARNING,

View File

@ -897,8 +897,11 @@ const FurnaceGUIColorDef guiColors[GUI_COLOR_MAX]={
D(GUI_COLOR_CLOCK_BEAT_HIGH,"",ImVec4(0.5f,0.8f,1.0f,1.0f)),
D(GUI_COLOR_PATCHBAY_PORTSET,"",ImVec4(0.25f,0.25f,0.25f,1.0f)),
D(GUI_COLOR_PATCHBAY_PORT,"",ImVec4(0.3f,0.6f,0.6f,1.0f)),
D(GUI_COLOR_PATCHBAY_CONNECTION,"",ImVec4(0.2f,0.5f,0.6f,1.0f)),
D(GUI_COLOR_PATCHBAY_PORT,"",ImVec4(0.3f,0.4f,0.6f,1.0f)),
D(GUI_COLOR_PATCHBAY_PORT_HIDDEN,"",ImVec4(0.4f,0.4f,0.4f,1.0f)),
D(GUI_COLOR_PATCHBAY_CONNECTION,"",ImVec4(0.3f,0.55f,0.8f,1.0f)),
D(GUI_COLOR_PATCHBAY_CONNECTION_BG,"",ImVec4(0.1f,0.25f,0.3f,1.0f)),
D(GUI_COLOR_PATCHBAY_CONNECTION_HI,"",ImVec4(0.2f,1.0f,1.0f,1.0f)),
D(GUI_COLOR_LOGLEVEL_ERROR,"",ImVec4(1.0f,0.2f,0.2f,1.0f)),
D(GUI_COLOR_LOGLEVEL_WARNING,"",ImVec4(1.0f,1.0f,0.2f,1.0f)),

View File

@ -79,6 +79,14 @@ bool FurnaceGUI::portSet(String label, unsigned int portSetID, int ins, int outs
portBorderColor.w
);
ImVec4 portBorderColorH=uiColors[GUI_COLOR_PATCHBAY_PORT_HIDDEN];
ImVec4 portColorH=ImVec4(
portBorderColorH.x*0.75f,
portBorderColorH.y*0.75f,
portBorderColorH.z*0.75f,
portBorderColorH.w
);
ImVec2 minArea=window->DC.CursorPos;
ImVec2 maxArea=ImVec2(
minArea.x+size.x,
@ -137,8 +145,8 @@ bool FurnaceGUI::portSet(String label, unsigned int portSetID, int ins, int outs
if (visible) {
if (ImGui::ItemAdd(portRect,ImGui::GetID(subPortID.c_str()))) {
dl->AddRectFilled(portMin,portMax,ImGui::GetColorU32(portColor),0.0f);
dl->AddRect(portMin,portMax,ImGui::GetColorU32(portBorderColor),0.0f,dpiScale);
dl->AddRectFilled(portMin,portMax,ImGui::GetColorU32((i<activeIns)?portColor:portColorH),0.0f);
dl->AddRect(portMin,portMax,ImGui::GetColorU32((i<activeIns)?portBorderColor:portBorderColorH),0.0f,dpiScale);
dl->AddText(portLabelPos,ImGui::GetColorU32(uiColors[GUI_COLOR_TEXT]),portLabel.c_str());
}
@ -177,8 +185,8 @@ bool FurnaceGUI::portSet(String label, unsigned int portSetID, int ins, int outs
if (visible) {
if (ImGui::ItemAdd(portRect,ImGui::GetID(subPortID.c_str()))) {
dl->AddRectFilled(portMin,portMax,ImGui::GetColorU32(portColor),0.0f);
dl->AddRect(portMin,portMax,ImGui::GetColorU32(portBorderColor),0.0f,dpiScale);
dl->AddRectFilled(portMin,portMax,ImGui::GetColorU32((i<activeOuts)?portColor:portColorH),0.0f);
dl->AddRect(portMin,portMax,ImGui::GetColorU32((i<activeOuts)?portBorderColor:portBorderColorH),0.0f,dpiScale);
dl->AddText(portLabelPos,ImGui::GetColorU32(uiColors[GUI_COLOR_TEXT]),portLabel.c_str());
}
@ -319,7 +327,7 @@ void FurnaceGUI::drawMixer() {
// metronome/sample preview
if (displayInternalPorts) {
if (portSet("Sample Preview",0xffd,0,1,0,1,selectedSubPort,portPos)) {
selectedPortSet=0xffe;
selectedPortSet=0xffd;
if (selectedSubPort>=0) {
portDragActive=true;
ImGui::InhibitInertialScroll();
@ -383,6 +391,18 @@ void FurnaceGUI::drawMixer() {
// draw connections
for (unsigned int i: e->song.patchbay) {
if ((i>>20)==selectedPortSet) continue;
try {
ImVec2 portSrc=portPos.at(i>>16);
ImVec2 portDest=portPos.at(0x10000|(i&0xffff));
dl->AddLine(portSrc,portDest,ImGui::GetColorU32(uiColors[GUI_COLOR_PATCHBAY_CONNECTION_BG]),2.0f*dpiScale);
} catch (std::out_of_range& e) {
}
}
// foreground
for (unsigned int i: e->song.patchbay) {
if ((i>>20)!=selectedPortSet) continue;
try {
ImVec2 portSrc=portPos.at(i>>16);
ImVec2 portDest=portPos.at(0x10000|(i&0xffff));

View File

@ -1972,6 +1972,22 @@ void FurnaceGUI::drawSettings() {
UI_COLOR_CONFIG(GUI_COLOR_PIANO_KEY_BOTTOM_ACTIVE,"Lower key (pressed)");
ImGui::TreePop();
}
if (ImGui::TreeNode("Clock")) {
UI_COLOR_CONFIG(GUI_COLOR_CLOCK_TEXT,"Clock text");
UI_COLOR_CONFIG(GUI_COLOR_CLOCK_BEAT_LOW,"Beat (off)");
UI_COLOR_CONFIG(GUI_COLOR_CLOCK_BEAT_HIGH,"Beat (on)");
ImGui::TreePop();
}
if (ImGui::TreeNode("Patchbay")) {
UI_COLOR_CONFIG(GUI_COLOR_PATCHBAY_PORTSET,"PortSet");
UI_COLOR_CONFIG(GUI_COLOR_PATCHBAY_PORT,"Port");
UI_COLOR_CONFIG(GUI_COLOR_PATCHBAY_PORT_HIDDEN,"Port (hidden/unavailable)");
UI_COLOR_CONFIG(GUI_COLOR_PATCHBAY_CONNECTION,"Connection (selected)");
UI_COLOR_CONFIG(GUI_COLOR_PATCHBAY_CONNECTION_BG,"Connection (other)");
ImGui::TreePop();
}
if (ImGui::TreeNode("Log Viewer")) {
UI_COLOR_CONFIG(GUI_COLOR_LOGLEVEL_ERROR,"Log level: Error");
UI_COLOR_CONFIG(GUI_COLOR_LOGLEVEL_WARNING,"Log level: Warning");