Initial commit for real hidpi support

Note: This commit has only been tested on MacOS

Changes:
- Icons now use the native hidpi support from Gtk (through Icon Theme)
- Icons are now directly generated from scalable file (i.e. SVG file)
- Widget sizes are scaled based on DPI and scale factor
- Font size is scaled based on DPI and scale factor
This commit is contained in:
Pandagrapher
2022-08-19 16:47:28 +02:00
parent 1e2dc30738
commit 89d2bdce5b
108 changed files with 1949 additions and 2032 deletions

View File

@@ -68,7 +68,6 @@ Glib::ustring argv2;
bool simpleEditor = false;
bool gimpPlugin = false;
bool remote = false;
unsigned char initialGdkScale = 1;
//Glib::Threads::Thread* mainThread;
namespace
@@ -250,7 +249,7 @@ void cleanup_rt()
RTWindow *create_rt_window()
{
Glib::ustring icon_path = Glib::build_filename (argv0, "images");
Glib::ustring icon_path = Glib::build_filename (argv0, "icons");
Glib::RefPtr<Gtk::IconTheme> defaultIconTheme = Gtk::IconTheme::get_default();
defaultIconTheme->append_search_path (icon_path);
@@ -533,16 +532,6 @@ int main (int argc, char **argv)
int ret = 0;
if (options.pseudoHiDPISupport) {
// Reading/updating GDK_SCALE early if it exists
const gchar *gscale = g_getenv("GDK_SCALE");
if (gscale && gscale[0] == '2') {
initialGdkScale = 2;
}
// HOMBRE: On Windows, if resolution is set to 200%, Gtk internal variables are SCALE=2 and DPI=96
g_setenv("GDK_SCALE", "1", true);
}
gdk_threads_set_lock_functions (G_CALLBACK (myGdkLockEnter), (G_CALLBACK (myGdkLockLeave)));
gdk_threads_init();
gtk_init (&argc, &argv); // use the "--g-fatal-warnings" command line flag to make warnings fatal