GUI: add options for rounded UI elements

This commit is contained in:
tildearrow 2022-03-21 00:52:38 -05:00
parent b83b46aa2c
commit a68dbed760
3 changed files with 47 additions and 5 deletions

View File

@ -1976,6 +1976,12 @@ void FurnaceGUI::drawDebug() {
}
ImGui::TreePop();
}
if (ImGui::TreeNode("User Interface")) {
if (ImGui::Button("Inspect")) {
inspectorOpen=!inspectorOpen;
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Settings")) {
if (ImGui::Button("Sync")) syncSettings();
ImGui::SameLine();
@ -6140,7 +6146,7 @@ bool FurnaceGUI::loop() {
drawChannels();
drawRegView();
//ImGui::ShowMetricsWindow();
if (inspectorOpen) ImGui::ShowMetricsWindow(&inspectorOpen);
if (firstFrame) {
firstFrame=false;
@ -6669,9 +6675,12 @@ void FurnaceGUI::applyUISettings() {
sty.Colors[ImGuiCol_PlotHistogram]=uiColors[GUI_COLOR_MACRO_OTHER];
sty.Colors[ImGuiCol_PlotHistogramHovered]=uiColors[GUI_COLOR_MACRO_OTHER];
/*sty.WindowRounding=8.0f;
sty.FrameRounding=6.0f;
sty.PopupRounding=8.0f;*/
if (settings.roundedWindows) sty.WindowRounding=8.0f;
if (settings.roundedButtons) {
sty.FrameRounding=6.0f;
sty.GrabRounding=6.0f;
}
if (settings.roundedMenus) sty.PopupRounding=8.0f;
sty.ScaleAllSizes(dpiScale);
@ -7072,6 +7081,7 @@ FurnaceGUI::FurnaceGUI():
settingsOpen(false),
mixerOpen(false),
debugOpen(false),
inspectorOpen(false),
oscOpen(true),
volMeterOpen(true),
statsOpen(false),

View File

@ -567,6 +567,9 @@ class FurnaceGUI {
int unifiedDataView;
int sysFileDialog;
// end
int roundedWindows;
int roundedButtons;
int roundedMenus;
unsigned int maxUndoSteps;
String mainFontPath;
String patFontPath;
@ -613,6 +616,9 @@ class FurnaceGUI {
stepOnInsert(0),
unifiedDataView(0),
sysFileDialog(1),
roundedWindows(1),
roundedButtons(1),
roundedMenus(0),
maxUndoSteps(100),
mainFontPath(""),
patFontPath(""),
@ -625,7 +631,7 @@ class FurnaceGUI {
int loopOrder, loopRow, loopEnd, isClipping, extraChannelButtons, patNameTarget, newSongCategory;
bool editControlsOpen, ordersOpen, insListOpen, songInfoOpen, patternOpen, insEditOpen;
bool waveListOpen, waveEditOpen, sampleListOpen, sampleEditOpen, aboutOpen, settingsOpen;
bool mixerOpen, debugOpen, oscOpen, volMeterOpen, statsOpen, compatFlagsOpen;
bool mixerOpen, debugOpen, inspectorOpen, oscOpen, volMeterOpen, statsOpen, compatFlagsOpen;
bool pianoOpen, notesOpen, channelsOpen, regViewOpen;
SelectionPoint selStart, selEnd, cursor;
bool selecting, curNibble, orderNibble, followOrders, followPattern, changeAllOrders;

View File

@ -449,6 +449,23 @@ void FurnaceGUI::drawSettings() {
ImGui::Separator();
bool roundedWindowsB=settings.roundedWindows;
if (ImGui::Checkbox("Rounded window corners",&roundedWindowsB)) {
settings.roundedWindows=roundedWindowsB;
}
bool roundedButtonsB=settings.roundedButtons;
if (ImGui::Checkbox("Rounded buttons",&roundedButtonsB)) {
settings.roundedButtons=roundedButtonsB;
}
bool roundedMenusB=settings.roundedMenus;
if (ImGui::Checkbox("Rounded menu corners",&roundedMenusB)) {
settings.roundedMenus=roundedMenusB;
}
ImGui::Separator();
if (ImGui::TreeNode("Color scheme")) {
if (ImGui::TreeNode("General")) {
ImGui::Text("Color scheme type:");
@ -904,6 +921,9 @@ void FurnaceGUI::syncSettings() {
settings.stepOnInsert=e->getConfInt("stepOnInsert",0);
settings.unifiedDataView=e->getConfInt("unifiedDataView",0);
settings.sysFileDialog=e->getConfInt("sysFileDialog",1);
settings.roundedWindows=e->getConfInt("roundedWindows",1);
settings.roundedButtons=e->getConfInt("roundedButtons",1);
settings.roundedMenus=e->getConfInt("roundedMenus",0);
clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.patFontSize,2,96);
@ -944,6 +964,9 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.stepOnInsert,0,1);
clampSetting(settings.unifiedDataView,0,1);
clampSetting(settings.sysFileDialog,0,1);
clampSetting(settings.roundedWindows,0,1);
clampSetting(settings.roundedButtons,0,1);
clampSetting(settings.roundedMenus,0,1);
// keybinds
LOAD_KEYBIND(GUI_ACTION_OPEN,FURKMOD_CMD|SDLK_o);
@ -1145,6 +1168,9 @@ void FurnaceGUI::commitSettings() {
e->setConf("stepOnInsert",settings.stepOnInsert);
e->setConf("unifiedDataView",settings.unifiedDataView);
e->setConf("sysFileDialog",settings.sysFileDialog);
e->setConf("roundedWindows",settings.roundedWindows);
e->setConf("roundedButtons",settings.roundedButtons);
e->setConf("roundedMenus",settings.roundedMenus);
PUT_UI_COLOR(GUI_COLOR_BACKGROUND);
PUT_UI_COLOR(GUI_COLOR_FRAME_BACKGROUND);