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

@@ -92,14 +92,14 @@ ControlLineManager::ControlLineManager():
canvas_area->topLeft = Coord(0, 0);
mouseOverGeometry.push_back(canvas_area.get());
line_icon_h = Cairo::RefPtr<RTSurface>(new RTSurface(
"bidirectional-arrow-horizontal-hicontrast.png"));
line_icon_v = Cairo::RefPtr<RTSurface>(new RTSurface(
"bidirectional-arrow-vertical-hicontrast.png"));
line_icon_h_prelight = Cairo::RefPtr<RTSurface>(new RTSurface(
"bidirectional-arrow-horizontal-prelight.png"));
line_icon_v_prelight = Cairo::RefPtr<RTSurface>(new RTSurface(
"bidirectional-arrow-vertical-prelight.png"));
line_icon_h = std::shared_ptr<RTSurface>(new RTSurface(
"bidirectional-arrow-horizontal-hicontrast", Gtk::ICON_SIZE_BUTTON));
line_icon_v = std::shared_ptr<RTSurface>(new RTSurface(
"bidirectional-arrow-vertical-hicontrast", Gtk::ICON_SIZE_BUTTON));
line_icon_h_prelight = std::shared_ptr<RTSurface>(new RTSurface(
"bidirectional-arrow-horizontal-prelight", Gtk::ICON_SIZE_BUTTON));
line_icon_v_prelight = std::shared_ptr<RTSurface>(new RTSurface(
"bidirectional-arrow-vertical-prelight", Gtk::ICON_SIZE_BUTTON));
}
ControlLineManager::~ControlLineManager() = default;
@@ -438,8 +438,8 @@ void ControlLineManager::addLine(Coord begin, Coord end,
line->begin = begin;
line->end = end;
const Cairo::RefPtr<RTSurface> null_surface =
Cairo::RefPtr<RTSurface>(nullptr);
const std::shared_ptr<RTSurface> null_surface =
std::shared_ptr<RTSurface>(nullptr);
icon_h = std::make_shared<OPIcon>(line_icon_h, null_surface,
line_icon_h_prelight,