Histogram and Navigator now handle Hi-DPI.
+ widgets are now sized depending on Hi-DPI see issue #3547
This commit is contained in:
@@ -513,7 +513,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel)
|
||||
//leftsubbox->pack_start (*ppframe, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
navigator = Gtk::manage (new Navigator ());
|
||||
navigator->previewWindow->set_size_request (-1, 150);
|
||||
navigator->previewWindow->set_size_request (-1, 150 * RTScalable::getScale());
|
||||
leftsubbox->pack_start (*navigator, Gtk::PACK_SHRINK, 2);
|
||||
|
||||
history = Gtk::manage (new History ());
|
||||
|
@@ -1001,14 +1001,19 @@ bool MyScrolledWindow::on_scroll_event (GdkEventScroll* event)
|
||||
return true;
|
||||
}
|
||||
|
||||
void MyScrolledWindow::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
natural_width = minimum_width = 100 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void MyScrolledWindow::get_preferred_height_vfunc (int &minimum_height, int &natural_height) const
|
||||
{
|
||||
natural_height = minimum_height = 50;
|
||||
natural_height = minimum_height = 50 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void MyScrolledWindow::get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const
|
||||
{
|
||||
natural_height = minimum_height = 50;
|
||||
natural_height = minimum_height = 50 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1068,11 +1073,11 @@ bool MyScrolledToolbar::on_scroll_event (GdkEventScroll* event)
|
||||
return true;
|
||||
}
|
||||
|
||||
void MyScrolledToolbar::get_preferred_height (int &minimumHeight, int &naturalHeight)
|
||||
void MyScrolledToolbar::get_preferred_height_vfunc (int &minimumHeight, int &naturalHeight) const
|
||||
{
|
||||
int currMinHeight = 0;
|
||||
int currNatHeight = 0;
|
||||
std::vector<Widget*> childs = get_children();
|
||||
std::vector<const Widget*> childs = get_children();
|
||||
minimumHeight = naturalHeight = 0;
|
||||
|
||||
for (auto child : childs)
|
||||
@@ -1111,7 +1116,7 @@ bool MyComboBoxText::on_scroll_event (GdkEventScroll* event)
|
||||
void MyComboBoxText::setPreferredWidth (int minimum_width, int natural_width)
|
||||
{
|
||||
if (natural_width == -1 && minimum_width == -1) {
|
||||
naturalWidth = minimumWidth = 70;
|
||||
naturalWidth = minimumWidth = 70 * RTScalable::getScale();
|
||||
} else if (natural_width == -1) {
|
||||
naturalWidth = minimumWidth = minimum_width;
|
||||
} else if (minimum_width == -1) {
|
||||
@@ -1126,19 +1131,19 @@ void MyComboBoxText::setPreferredWidth (int minimum_width, int natural_width)
|
||||
|
||||
void MyComboBoxText::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
natural_width = rtengine::max(naturalWidth, 10);
|
||||
minimum_width = rtengine::max(minimumWidth, 10);
|
||||
natural_width = rtengine::max(naturalWidth, 10 * RTScalable::getScale());
|
||||
minimum_width = rtengine::max(minimumWidth, 10 * RTScalable::getScale());
|
||||
}
|
||||
void MyComboBoxText::get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const
|
||||
{
|
||||
natural_width = rtengine::max(naturalWidth, 10);
|
||||
minimum_width = rtengine::max(minimumWidth, 10);
|
||||
natural_width = rtengine::max(naturalWidth, 10 * RTScalable::getScale());
|
||||
minimum_width = rtengine::max(minimumWidth, 10 * RTScalable::getScale());
|
||||
}
|
||||
|
||||
|
||||
MyComboBox::MyComboBox ()
|
||||
{
|
||||
minimumWidth = naturalWidth = 70;
|
||||
minimumWidth = naturalWidth = 70 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
bool MyComboBox::on_scroll_event (GdkEventScroll* event)
|
||||
@@ -1157,7 +1162,7 @@ bool MyComboBox::on_scroll_event (GdkEventScroll* event)
|
||||
void MyComboBox::setPreferredWidth (int minimum_width, int natural_width)
|
||||
{
|
||||
if (natural_width == -1 && minimum_width == -1) {
|
||||
naturalWidth = minimumWidth = 70;
|
||||
naturalWidth = minimumWidth = 70 * RTScalable::getScale();
|
||||
} else if (natural_width == -1) {
|
||||
naturalWidth = minimumWidth = minimum_width;
|
||||
} else if (minimum_width == -1) {
|
||||
@@ -1172,13 +1177,13 @@ void MyComboBox::setPreferredWidth (int minimum_width, int natural_width)
|
||||
|
||||
void MyComboBox::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
natural_width = rtengine::max(naturalWidth, 10);
|
||||
minimum_width = rtengine::max(minimumWidth, 10);
|
||||
natural_width = rtengine::max(naturalWidth, 10 * RTScalable::getScale());
|
||||
minimum_width = rtengine::max(minimumWidth, 10 * RTScalable::getScale());
|
||||
}
|
||||
void MyComboBox::get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const
|
||||
{
|
||||
natural_width = rtengine::max(naturalWidth, 10);
|
||||
minimum_width = rtengine::max(minimumWidth, 10);
|
||||
natural_width = rtengine::max(naturalWidth, 10 * RTScalable::getScale());
|
||||
minimum_width = rtengine::max(minimumWidth, 10 * RTScalable::getScale());
|
||||
}
|
||||
|
||||
MySpinButton::MySpinButton ()
|
||||
@@ -1463,11 +1468,11 @@ bool MyFileChooserButton::on_scroll_event (GdkEventScroll* event)
|
||||
|
||||
void MyFileChooserButton::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
minimum_width = natural_width = 35;
|
||||
minimum_width = natural_width = 35 * RTScalable::getScale();
|
||||
}
|
||||
void MyFileChooserButton::get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const
|
||||
{
|
||||
minimum_width = natural_width = 35;
|
||||
minimum_width = natural_width = 35 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
|
||||
@@ -1513,18 +1518,18 @@ const Gtk::Label* MyImageMenuItem::getLabel () const
|
||||
return label;
|
||||
}
|
||||
|
||||
MyProgressBar::MyProgressBar(int width) : w(rtengine::max(width, 10)) {}
|
||||
MyProgressBar::MyProgressBar() : w(200) {}
|
||||
MyProgressBar::MyProgressBar(int width) : w(rtengine::max(width, 10 * RTScalable::getScale())) {}
|
||||
MyProgressBar::MyProgressBar() : w(200 * RTScalable::getScale()) {}
|
||||
|
||||
void MyProgressBar::setPreferredWidth(int width)
|
||||
{
|
||||
w = rtengine::max(width, 10);
|
||||
w = rtengine::max(width, 10 * RTScalable::getScale());
|
||||
}
|
||||
|
||||
void MyProgressBar::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
minimum_width = rtengine::max(w / 2, 50);
|
||||
natural_width = rtengine::max(w, 50);
|
||||
minimum_width = rtengine::max(w / 2, 50 * RTScalable::getScale());
|
||||
natural_width = rtengine::max(w, 50 * RTScalable::getScale());
|
||||
}
|
||||
|
||||
void MyProgressBar::get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const
|
||||
|
@@ -287,6 +287,7 @@ class MyScrolledWindow : public Gtk::ScrolledWindow
|
||||
{
|
||||
|
||||
bool on_scroll_event (GdkEventScroll* event) override;
|
||||
void get_preferred_width_vfunc (int& minimum_width, int& natural_width) const override;
|
||||
void get_preferred_height_vfunc (int& minimum_height, int& natural_height) const override;
|
||||
void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const override;
|
||||
|
||||
@@ -301,7 +302,7 @@ class MyScrolledToolbar : public Gtk::ScrolledWindow
|
||||
{
|
||||
|
||||
bool on_scroll_event (GdkEventScroll* event) override;
|
||||
void get_preferred_height (int &minimumHeight, int &naturalHeight);
|
||||
void get_preferred_height_vfunc (int& minimum_height, int& natural_height) const override;
|
||||
|
||||
public:
|
||||
MyScrolledToolbar();
|
||||
|
@@ -412,18 +412,20 @@ void HistogramRGBArea::get_preferred_height_vfunc (int &minimum_height, int &nat
|
||||
|
||||
void HistogramRGBArea::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
minimum_width = 60;
|
||||
natural_width = 200;
|
||||
minimum_width = 60 * RTScalable::getScale();
|
||||
natural_width = 200 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void HistogramRGBArea::get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const
|
||||
{
|
||||
int bHeight = width / 30;
|
||||
|
||||
if (bHeight > 10) {
|
||||
bHeight = 10;
|
||||
} else if (bHeight < 5) {
|
||||
bHeight = 5;
|
||||
int s = RTScalable::getScale();
|
||||
|
||||
if (bHeight > (10 * s)) {
|
||||
bHeight = 10 * s;
|
||||
} else if (bHeight < (5 * s)) {
|
||||
bHeight = 5 * s;
|
||||
}
|
||||
|
||||
minimum_height = bHeight;
|
||||
@@ -454,6 +456,8 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustrin
|
||||
int winx, winy, winw, winh;
|
||||
window->get_geometry(winx, winy, winw, winh);
|
||||
|
||||
double s = RTScalable::getScale();
|
||||
|
||||
// This will create or update the size of the BackBuffer::surface
|
||||
setDrawRectangle(Cairo::FORMAT_ARGB32, 0, 0, winw, winh, true);
|
||||
|
||||
@@ -467,18 +471,18 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustrin
|
||||
cc->set_operator (Cairo::OPERATOR_OVER);
|
||||
|
||||
cc->set_antialias(Cairo::ANTIALIAS_NONE);
|
||||
cc->set_line_width (1.0);
|
||||
cc->set_line_width (1.0 * s);
|
||||
|
||||
if ( r != -1 && g != -1 && b != -1 ) {
|
||||
if (needRed) {
|
||||
// Red
|
||||
cc->set_source_rgb(1.0, 0.0, 0.0);
|
||||
if (options.histogramDrawMode < 2) {
|
||||
cc->move_to(r * (winw - 3) / 255.0 + 2, 0); // Rescaling seems needed to fit between boundaries of draw area
|
||||
cc->line_to(r * (winw - 3) / 255.0 + 2, winh - 0);
|
||||
cc->move_to(r * (winw - 1.) / 255.0 + 0.5*s, 0); // Rescaling seems needed to fit between boundaries of draw area
|
||||
cc->line_to(r * (winw - 1.) / 255.0 + 0.5*s, winh - 0);
|
||||
} else {
|
||||
cc->move_to(HistogramScaling::log (255, r) * (winw - 3) / 255.0 + 2, 0);
|
||||
cc->line_to(HistogramScaling::log (255, r) * (winw - 3) / 255.0 + 2, winh - 0);
|
||||
cc->move_to(HistogramScaling::log (255, r) * (winw - 1.*s) / 255.0 + 0.5*s, 0);
|
||||
cc->line_to(HistogramScaling::log (255, r) * (winw - 1.*s) / 255.0 + 0.5*s, winh - 0);
|
||||
}
|
||||
cc->stroke();
|
||||
}
|
||||
@@ -487,11 +491,11 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustrin
|
||||
// Green
|
||||
cc->set_source_rgb(0.0, 1.0, 0.0);
|
||||
if (options.histogramDrawMode < 2) {
|
||||
cc->move_to(g * (winw - 3) / 255.0 + 2, 0);
|
||||
cc->line_to(g * (winw - 3) / 255.0 + 2, winh - 0);
|
||||
cc->move_to(g * (winw - 1.) / 255.0 + 0.5*s, 0);
|
||||
cc->line_to(g * (winw - 1.) / 255.0 + 0.5*s, winh - 0);
|
||||
} else {
|
||||
cc->move_to(HistogramScaling::log (255, g) * (winw - 3) / 255.0 + 2, 0);
|
||||
cc->line_to(HistogramScaling::log (255, g) * (winw - 3) / 255.0 + 2, winh - 0);
|
||||
cc->move_to(HistogramScaling::log (255, g) * (winw - 1.) / 255.0 + 0.5*s, 0);
|
||||
cc->line_to(HistogramScaling::log (255, g) * (winw - 1.) / 255.0 + 0.5*s, winh - 0);
|
||||
}
|
||||
cc->stroke();
|
||||
}
|
||||
@@ -500,11 +504,11 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustrin
|
||||
// Blue
|
||||
cc->set_source_rgb(0.0, 0.0, 1.0);
|
||||
if (options.histogramDrawMode < 2) {
|
||||
cc->move_to(b * (winw - 3) / 255.0 + 2, 0);
|
||||
cc->line_to(b * (winw - 3) / 255.0 + 2, winh - 0);
|
||||
cc->move_to(b * (winw - 1.) / 255.0 + 0.5*s, 0);
|
||||
cc->line_to(b * (winw - 1.) / 255.0 + 0.5*s, winh - 0);
|
||||
} else {
|
||||
cc->move_to(HistogramScaling::log (255, b) * (winw - 3) / 255.0 + 2, 0);
|
||||
cc->line_to(HistogramScaling::log (255, b) * (winw - 3) / 255.0 + 2, winh - 0);
|
||||
cc->move_to(HistogramScaling::log (255, b) * (winw - 1.) / 255.0 + 0.5*s, 0);
|
||||
cc->line_to(HistogramScaling::log (255, b) * (winw - 1.) / 255.0 + 0.5*s, winh - 0);
|
||||
}
|
||||
cc->stroke();
|
||||
}
|
||||
@@ -517,11 +521,11 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustrin
|
||||
// Luma
|
||||
cc->set_source_rgb(1.0, 1.0, 1.0);
|
||||
if (options.histogramDrawMode < 2) {
|
||||
cc->move_to(Lab_L * (winw - 3) / 100.0 + 2, 0);
|
||||
cc->line_to(Lab_L * (winw - 3) / 100.0 + 2, winh - 0);
|
||||
cc->move_to(Lab_L * (winw - 3.*s) / 100.0 + 0.5*s, 0);
|
||||
cc->line_to(Lab_L * (winw - 3.*s) / 100.0 + 0.5*s, winh - 0);
|
||||
} else {
|
||||
cc->move_to(HistogramScaling::log (100, Lab_L) * (winw - 3) / 100.0 + 2, 0);
|
||||
cc->line_to(HistogramScaling::log (100, Lab_L) * (winw - 3) / 100.0 + 2, winh - 0);
|
||||
cc->move_to(HistogramScaling::log (100, Lab_L) * (winw - 1.) / 100.0 + 0.5*s, 0);
|
||||
cc->line_to(HistogramScaling::log (100, Lab_L) * (winw - 1.) / 100.0 + 0.5*s, winh - 0);
|
||||
}
|
||||
cc->stroke();
|
||||
}
|
||||
@@ -532,11 +536,11 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustrin
|
||||
// float chromaval = sqrt(Lab_a*Lab_a + Lab_b*Lab_b);
|
||||
cc->set_source_rgb(0.9, 0.9, 0.0);
|
||||
if (options.histogramDrawMode < 2) {
|
||||
cc->move_to(chromaval * (winw - 3) / 100.0 + 2, 0);
|
||||
cc->line_to(chromaval * (winw - 3) / 100.0 + 2, winh - 0);
|
||||
cc->move_to(chromaval * (winw - 1.) / 100.0 + 0.5*s, 0);
|
||||
cc->line_to(chromaval * (winw - 1.) / 100.0 + 0.5*s, winh - 0);
|
||||
} else {
|
||||
cc->move_to(HistogramScaling::log (100, chromaval) * (winw - 3) / 100.0 + 2, 0);
|
||||
cc->line_to(HistogramScaling::log (100, chromaval) * (winw - 3) / 100.0 + 2, winh - 0);
|
||||
cc->move_to(HistogramScaling::log (100, chromaval) * (winw - 1.) / 100.0 + 0.5*s, 0);
|
||||
cc->line_to(HistogramScaling::log (100, chromaval) * (winw - 1.) / 100.0 + 0.5*s, winh - 0);
|
||||
}
|
||||
cc->stroke();
|
||||
}
|
||||
@@ -697,15 +701,15 @@ Gtk::SizeRequestMode HistogramArea::get_request_mode_vfunc () const
|
||||
void HistogramArea::get_preferred_height_vfunc (int &minimum_height, int &natural_height) const
|
||||
{
|
||||
|
||||
minimum_height = 100;
|
||||
natural_height = 200;
|
||||
minimum_height = 100 * RTScalable::getScale();
|
||||
natural_height = 200 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void HistogramArea::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
|
||||
minimum_width = 200;
|
||||
natural_width = 400;
|
||||
minimum_width = 200 * RTScalable::getScale();
|
||||
natural_width = 400 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void HistogramArea::get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const
|
||||
@@ -803,6 +807,8 @@ void HistogramArea::updateBackBuffer ()
|
||||
Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create(surface);
|
||||
const Glib::RefPtr<Gtk::StyleContext> style = get_style_context();
|
||||
|
||||
double s = RTScalable::getScale();
|
||||
|
||||
// Setup drawing
|
||||
cr->set_source_rgba (0., 0., 0., 0.);
|
||||
cr->set_operator (Cairo::OPERATOR_CLEAR);
|
||||
@@ -811,9 +817,10 @@ void HistogramArea::updateBackBuffer ()
|
||||
|
||||
// Prepare drawing gridlines first
|
||||
cr->set_source_rgba (1., 1., 1., 0.25);
|
||||
cr->set_line_width (1.0);
|
||||
cr->set_line_width (1.0 * s);
|
||||
cr->set_antialias(Cairo::ANTIALIAS_NONE);
|
||||
cr->set_line_join(Cairo::LINE_JOIN_MITER);
|
||||
cr->set_line_cap(Cairo::LINE_CAP_BUTT);
|
||||
std::valarray<double> ch_ds (1);
|
||||
ch_ds[0] = 4;
|
||||
cr->set_dash (ch_ds, 0);
|
||||
@@ -825,14 +832,14 @@ void HistogramArea::updateBackBuffer ()
|
||||
// draw vertical gridlines
|
||||
if (options.histogramDrawMode < 2) {
|
||||
for (int i = 1; i < nrOfVGridPartitions; i++) {
|
||||
cr->move_to ((pow(2.0,i) - 1) / 255.0 * w + 0.5, 1.5);
|
||||
cr->line_to ((pow(2.0,i) - 1) / 255.0 * w + 0.5, h - 2);
|
||||
cr->move_to ((pow(2.0,i) - 1) / 255.0 * w + 0.5, 0.);
|
||||
cr->line_to ((pow(2.0,i) - 1) / 255.0 * w + 0.5, h);
|
||||
cr->stroke ();
|
||||
}
|
||||
} else {
|
||||
for (int i = 1; i < nrOfVGridPartitions; i++) {
|
||||
cr->move_to (HistogramScaling::log (255, pow(2.0,i) - 1) / 255.0 * w + 0.5, 1.5);
|
||||
cr->line_to (HistogramScaling::log (255, pow(2.0,i) - 1) / 255.0 * w + 0.5, h - 2);
|
||||
cr->move_to (HistogramScaling::log (255, pow(2.0,i) - 1) / 255.0 * w + 0.5, 0.);
|
||||
cr->line_to (HistogramScaling::log (255, pow(2.0,i) - 1) / 255.0 * w + 0.5, h);
|
||||
cr->stroke ();
|
||||
}
|
||||
}
|
||||
@@ -840,14 +847,14 @@ void HistogramArea::updateBackBuffer ()
|
||||
// draw horizontal gridlines
|
||||
if (options.histogramDrawMode == 0) {
|
||||
for (int i = 1; i < nrOfHGridPartitions; i++) {
|
||||
cr->move_to (1.5, i * (double)h / nrOfHGridPartitions + 0.5);
|
||||
cr->line_to (w - 2, i * (double)h / nrOfHGridPartitions + 0.5);
|
||||
cr->move_to (0., i * (double)h / nrOfHGridPartitions + 0.5);
|
||||
cr->line_to (w, i * (double)h / nrOfHGridPartitions + 0.5);
|
||||
cr->stroke ();
|
||||
}
|
||||
} else {
|
||||
for (int i = 1; i < nrOfHGridPartitions; i++) {
|
||||
cr->move_to (1.5, h - HistogramScaling::log (h, i * (double)h / nrOfHGridPartitions) + 0.5);
|
||||
cr->line_to (w - 2, h - HistogramScaling::log (h, i * (double)h / nrOfHGridPartitions) + 0.5);
|
||||
cr->move_to (0., h - HistogramScaling::log (h, i * (double)h / nrOfHGridPartitions) + 0.5*s);
|
||||
cr->line_to (w, h - HistogramScaling::log (h, i * (double)h / nrOfHGridPartitions) + 0.5*s);
|
||||
cr->stroke ();
|
||||
}
|
||||
}
|
||||
@@ -921,7 +928,8 @@ void HistogramArea::updateBackBuffer ()
|
||||
}
|
||||
|
||||
cr->set_antialias (Cairo::ANTIALIAS_SUBPIXEL);
|
||||
cr->set_line_width (1.0);
|
||||
cr->set_line_width (1.0 * s);
|
||||
//cr->set_line_cap(Cairo::LINE_CAP_SQUARE);
|
||||
cr->set_operator (Cairo::OPERATOR_OVER);
|
||||
|
||||
int ui = 0, oi = 0;
|
||||
@@ -983,6 +991,8 @@ void HistogramArea::on_realize ()
|
||||
void HistogramArea::drawCurve(Cairo::RefPtr<Cairo::Context> &cr,
|
||||
LUTu & data, double scale, int hsize, int vsize)
|
||||
{
|
||||
double s = RTScalable::getScale();
|
||||
|
||||
cr->move_to (0, vsize - 1);
|
||||
scale = scale <= 0.f ? 0.001f : scale; // avoid division by zero and negative values
|
||||
|
||||
@@ -1010,7 +1020,7 @@ void HistogramArea::drawCurve(Cairo::RefPtr<Cairo::Context> &cr,
|
||||
void HistogramArea::drawMarks(Cairo::RefPtr<Cairo::Context> &cr,
|
||||
LUTu & data, double scale, int hsize, int & ui, int & oi)
|
||||
{
|
||||
int s = 8;
|
||||
int s = 8 * RTScalable::getScale();
|
||||
|
||||
if(data[0] > scale) {
|
||||
cr->rectangle(0, (ui++)*s, s, s);
|
||||
|
@@ -759,14 +759,14 @@ Gtk::SizeRequestMode ImageArea::get_request_mode_vfunc () const
|
||||
|
||||
void ImageArea::get_preferred_height_vfunc (int &minimum_height, int &natural_height) const
|
||||
{
|
||||
minimum_height= 50;
|
||||
natural_height = 300;
|
||||
minimum_height= 50 * RTScalable::getScale();
|
||||
natural_height = 300 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void ImageArea::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
minimum_width = 100;
|
||||
natural_width = 400;
|
||||
minimum_width = 100 * RTScalable::getScale();
|
||||
natural_width = 400 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void ImageArea::get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const
|
||||
|
@@ -323,14 +323,14 @@ Gtk::SizeRequestMode Inspector::get_request_mode_vfunc () const
|
||||
|
||||
void Inspector::get_preferred_height_vfunc (int &minimum_height, int &natural_height) const
|
||||
{
|
||||
minimum_height= 50;
|
||||
natural_height = 300;
|
||||
minimum_height= 50 * RTScalable::getScale();
|
||||
natural_height = 300 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void Inspector::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
minimum_width = 50;
|
||||
natural_width = 200;
|
||||
minimum_width = 50 * RTScalable::getScale();
|
||||
natural_width = 200 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void Inspector::get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const
|
||||
|
@@ -152,6 +152,7 @@ bool PreviewWindow::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
|
||||
int x, y, w, h;
|
||||
getObservedFrameArea (x, y, w, h);
|
||||
if (x>imgX || y>imgY || w < imgW || h < imgH) {
|
||||
double s = RTScalable::getScale();
|
||||
double rectX = x + 0.5;
|
||||
double rectY = y + 0.5;
|
||||
double rectW = std::min(w, (int)(imgW - (x - imgX) - 1));
|
||||
@@ -159,9 +160,9 @@ bool PreviewWindow::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
|
||||
|
||||
// draw a black "shadow" line
|
||||
cr->set_source_rgba (0.0, 0.0, 0.0, 0.65);
|
||||
cr->set_line_width (1.);
|
||||
cr->set_line_width (1. * s);
|
||||
cr->set_line_join(Cairo::LINE_JOIN_MITER);
|
||||
cr->rectangle (rectX + 1., rectY + 1, rectW, rectH);
|
||||
cr->rectangle (rectX + 1. * s, rectY + 1. * s, rectW - 2. * s, rectH - 2. * s);
|
||||
cr->stroke ();
|
||||
|
||||
// draw a "frame" line. Color of frame line can be set in preferences
|
||||
@@ -302,14 +303,14 @@ Gtk::SizeRequestMode PreviewWindow::get_request_mode_vfunc () const
|
||||
|
||||
void PreviewWindow::get_preferred_height_vfunc (int &minimum_height, int &natural_height) const
|
||||
{
|
||||
minimum_height= 50;
|
||||
natural_height = 100;
|
||||
minimum_height= 50 * RTScalable::getScale();
|
||||
natural_height = 100 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void PreviewWindow::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
minimum_width = 80;
|
||||
natural_width = 120;
|
||||
minimum_width = 80 * RTScalable::getScale();
|
||||
natural_width = 120 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void PreviewWindow::get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const
|
||||
|
@@ -76,12 +76,12 @@ Gtk::SizeRequestMode SplashImage::get_request_mode_vfunc () const
|
||||
|
||||
void SplashImage::get_preferred_height_vfunc (int &minimum_height, int &natural_height) const
|
||||
{
|
||||
minimum_height = natural_height = surface ? surface->get_height() : 100;
|
||||
minimum_height = natural_height = surface ? surface->get_height() : 100 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void SplashImage::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
minimum_width = natural_width = surface ? surface->get_width() : 100;
|
||||
minimum_width = natural_width = surface ? surface->get_width() : 100 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void SplashImage::get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const
|
||||
|
@@ -905,14 +905,14 @@ Gtk::SizeRequestMode ThumbBrowserBase::Internal::get_request_mode_vfunc () const
|
||||
|
||||
void ThumbBrowserBase::Internal::get_preferred_height_vfunc (int &minimum_height, int &natural_height) const
|
||||
{
|
||||
minimum_height = 20;
|
||||
natural_height = 80;
|
||||
minimum_height = 20 * RTScalable::getScale();
|
||||
natural_height = 80 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void ThumbBrowserBase::Internal::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
minimum_width = 200;
|
||||
natural_width = 1000;
|
||||
minimum_width = 200 * RTScalable::getScale();
|
||||
natural_width = 1000 * RTScalable::getScale();
|
||||
}
|
||||
|
||||
void ThumbBrowserBase::Internal::get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const
|
||||
|
Reference in New Issue
Block a user