mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-30 01:54:40 +08:00
Merge branch 'et_gizmos_tooltip' of https://github.com/prusa3d/PrusaSlicer into et_gizmos_tooltip
This commit is contained in:
commit
5b3ca3e4b7
@ -441,6 +441,16 @@ bool ImGuiWrapper::want_any_input() const
|
||||
return io.WantCaptureMouse || io.WantCaptureKeyboard || io.WantTextInput;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
static const ImWchar ranges_keyboard_shortcuts[] =
|
||||
{
|
||||
0x2318, 0x2318, // OSX Command Key symbol
|
||||
0x2325, 0x2325, // OSX Option Key symbol
|
||||
0x21E7, 0x21E7, // OSX Shift Key symbol
|
||||
0,
|
||||
};
|
||||
#endif // __APPLE__
|
||||
|
||||
void ImGuiWrapper::init_font(bool compress)
|
||||
{
|
||||
destroy_font();
|
||||
@ -453,9 +463,9 @@ void ImGuiWrapper::init_font(bool compress)
|
||||
ImFontAtlas::GlyphRangesBuilder builder;
|
||||
builder.AddRanges(m_glyph_ranges);
|
||||
#ifdef __APPLE__
|
||||
builder.AddChar(0x2318); // OSX Command Key symbol
|
||||
builder.AddChar(0x2325); // OSX Option Key symbol
|
||||
builder.AddChar(0x21E7); // OSX Shift Key symbol
|
||||
if (m_font_cjk)
|
||||
// Apple keyboard shortcuts are only contained in the CJK fonts.
|
||||
builder.AddRanges(ranges_keyboard_shortcuts);
|
||||
#endif
|
||||
builder.BuildRanges(&ranges); // Build the final result (ordered ranges with all the unique characters submitted)
|
||||
|
||||
@ -469,6 +479,12 @@ void ImGuiWrapper::init_font(bool compress)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (! m_font_cjk)
|
||||
// Apple keyboard shortcuts are only contained in the CJK fonts.
|
||||
io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/NotoSansCJK-Regular.ttf").c_str(), m_font_size, nullptr, ranges_keyboard_shortcuts);
|
||||
#endif
|
||||
|
||||
// Build texture atlas
|
||||
unsigned char* pixels;
|
||||
int width, height;
|
||||
|
Loading…
x
Reference in New Issue
Block a user