GUI: prepare to add a "lock layout" option

This commit is contained in:
tildearrow 2022-04-02 15:07:47 -05:00
parent b90a26a33d
commit fa234afc9d
2 changed files with 44 additions and 2 deletions

View file

@ -24,6 +24,7 @@
#include "../ta-log.h"
#include "../fileutils.h"
#include "imgui.h"
#include "imgui_internal.h"
#include "imgui_impl_sdl.h"
#include "imgui_impl_sdlrenderer.h"
#include "ImGuiFileDialog.h"
@ -2352,6 +2353,9 @@ bool FurnaceGUI::loop() {
ImGui::EndMenu();
}
if (ImGui::BeginMenu("settings")) {
if (ImGui::MenuItem("lock layout",NULL,lockLayout)) {
lockLayout=!lockLayout;
}
if (ImGui::MenuItem("visualizer",NULL,fancyPattern)) {
fancyPattern=!fancyPattern;
e->enableCommandStream(fancyPattern);
@ -2469,7 +2473,7 @@ bool FurnaceGUI::loop() {
}
ImGui::EndMainMenuBar();
ImGui::DockSpaceOverViewport();
ImGui::DockSpaceOverViewport(NULL,lockLayout?(ImGuiDockNodeFlags_NoResize|ImGuiDockNodeFlags_NoCloseButton|ImGuiDockNodeFlags_NoDocking|ImGuiDockNodeFlags_NoDockingSplitMe|ImGuiDockNodeFlags_NoDockingSplitOther):0);
drawPattern();
drawEditControls();
@ -2866,6 +2870,7 @@ bool FurnaceGUI::init() {
tempoView=e->getConfBool("tempoView",true);
waveHex=e->getConfBool("waveHex",false);
lockLayout=e->getConfBool("lockLayout",false);
syncSettings();
@ -3028,6 +3033,7 @@ bool FurnaceGUI::finish() {
e->setConf("tempoView",tempoView);
e->setConf("waveHex",waveHex);
e->setConf("lockLayout",lockLayout);
for (int i=0; i<DIV_MAX_CHANS; i++) {
delete oldPat[i];
@ -3117,6 +3123,31 @@ FurnaceGUI::FurnaceGUI():
notesOpen(false),
channelsOpen(false),
regViewOpen(false),
/*
editControlsDocked(false),
ordersDocked(false),
insListDocked(false),
songInfoDocked(false),
patternDocked(false),
insEditDocked(false),
waveListDocked(false),
waveEditDocked(false),
sampleListDocked(false),
sampleEditDocked(false),
aboutDocked(false),
settingsDocked(false),
mixerDocked(false),
debugDocked(false),
inspectorDocked(false),
oscDocked(false),
volMeterDocked(false),
statsDocked(false),
compatFlagsDocked(false),
pianoDocked(false),
notesDocked(false),
channelsDocked(false),
regViewDocked(false),
*/
selecting(false),
curNibble(false),
orderNibble(false),
@ -3129,6 +3160,8 @@ FurnaceGUI::FurnaceGUI():
wantPatName(false),
firstFrame(true),
tempoView(true),
waveHex(false),
lockLayout(false),
curWindow(GUI_WINDOW_NOTHING),
nextWindow(GUI_WINDOW_NOTHING),
nextDesc(NULL),

View file

@ -798,13 +798,22 @@ class FurnaceGUI {
int curIns, curWave, curSample, curOctave, oldRow, oldOrder, oldOrder1, editStep, exportLoops, soloChan, soloTimeout, orderEditMode, orderCursor;
int loopOrder, loopRow, loopEnd, isClipping, extraChannelButtons, patNameTarget, newSongCategory;
int wheelX, wheelY;
bool editControlsOpen, ordersOpen, insListOpen, songInfoOpen, patternOpen, insEditOpen;
bool waveListOpen, waveEditOpen, sampleListOpen, sampleEditOpen, aboutOpen, settingsOpen;
bool mixerOpen, debugOpen, inspectorOpen, oscOpen, volMeterOpen, statsOpen, compatFlagsOpen;
bool pianoOpen, notesOpen, channelsOpen, regViewOpen;
/* there ought to be a better way...
bool editControlsDocked, ordersDocked, insListDocked, songInfoDocked, patternDocked, insEditDocked;
bool waveListDocked, waveEditDocked, sampleListDocked, sampleEditDocked, aboutDocked, settingsDocked;
bool mixerDocked, debugDocked, inspectorDocked, oscDocked, volMeterDocked, statsDocked, compatFlagsDocked;
bool pianoDocked, notesDocked, channelsDocked, regViewDocked;
*/
SelectionPoint selStart, selEnd, cursor;
bool selecting, curNibble, orderNibble, followOrders, followPattern, changeAllOrders;
bool collapseWindow, demandScrollX, fancyPattern, wantPatName, firstFrame, tempoView, waveHex;
bool collapseWindow, demandScrollX, fancyPattern, wantPatName, firstFrame, tempoView, waveHex, lockLayout;
FurnaceGUIWindows curWindow, nextWindow;
float peak[2];
float patChanX[DIV_MAX_CHANS+1];