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

@@ -170,7 +170,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha
iVBox->pack_start(*dcpFrame);
saveRef = Gtk::manage(new Gtk::Button(M("TP_ICM_SAVEREFERENCE")));
saveRef->set_image(*Gtk::manage(new RTImage("save-small.png")));
saveRef->set_image(*Gtk::manage(new RTImage("save-small", Gtk::ICON_SIZE_BUTTON)));
saveRef->set_alignment(0.5f, 0.5f);
saveRef->set_tooltip_markup(M("TP_ICM_SAVEREFERENCE_TOOLTIP"));
iVBox->pack_start(*saveRef, Gtk::PACK_SHRINK);
@@ -268,7 +268,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha
neutral = Gtk::manage (new Gtk::Button (M ("TP_ICM_NEUTRAL")));
setExpandAlignProperties (neutral, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
RTImage *resetImg = Gtk::manage (new RTImage ("undo-small.png", "redo-small.png"));
RTImage *resetImg = Gtk::manage (new RTImage ("undo-small", Gtk::ICON_SIZE_BUTTON));
setExpandAlignProperties (resetImg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
neutral->set_image (*resetImg);
neutralconn = neutral->signal_pressed().connect ( sigc::mem_fun (*this, &ICMPanel::neutral_pressed) );
@@ -340,7 +340,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha
redVBox->pack_start(*bluBox, Gtk::PACK_EXPAND_WIDGET);
preser = Gtk::manage(new Adjuster(M("TP_ICM_WORKING_PRESER"), 0., 100., 0.5, 0.));
preser->setAdjusterListener(this);
preBox = Gtk::manage(new Gtk::Box());
preBox->pack_start(*preser, Gtk::PACK_SHRINK);
redVBox->pack_start(*separator1, Gtk::PACK_SHRINK);
@@ -352,7 +352,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha
redVBox->pack_start(*cielab, Gtk::PACK_SHRINK);
redVBox->pack_start(*labgridcie, Gtk::PACK_EXPAND_WIDGET, 4);
redFrame->add(*redVBox);
wGamma->setAdjusterListener(this);
@@ -374,10 +374,10 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha
Gtk::Label* abIntentLbl = Gtk::manage(new Gtk::Label(M("TP_ICM_PROFILEINTENT")));
riaHBox->pack_start(*abIntentLbl, Gtk::PACK_SHRINK);
aRendIntent.reset(new PopUpButton());
aRendIntent->addEntry("intent-perceptual.png", M("PREFERENCES_INTENT_PERCEPTUAL"));
aRendIntent->addEntry("intent-relative.png", M("PREFERENCES_INTENT_RELATIVE"));
aRendIntent->addEntry("intent-saturation.png", M("PREFERENCES_INTENT_SATURATION"));
aRendIntent->addEntry("intent-absolute.png", M("PREFERENCES_INTENT_ABSOLUTE"));
aRendIntent->addEntry("intent-perceptual", M("PREFERENCES_INTENT_PERCEPTUAL"));
aRendIntent->addEntry("intent-relative", M("PREFERENCES_INTENT_RELATIVE"));
aRendIntent->addEntry("intent-saturation", M("PREFERENCES_INTENT_SATURATION"));
aRendIntent->addEntry("intent-absolute", M("PREFERENCES_INTENT_ABSOLUTE"));
aRendIntent->setSelected(1);
aRendIntent->show();
riaHBox->pack_start(*aRendIntent->buttonGroup, Gtk::PACK_EXPAND_PADDING);
@@ -417,10 +417,10 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha
Gtk::Label* outputIntentLbl = Gtk::manage(new Gtk::Label(M("TP_ICM_PROFILEINTENT")));
riHBox->pack_start(*outputIntentLbl, Gtk::PACK_SHRINK);
oRendIntent.reset(new PopUpButton());
oRendIntent->addEntry("intent-perceptual.png", M("PREFERENCES_INTENT_PERCEPTUAL"));
oRendIntent->addEntry("intent-relative.png", M("PREFERENCES_INTENT_RELATIVE"));
oRendIntent->addEntry("intent-saturation.png", M("PREFERENCES_INTENT_SATURATION"));
oRendIntent->addEntry("intent-absolute.png", M("PREFERENCES_INTENT_ABSOLUTE"));
oRendIntent->addEntry("intent-perceptual", M("PREFERENCES_INTENT_PERCEPTUAL"));
oRendIntent->addEntry("intent-relative", M("PREFERENCES_INTENT_RELATIVE"));
oRendIntent->addEntry("intent-saturation", M("PREFERENCES_INTENT_SATURATION"));
oRendIntent->addEntry("intent-absolute", M("PREFERENCES_INTENT_ABSOLUTE"));
oRendIntent->setSelected(1);
oRendIntent->show();
riHBox->pack_start(*oRendIntent->buttonGroup, Gtk::PACK_EXPAND_PADDING);
@@ -1671,8 +1671,8 @@ void ICMPanel::wprimChanged()
break;
}
}
if (ColorManagementParams::Primaries(wprim->get_active_row_number()) == ColorManagementParams::Primaries::DEFAULT) {
if (wProfNames->get_active_text() == "Rec2020") {
redx->setValue(0.708);
@@ -1776,7 +1776,7 @@ void ICMPanel::wprimChanged()
labgridcie->set_sensitive(false);
will->set_sensitive(true);
}
}
willChanged ();
@@ -2156,9 +2156,9 @@ void ICMPanel::setBatchMode(bool batchMode)
iVBox->reorder_child(*iunchanged, 5);
removeIfThere(this, saveRef);
oProfNames->append(M("GENERAL_UNCHANGED"));
oRendIntent->addEntry("template-24.png", M("GENERAL_UNCHANGED"));
oRendIntent->addEntry("template-24", M("GENERAL_UNCHANGED"));
oRendIntent->show();
aRendIntent->addEntry("template-24.png", M("GENERAL_UNCHANGED"));
aRendIntent->addEntry("template-24", M("GENERAL_UNCHANGED"));
aRendIntent->show();
wProfNames->append(M("GENERAL_UNCHANGED"));
wTRC->append(M("GENERAL_UNCHANGED"));