parent
81150d96fa
commit
f89360392f
|
@ -544,14 +544,50 @@ void FurnaceGUI::setFileName(String name) {
|
||||||
curFileName=ret;
|
curFileName=ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
updateWindowTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FurnaceGUI::updateWindowTitle() {
|
void FurnaceGUI::updateWindowTitle() {
|
||||||
if (e->song.name.empty()) {
|
String title;
|
||||||
SDL_SetWindowTitle(sdlWin,fmt::sprintf("Furnace (%s)",e->getSongSystemName()).c_str());
|
switch (settings.titleBarInfo) {
|
||||||
} else {
|
case 0:
|
||||||
SDL_SetWindowTitle(sdlWin,fmt::sprintf("%s - Furnace (%s)",e->song.name,e->getSongSystemName()).c_str());
|
title="Furnace";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (e->song.name.empty()) {
|
||||||
|
title="Furnace";
|
||||||
|
} else {
|
||||||
|
title=fmt::sprintf("%s - Furnace",e->song.name);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (curFileName.empty()) {
|
||||||
|
title="Furnace";
|
||||||
|
} else {
|
||||||
|
String shortName;
|
||||||
|
size_t pos=curFileName.rfind(DIR_SEPARATOR);
|
||||||
|
if (pos==String::npos) {
|
||||||
|
shortName=curFileName;
|
||||||
|
} else {
|
||||||
|
shortName=curFileName.substr(pos+1);
|
||||||
|
}
|
||||||
|
title=fmt::sprintf("%s - Furnace",shortName);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
if (curFileName.empty()) {
|
||||||
|
title="Furnace";
|
||||||
|
} else {
|
||||||
|
title=fmt::sprintf("%s - Furnace",curFileName);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings.titleBarSys) {
|
||||||
|
title+=fmt::sprintf(" (%s)",e->getSongSystemName());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sdlWin!=NULL) SDL_SetWindowTitle(sdlWin,title.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* defaultLayout="[Window][DockSpaceViewport_11111111]\n\
|
const char* defaultLayout="[Window][DockSpaceViewport_11111111]\n\
|
||||||
|
@ -1502,6 +1538,7 @@ int FurnaceGUI::save(String path, int dmfVersion) {
|
||||||
w->finish();
|
w->finish();
|
||||||
curFileName=path;
|
curFileName=path;
|
||||||
modified=false;
|
modified=false;
|
||||||
|
updateWindowTitle();
|
||||||
if (!e->getWarnings().empty()) {
|
if (!e->getWarnings().empty()) {
|
||||||
showWarning(e->getWarnings(),GUI_WARN_GENERIC);
|
showWarning(e->getWarnings(),GUI_WARN_GENERIC);
|
||||||
}
|
}
|
||||||
|
@ -3064,6 +3101,8 @@ bool FurnaceGUI::finish() {
|
||||||
|
|
||||||
FurnaceGUI::FurnaceGUI():
|
FurnaceGUI::FurnaceGUI():
|
||||||
e(NULL),
|
e(NULL),
|
||||||
|
sdlWin(NULL),
|
||||||
|
sdlRend(NULL),
|
||||||
sampleTex(NULL),
|
sampleTex(NULL),
|
||||||
sampleTexW(0),
|
sampleTexW(0),
|
||||||
sampleTexH(0),
|
sampleTexH(0),
|
||||||
|
|
|
@ -733,6 +733,8 @@ class FurnaceGUI {
|
||||||
int susPosition;
|
int susPosition;
|
||||||
int effectCursorDir;
|
int effectCursorDir;
|
||||||
int cursorPastePos;
|
int cursorPastePos;
|
||||||
|
int titleBarInfo;
|
||||||
|
int titleBarSys;
|
||||||
unsigned int maxUndoSteps;
|
unsigned int maxUndoSteps;
|
||||||
String mainFontPath;
|
String mainFontPath;
|
||||||
String patFontPath;
|
String patFontPath;
|
||||||
|
@ -789,6 +791,8 @@ class FurnaceGUI {
|
||||||
susPosition(0),
|
susPosition(0),
|
||||||
effectCursorDir(1),
|
effectCursorDir(1),
|
||||||
cursorPastePos(1),
|
cursorPastePos(1),
|
||||||
|
titleBarInfo(1),
|
||||||
|
titleBarSys(1),
|
||||||
maxUndoSteps(100),
|
maxUndoSteps(100),
|
||||||
mainFontPath(""),
|
mainFontPath(""),
|
||||||
patFontPath(""),
|
patFontPath(""),
|
||||||
|
|
|
@ -733,6 +733,30 @@ void FurnaceGUI::drawSettings() {
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
|
ImGui::Text("Title bar:");
|
||||||
|
if (ImGui::RadioButton("Furnace##tbar0",settings.titleBarInfo==0)) {
|
||||||
|
settings.titleBarInfo=0;
|
||||||
|
updateWindowTitle();
|
||||||
|
}
|
||||||
|
if (ImGui::RadioButton("Song Name - Furnace##tbar1",settings.titleBarInfo==1)) {
|
||||||
|
settings.titleBarInfo=1;
|
||||||
|
updateWindowTitle();
|
||||||
|
}
|
||||||
|
if (ImGui::RadioButton("file_name.fur - Furnace##tbar2",settings.titleBarInfo==2)) {
|
||||||
|
settings.titleBarInfo=2;
|
||||||
|
updateWindowTitle();
|
||||||
|
}
|
||||||
|
if (ImGui::RadioButton("/path/to/file.fur - Furnace##tbar3",settings.titleBarInfo==3)) {
|
||||||
|
settings.titleBarInfo=3;
|
||||||
|
updateWindowTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool titleBarSysB=settings.titleBarSys;
|
||||||
|
if (ImGui::Checkbox("Display system name on title bar",&titleBarSysB)) {
|
||||||
|
settings.titleBarSys=titleBarSysB;
|
||||||
|
updateWindowTitle();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Text("Status bar:");
|
ImGui::Text("Status bar:");
|
||||||
if (ImGui::RadioButton("Cursor details##sbar0",settings.statusDisplay==0)) {
|
if (ImGui::RadioButton("Cursor details##sbar0",settings.statusDisplay==0)) {
|
||||||
settings.statusDisplay=0;
|
settings.statusDisplay=0;
|
||||||
|
@ -1369,6 +1393,8 @@ void FurnaceGUI::syncSettings() {
|
||||||
settings.susPosition=e->getConfInt("susPosition",0);
|
settings.susPosition=e->getConfInt("susPosition",0);
|
||||||
settings.effectCursorDir=e->getConfInt("effectCursorDir",1);
|
settings.effectCursorDir=e->getConfInt("effectCursorDir",1);
|
||||||
settings.cursorPastePos=e->getConfInt("cursorPastePos",1);
|
settings.cursorPastePos=e->getConfInt("cursorPastePos",1);
|
||||||
|
settings.titleBarInfo=e->getConfInt("titleBarInfo",1);
|
||||||
|
settings.titleBarSys=e->getConfInt("titleBarSys",1);
|
||||||
|
|
||||||
clampSetting(settings.mainFontSize,2,96);
|
clampSetting(settings.mainFontSize,2,96);
|
||||||
clampSetting(settings.patFontSize,2,96);
|
clampSetting(settings.patFontSize,2,96);
|
||||||
|
@ -1417,6 +1443,8 @@ void FurnaceGUI::syncSettings() {
|
||||||
clampSetting(settings.susPosition,0,1);
|
clampSetting(settings.susPosition,0,1);
|
||||||
clampSetting(settings.effectCursorDir,0,1);
|
clampSetting(settings.effectCursorDir,0,1);
|
||||||
clampSetting(settings.cursorPastePos,0,1);
|
clampSetting(settings.cursorPastePos,0,1);
|
||||||
|
clampSetting(settings.titleBarInfo,0,3);
|
||||||
|
clampSetting(settings.titleBarSys,0,1);
|
||||||
|
|
||||||
// keybinds
|
// keybinds
|
||||||
LOAD_KEYBIND(GUI_ACTION_OPEN,FURKMOD_CMD|SDLK_o);
|
LOAD_KEYBIND(GUI_ACTION_OPEN,FURKMOD_CMD|SDLK_o);
|
||||||
|
@ -1662,6 +1690,8 @@ void FurnaceGUI::commitSettings() {
|
||||||
e->setConf("susPosition",settings.susPosition);
|
e->setConf("susPosition",settings.susPosition);
|
||||||
e->setConf("effectCursorDir",settings.effectCursorDir);
|
e->setConf("effectCursorDir",settings.effectCursorDir);
|
||||||
e->setConf("cursorPastePos",settings.cursorPastePos);
|
e->setConf("cursorPastePos",settings.cursorPastePos);
|
||||||
|
e->setConf("titleBarInfo",settings.titleBarInfo);
|
||||||
|
e->setConf("titleBarSys",settings.titleBarSys);
|
||||||
|
|
||||||
PUT_UI_COLOR(GUI_COLOR_BACKGROUND);
|
PUT_UI_COLOR(GUI_COLOR_BACKGROUND);
|
||||||
PUT_UI_COLOR(GUI_COLOR_FRAME_BACKGROUND);
|
PUT_UI_COLOR(GUI_COLOR_FRAME_BACKGROUND);
|
||||||
|
|
Loading…
Reference in a new issue