diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2021-08-24 10:44:32 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2021-08-24 10:44:32 +0300 |
commit | 326fb51316f7a4311d46dd5c32f0e7245d0316bb (patch) | |
tree | 0e61505b0ee3a23b432b149cd0961a91706951b0 | |
parent | fefc20dbbb7919e8717be43c53202ae9addcdd68 (diff) |
Force enable menu icons under GTK
GTK specific: Fixed missing icons for wxMenuItem on GTK2 and GTK3 for skins that haven't enabled showing an icon for gtk_image_menu_item by forcing showing icons for every skin.
-rw-r--r-- | src/slic3r/GUI/GUI_App.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 06d805eeb..58ce12ae4 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -87,6 +87,11 @@ #include <boost/nowide/fstream.hpp> #endif // ENABLE_THUMBNAIL_GENERATOR_DEBUG +// Needed for forcing menu icons back under gtk2 and gtk3 +#if defined(__WXGTK20__) || defined(__WXGTK3__) + #include <gtk/gtk.h> +#endif + namespace Slic3r { namespace GUI { @@ -799,6 +804,14 @@ bool GUI_App::OnInit() bool GUI_App::on_init_inner() { + // Forcing back menu icons under gtk2 and gtk3. Solution is based on: + // https://docs.gtk.org/gtk3/class.Settings.html + // see also https://docs.wxwidgets.org/3.0/classwx_menu_item.html#a2b5d6bcb820b992b1e4709facbf6d4fb + // TODO: Find workaround for GTK4 +#if defined(__WXGTK20__) || defined(__WXGTK3__) + g_object_set (gtk_settings_get_default (), "gtk-menu-images", TRUE, NULL); +#endif + // Verify resources path const wxString resources_dir = from_u8(Slic3r::resources_dir()); wxCHECK_MSG(wxDirExists(resources_dir), false, |