mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use the Windows default font on Windows 7 and 8/8.1
It contains the characters we need and will make the application look more "native". See #712 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
438fe5dbde
commit
e893f6bd9d
6 changed files with 37 additions and 5 deletions
8
linux.c
8
linux.c
|
@ -12,9 +12,15 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
const char system_divelist_default_font[] = "Sans";
|
const char linux_system_divelist_default_font[] = "Sans";
|
||||||
|
const char *system_divelist_default_font = linux_system_divelist_default_font;
|
||||||
const int system_divelist_default_font_size = 8;
|
const int system_divelist_default_font_size = 8;
|
||||||
|
|
||||||
|
void subsurface_OS_pref_setup(void)
|
||||||
|
{
|
||||||
|
// nothing
|
||||||
|
}
|
||||||
|
|
||||||
void subsurface_user_info(struct user_info *user)
|
void subsurface_user_info(struct user_info *user)
|
||||||
{
|
{
|
||||||
struct passwd *pwd = getpwuid(getuid());
|
struct passwd *pwd = getpwuid(getuid());
|
||||||
|
|
8
macos.c
8
macos.c
|
@ -28,9 +28,15 @@ void subsurface_user_info(struct user_info *info)
|
||||||
#define ICON_NAME "Subsurface.icns"
|
#define ICON_NAME "Subsurface.icns"
|
||||||
#define UI_FONT "Arial 12"
|
#define UI_FONT "Arial 12"
|
||||||
|
|
||||||
const char system_divelist_default_font[] = "Arial";
|
const char mac_system_divelist_default_font[] = "Arial";
|
||||||
|
const char *system_divelist_default_font = mac_system_divelist_default_font;
|
||||||
const int system_divelist_default_font_size = 10;
|
const int system_divelist_default_font_size = 10;
|
||||||
|
|
||||||
|
void subsurface_OS_pref_setup(void)
|
||||||
|
{
|
||||||
|
// nothing
|
||||||
|
}
|
||||||
|
|
||||||
const char *system_default_filename(void)
|
const char *system_default_filename(void)
|
||||||
{
|
{
|
||||||
const char *home, *user;
|
const char *home, *user;
|
||||||
|
|
3
pref.h
3
pref.h
|
@ -79,9 +79,10 @@ extern struct preferences prefs, default_prefs;
|
||||||
|
|
||||||
#define PP_GRAPHS_ENABLED (prefs.pp_graphs.po2 || prefs.pp_graphs.pn2 || prefs.pp_graphs.phe)
|
#define PP_GRAPHS_ENABLED (prefs.pp_graphs.po2 || prefs.pp_graphs.pn2 || prefs.pp_graphs.phe)
|
||||||
|
|
||||||
extern const char system_divelist_default_font[];
|
extern const char *system_divelist_default_font;
|
||||||
extern const int system_divelist_default_font_size;
|
extern const int system_divelist_default_font_size;
|
||||||
extern const char *system_default_filename();
|
extern const char *system_default_filename();
|
||||||
|
extern void subsurface_OS_pref_setup();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,6 +195,7 @@ void setup_system_prefs(void)
|
||||||
{
|
{
|
||||||
const char *env;
|
const char *env;
|
||||||
|
|
||||||
|
subsurface_OS_pref_setup();
|
||||||
default_prefs.divelist_font = strdup(system_divelist_default_font);
|
default_prefs.divelist_font = strdup(system_divelist_default_font);
|
||||||
default_prefs.font_size = system_divelist_default_font_size;
|
default_prefs.font_size = system_divelist_default_font_size;
|
||||||
default_prefs.default_filename = system_default_filename();
|
default_prefs.default_filename = system_default_filename();
|
||||||
|
|
|
@ -479,3 +479,11 @@ QString SubsurfaceSysInfo::osArch()
|
||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
bool isWin7Or8()
|
||||||
|
{
|
||||||
|
QString os = SubsurfaceSysInfo::prettyOsName();
|
||||||
|
return os == "Windows 7" || os.startsWith("Windows 8");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
14
windows.c
14
windows.c
|
@ -12,12 +12,22 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <zip.h>
|
#include <zip.h>
|
||||||
|
|
||||||
const char system_divelist_default_font[] = "Calibri";
|
const char non_standard_system_divelist_default_font[] = "Calibri";
|
||||||
const int system_divelist_default_font_size = 8;
|
const char current_system_divelist_default_font[] = "Segoe UI";
|
||||||
|
const char *system_divelist_default_font = non_standard_system_divelist_default_font;
|
||||||
|
const int system_divelist_default_font_size = 9;
|
||||||
|
|
||||||
void subsurface_user(struct user_info *user)
|
void subsurface_user(struct user_info *user)
|
||||||
{ /* Encourage use of at least libgit2-0.20 */ }
|
{ /* Encourage use of at least libgit2-0.20 */ }
|
||||||
|
|
||||||
|
extern bool isWin7Or8();
|
||||||
|
|
||||||
|
void subsurface_OS_pref_setup(void)
|
||||||
|
{
|
||||||
|
if (isWin7Or8())
|
||||||
|
system_divelist_default_font = current_system_divelist_default_font;
|
||||||
|
}
|
||||||
|
|
||||||
const char *system_default_filename(void)
|
const char *system_default_filename(void)
|
||||||
{
|
{
|
||||||
char datapath[MAX_PATH];
|
char datapath[MAX_PATH];
|
||||||
|
|
Loading…
Add table
Reference in a new issue