Add preference to toggle file path in title bar
This commit is contained in:
parent
8f40d8f4c2
commit
71ad5cbfab
@ -74,6 +74,11 @@ void TextWindow::ScreenChangeArcDimDefault(int link, uint32_t v) {
|
||||
SS.arcDimDefaultDiameter = !SS.arcDimDefaultDiameter;
|
||||
}
|
||||
|
||||
void TextWindow::ScreenChangeShowFullFilePath(int link, uint32_t v) {
|
||||
SS.showFullFilePath = !SS.showFullFilePath;
|
||||
SS.UpdateWindowTitles();
|
||||
}
|
||||
|
||||
void TextWindow::ScreenChangeFixExportColors(int link, uint32_t v) {
|
||||
SS.fixExportColors = !SS.fixExportColors;
|
||||
}
|
||||
@ -351,6 +356,8 @@ void TextWindow::ShowConfiguration() {
|
||||
Printf(false, " %Fd%f%Ll%s arc default is diameter%E",
|
||||
&ScreenChangeArcDimDefault,
|
||||
SS.arcDimDefaultDiameter ? CHECK_TRUE : CHECK_FALSE);
|
||||
Printf(false, " %Fd%f%Ll%s show full file path in the window title%E",
|
||||
&ScreenChangeShowFullFilePath, SS.showFullFilePath ? CHECK_TRUE : CHECK_FALSE);
|
||||
Printf(false, "");
|
||||
Printf(false, "%Ft autosave interval (in minutes)%E");
|
||||
Printf(false, "%Ba %d %Fl%Ll%f[change]%E",
|
||||
|
@ -71,6 +71,8 @@ void SolveSpaceUI::Init() {
|
||||
exportOffset = settings->ThawFloat("ExportOffset", 0.0);
|
||||
// Dimensions on arcs default to diameter vs radius
|
||||
arcDimDefaultDiameter = settings->ThawBool("ArcDimDefaultDiameter", false);
|
||||
// Show full file path in the menu bar
|
||||
showFullFilePath = settings->ThawBool("ShowFullFilePath", true);
|
||||
// Rewrite exported colors close to white into black (assuming white bg)
|
||||
fixExportColors = settings->ThawBool("FixExportColors", true);
|
||||
// Export background color
|
||||
@ -254,6 +256,8 @@ void SolveSpaceUI::Exit() {
|
||||
settings->FreezeFloat("ExportOffset", exportOffset);
|
||||
// Rewrite the default arc dimension setting
|
||||
settings->FreezeBool("ArcDimDefaultDiameter", arcDimDefaultDiameter);
|
||||
// Show full file path in the menu bar
|
||||
settings->FreezeBool("ShowFullFilePath", showFullFilePath);
|
||||
// Rewrite exported colors close to white into black (assuming white bg)
|
||||
settings->FreezeBool("FixExportColors", fixExportColors);
|
||||
// Export background color
|
||||
@ -664,7 +668,11 @@ void SolveSpaceUI::UpdateWindowTitles() {
|
||||
GW.window->SetTitle(C_("title", "(new sketch)"));
|
||||
} else {
|
||||
if(!GW.window->SetTitleForFilename(saveFile)) {
|
||||
GW.window->SetTitle(saveFile.raw);
|
||||
if(SS.showFullFilePath) {
|
||||
GW.window->SetTitle(saveFile.raw);
|
||||
} else {
|
||||
GW.window->SetTitle(saveFile.raw.substr(saveFile.raw.find_last_of("/\\") + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -574,6 +574,7 @@ public:
|
||||
double exportScale;
|
||||
double exportOffset;
|
||||
bool arcDimDefaultDiameter;
|
||||
bool showFullFilePath;
|
||||
bool fixExportColors;
|
||||
bool exportBackgroundColor;
|
||||
bool drawBackFaces;
|
||||
|
1
src/ui.h
1
src/ui.h
@ -443,6 +443,7 @@ public:
|
||||
static void ScreenGoToWebsite(int link, uint32_t v);
|
||||
|
||||
static void ScreenChangeArcDimDefault(int link, uint32_t v);
|
||||
static void ScreenChangeShowFullFilePath(int link, uint32_t v);
|
||||
static void ScreenChangeFixExportColors(int link, uint32_t v);
|
||||
static void ScreenChangeExportBackgroundColor(int link, uint32_t v);
|
||||
static void ScreenChangeBackFaces(int link, uint32_t v);
|
||||
|
Loading…
Reference in New Issue
Block a user