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

@@ -118,9 +118,9 @@ IPTCPanel::IPTCPanel () :
setExpandAlignProperties(addKW, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
delKW = Gtk::manage( new Gtk::Button () );
setExpandAlignProperties(delKW, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
Gtk::Image* addKWImg = Gtk::manage( new RTImage ("add-small.png") );
Gtk::Image* const addKWImg = Gtk::manage( new RTImage ("add-small", Gtk::ICON_SIZE_BUTTON) );
setExpandAlignProperties(addKWImg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
Gtk::Image* delKWImg = Gtk::manage( new RTImage ("remove-small.png") );
Gtk::Image* const delKWImg = Gtk::manage( new RTImage ("remove-small", Gtk::ICON_SIZE_BUTTON) );
setExpandAlignProperties(delKWImg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
addKW->add (*addKWImg);
delKW->add (*delKWImg);
@@ -168,9 +168,9 @@ IPTCPanel::IPTCPanel () :
setExpandAlignProperties(addSC, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
delSC = Gtk::manage( new Gtk::Button () );
setExpandAlignProperties(delSC, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
Gtk::Image* addSCImg = Gtk::manage( new RTImage ("add-small.png") );
Gtk::Image* const addSCImg = Gtk::manage( new RTImage ("add-small", Gtk::ICON_SIZE_BUTTON) );
setExpandAlignProperties(addSCImg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
Gtk::Image* delSCImg = Gtk::manage( new RTImage ("remove-small.png") );
Gtk::Image* const delSCImg = Gtk::manage( new RTImage ("remove-small", Gtk::ICON_SIZE_BUTTON) );
setExpandAlignProperties(delSCImg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
addSC->add (*addSCImg);
delSC->add (*delSCImg);
@@ -334,25 +334,25 @@ IPTCPanel::IPTCPanel () :
reset = Gtk::manage( new Gtk::Button () ); // M("IPTCPANEL_RESET")
reset->get_style_context()->add_class("Left");
reset->set_image (*Gtk::manage(new RTImage ("undo.png", "redo.png")));
reset->set_image (*Gtk::manage(new RTImage ("undo", Gtk::ICON_SIZE_BUTTON)));
setExpandAlignProperties(reset, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
bbox->attach_next_to (*reset, Gtk::POS_LEFT, 1, 1);
file = Gtk::manage( new Gtk::Button () ); // M("IPTCPANEL_EMBEDDED")
file->get_style_context()->add_class("MiddleH");
file->set_image (*Gtk::manage(new RTImage ("folder-open.png")));
file->set_image (*Gtk::manage(new RTImage ("folder-open", Gtk::ICON_SIZE_BUTTON)));
setExpandAlignProperties(file, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
bbox->attach_next_to (*file, Gtk::POS_RIGHT, 1, 1);
copy = Gtk::manage( new Gtk::Button () );
copy->get_style_context()->add_class("MiddleH");
copy->set_image (*Gtk::manage(new RTImage ("copy.png")));
copy->set_image (*Gtk::manage(new RTImage ("copy", Gtk::ICON_SIZE_BUTTON)));
setExpandAlignProperties(copy, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
bbox->attach_next_to (*copy, Gtk::POS_RIGHT, 1, 1);
paste = Gtk::manage( new Gtk::Button () );
paste->get_style_context()->add_class("Right");
paste->set_image (*Gtk::manage(new RTImage ("paste.png")));
paste->set_image (*Gtk::manage(new RTImage ("paste", Gtk::ICON_SIZE_BUTTON)));
setExpandAlignProperties(paste, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
bbox->attach_next_to (*paste, Gtk::POS_RIGHT, 1, 1);