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:
@@ -31,7 +31,11 @@ using namespace rtexif;
|
||||
ExifPanel::ExifPanel() :
|
||||
idata(nullptr),
|
||||
changeList(new rtengine::procparams::ExifPairs),
|
||||
defChangeList(new rtengine::procparams::ExifPairs)
|
||||
defChangeList(new rtengine::procparams::ExifPairs),
|
||||
|
||||
delicon("cancel-small"),
|
||||
keepicon("tick-small"),
|
||||
editicon("add-small")
|
||||
{
|
||||
set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||
recursiveOp = true;
|
||||
@@ -54,17 +58,14 @@ ExifPanel::ExifPanel() :
|
||||
exifTree->set_grid_lines (Gtk::TREE_VIEW_GRID_LINES_NONE);
|
||||
exifTree->set_row_separator_func (sigc::mem_fun(*this, &ExifPanel::rowSeperatorFunc));
|
||||
|
||||
delicon = RTImage::createPixbufFromFile ("cancel-small.png");
|
||||
keepicon = RTImage::createPixbufFromFile ("tick-small.png");
|
||||
editicon = RTImage::createPixbufFromFile ("add-small.png");
|
||||
|
||||
Gtk::TreeView::Column *viewcol = Gtk::manage (new Gtk::TreeView::Column ("Field Name"));
|
||||
Gtk::CellRendererPixbuf* render_pb = Gtk::manage (new Gtk::CellRendererPixbuf ());
|
||||
Gtk::CellRendererPixbuf* render_pb = Gtk::manage (new Gtk::CellRendererPixbuf());
|
||||
render_pb->property_stock_size() = Gtk::ICON_SIZE_SMALL_TOOLBAR;
|
||||
Gtk::CellRendererText *render_txt = Gtk::manage (new Gtk::CellRendererText());
|
||||
render_txt->property_ellipsize() = Pango::ELLIPSIZE_END;
|
||||
viewcol->pack_start (*render_pb, false);
|
||||
viewcol->pack_start (*render_txt, true);
|
||||
viewcol->add_attribute (*render_pb, "pixbuf", exifColumns.icon);
|
||||
viewcol->add_attribute (*render_pb, "icon-name", exifColumns.icon);
|
||||
viewcol->add_attribute (*render_txt, "markup", exifColumns.field);
|
||||
viewcol->set_expand (true);
|
||||
viewcol->set_resizable (true);
|
||||
@@ -106,21 +107,21 @@ ExifPanel::ExifPanel() :
|
||||
setExpandAlignProperties (buttons2, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||
|
||||
remove = Gtk::manage (new Gtk::Button ()); // M("EXIFPANEL_REMOVE")
|
||||
remove->set_image (*Gtk::manage (new RTImage(delicon)));
|
||||
remove->set_image (*Gtk::manage (new RTImage(delicon, Gtk::ICON_SIZE_BUTTON)));
|
||||
remove->set_tooltip_text (M ("EXIFPANEL_REMOVEHINT"));
|
||||
remove->get_style_context()->add_class ("Left");
|
||||
setExpandAlignProperties (remove, true, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
|
||||
buttons1->attach_next_to (*remove, Gtk::POS_LEFT, 1, 1);
|
||||
|
||||
keep = Gtk::manage (new Gtk::Button ()); // M("EXIFPANEL_KEEP")
|
||||
keep->set_image (*Gtk::manage (new RTImage(keepicon)));
|
||||
keep->set_image (*Gtk::manage (new RTImage(keepicon, Gtk::ICON_SIZE_BUTTON)));
|
||||
keep->set_tooltip_text (M ("EXIFPANEL_KEEPHINT"));
|
||||
keep->get_style_context()->add_class ("MiddleH");
|
||||
setExpandAlignProperties (keep, true, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
|
||||
buttons1->attach_next_to (*keep, Gtk::POS_RIGHT, 1, 1);
|
||||
|
||||
add = Gtk::manage (new Gtk::Button ()); // M("EXIFPANEL_ADDEDIT")
|
||||
add->set_image (*Gtk::manage (new RTImage(editicon)));
|
||||
add->set_image (*Gtk::manage (new RTImage(editicon, Gtk::ICON_SIZE_BUTTON)));
|
||||
add->set_tooltip_text (M ("EXIFPANEL_ADDEDITHINT"));
|
||||
add->get_style_context()->add_class ("Right");
|
||||
setExpandAlignProperties (add, true, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
|
||||
@@ -134,14 +135,14 @@ ExifPanel::ExifPanel() :
|
||||
buttons2->attach_next_to (*showAll, Gtk::POS_LEFT, 1, 1);
|
||||
|
||||
reset = Gtk::manage (new Gtk::Button ()); // M("EXIFPANEL_RESET")
|
||||
reset->set_image (*Gtk::manage (new RTImage("undo.png", "redo.png")));
|
||||
reset->set_image (*Gtk::manage (new RTImage ("undo", Gtk::ICON_SIZE_BUTTON)));
|
||||
reset->set_tooltip_text (M ("EXIFPANEL_RESETHINT"));
|
||||
reset->get_style_context()->add_class ("MiddleH");
|
||||
setExpandAlignProperties (reset, true, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
|
||||
buttons2->attach_next_to (*reset, Gtk::POS_RIGHT, 1, 1);
|
||||
|
||||
resetAll = Gtk::manage (new Gtk::Button ()); // M("EXIFPANEL_RESETALL")
|
||||
resetAll->set_image (*Gtk::manage (new RTImage ("undo-all.png", "redo-all.png")));
|
||||
resetAll->set_image (*Gtk::manage (new RTImage ("undo-all", Gtk::ICON_SIZE_BUTTON)));
|
||||
resetAll->set_tooltip_text (M ("EXIFPANEL_RESETALLHINT"));
|
||||
resetAll->get_style_context()->add_class ("Right");
|
||||
setExpandAlignProperties (resetAll, false, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
|
||||
|
Reference in New Issue
Block a user