app_server: Only increase default font sizes if settings were not loaded.

Thanks to axeld for the review.
This commit is contained in:
Augustin Cavalier
2022-10-19 19:37:29 -04:00
parent e1f6b2fbe7
commit a180a40b63
3 changed files with 29 additions and 13 deletions
+2 -1
View File
@@ -526,7 +526,8 @@ Desktop::Init()
}
// now that the mode is set, see if we should increase the default font size
if (fSettings->DefaultPlainFont() == *gFontManager->DefaultPlainFont()) {
if (fSettings->DefaultPlainFont() == *gFontManager->DefaultPlainFont()
&& !fSettings->DidLoadSettings()) {
float fontSize = fSettings->DefaultPlainFont().Size();
gScreenManager->Lock();
Screen* screen = gScreenManager->ScreenAt(0);
+23 -12
View File
@@ -34,7 +34,7 @@ DesktopSettingsPrivate::DesktopSettingsPrivate(server_read_only_memory* shared)
{
// if the on-disk settings are not complete, the defaults will be kept
_SetDefaults();
_Load();
fLoadStatus = _Load();
}
@@ -111,6 +111,7 @@ DesktopSettingsPrivate::_Load()
status_t status = _GetPath(basePath);
if (status < B_OK)
return status;
int32 loadFailures = 0;
// read workspaces settings
@@ -137,8 +138,10 @@ DesktopSettingsPrivate::_Load()
i, &fWorkspaceMessages[i]) == B_OK) {
i++;
}
}
}
} else
loadFailures++;
} else
loadFailures++;
// read font settings
@@ -185,8 +188,10 @@ DesktopSettingsPrivate::_Load()
gDefaultHintingMode = hinting;
gFontManager->Unlock();
}
}
} else
loadFailures++;
} else
loadFailures++;
// read mouse settings
@@ -214,8 +219,10 @@ DesktopSettingsPrivate::_Load()
== B_OK) {
fAcceptFirstClick = acceptFirstClick;
}
}
}
} else
loadFailures++;
} else
loadFailures++;
// read appearance settings
@@ -308,8 +315,10 @@ DesktopSettingsPrivate::_Load()
fShared.colors[i] = B_TRANSPARENT_COLOR;
}
}
}
}
} else
loadFailures++;
} else
loadFailures++;
// read dragger settings
@@ -323,10 +332,12 @@ DesktopSettingsPrivate::_Load()
if (status == B_OK) {
if (settings.FindBool("show", &fShowAllDraggers) != B_OK)
fShowAllDraggers = true;
}
}
} else
loadFailures++;
} else
loadFailures++;
return B_OK;
return (loadFailures > 0) ? B_PARTIAL_READ : B_OK;
}
+4
View File
@@ -27,6 +27,8 @@ public:
server_read_only_memory* shared);
~DesktopSettingsPrivate();
bool DidLoadSettings() const
{ return fLoadStatus == B_OK; }
status_t Save(uint32 mask = kAllSettings);
void SetDefaultPlainFont(const ServerFont& font);
@@ -102,6 +104,8 @@ private:
void _ValidateWorkspacesLayout(int32& columns,
int32& rows) const;
status_t fLoadStatus;
ServerFont fPlainFont;
ServerFont fBoldFont;
ServerFont fFixedFont;