Bugfix and cleanup

See issue #3547
This commit is contained in:
Hombre57
2018-12-14 01:05:11 +01:00
parent 8728142b64
commit 7e01976ab2
4 changed files with 5 additions and 12 deletions

View File

@@ -56,7 +56,7 @@ void CursorManager::init (Glib::RefPtr<Gdk::Window> mainWindow)
Glib::RefPtr<Gdk::Pixbuf> rotate = RTImage::createPixbufFromFile("rotate-aroundnode-hicontrast.png"); Glib::RefPtr<Gdk::Pixbuf> rotate = RTImage::createPixbufFromFile("rotate-aroundnode-hicontrast.png");
Glib::RefPtr<Gdk::Pixbuf> wait = RTImage::createPixbufFromFile("gears.png"); // Currently unused, create *-hicontrast once used. Glib::RefPtr<Gdk::Pixbuf> wait = RTImage::createPixbufFromFile("gears.png"); // Currently unused, create *-hicontrast once used.
double s = RTScalable::getTweakedDPI() / 92.; // RTScalable::getDPI() might be preferable, however it imply a lot of work to support this option double s = RTScalable::getTweakedDPI() / 96.; // RTScalable::getDPI() might be preferable, however it imply a lot of work to support this option
cAdd = add ? Gdk::Cursor::create(display, add, (int)(8.*s), (int)(8.*s)) : Gdk::Cursor::create(display, Gdk::PLUS); cAdd = add ? Gdk::Cursor::create(display, add, (int)(8.*s), (int)(8.*s)) : Gdk::Cursor::create(display, Gdk::PLUS);
cAddPicker = colPickAdd ? Gdk::Cursor::create(display, colPickAdd, (int)(4.*s), (int)(21.*s)) : Gdk::Cursor::create(display, Gdk::PLUS); cAddPicker = colPickAdd ? Gdk::Cursor::create(display, colPickAdd, (int)(4.*s), (int)(21.*s)) : Gdk::Cursor::create(display, Gdk::PLUS);

View File

@@ -576,7 +576,7 @@ MyExpander::MyExpander(bool useEnabled, Gtk::Widget* titleWidget) :
setExpandAlignProperties(headerHBox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); setExpandAlignProperties(headerHBox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
if (useEnabled) { if (useEnabled) {
statusImage = Gtk::manage(new RTImage(*(disabledImage.get()))); statusImage = Gtk::manage(new RTImage(*(disabledImage.operator ->())));
imageEvBox = Gtk::manage(new Gtk::EventBox()); imageEvBox = Gtk::manage(new Gtk::EventBox());
imageEvBox->add(*statusImage); imageEvBox->add(*statusImage);
imageEvBox->set_above_child(true); imageEvBox->set_above_child(true);
@@ -585,7 +585,7 @@ MyExpander::MyExpander(bool useEnabled, Gtk::Widget* titleWidget) :
imageEvBox->signal_leave_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_enable), false ); imageEvBox->signal_leave_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_enable), false );
headerHBox->pack_start(*imageEvBox, Gtk::PACK_SHRINK, 0); headerHBox->pack_start(*imageEvBox, Gtk::PACK_SHRINK, 0);
} else { } else {
statusImage = Gtk::manage(new RTImage(*(openedImage.get()))); statusImage = Gtk::manage(new RTImage(*(openedImage.operator ->())));
headerHBox->pack_start(*statusImage, Gtk::PACK_SHRINK, 0); headerHBox->pack_start(*statusImage, Gtk::PACK_SHRINK, 0);
} }
@@ -629,7 +629,7 @@ MyExpander::MyExpander(bool useEnabled, Glib::ustring titleLabel) :
if (useEnabled) { if (useEnabled) {
statusImage = Gtk::manage(new RTImage(*(disabledImage.get()))); statusImage = Gtk::manage(new RTImage(*(disabledImage.operator ->())));
imageEvBox = Gtk::manage(new Gtk::EventBox()); imageEvBox = Gtk::manage(new Gtk::EventBox());
imageEvBox->set_name("MyExpanderStatus"); imageEvBox->set_name("MyExpanderStatus");
imageEvBox->add(*statusImage); imageEvBox->add(*statusImage);
@@ -639,7 +639,7 @@ MyExpander::MyExpander(bool useEnabled, Glib::ustring titleLabel) :
imageEvBox->signal_leave_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_enable), false ); imageEvBox->signal_leave_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_enable), false );
headerHBox->pack_start(*imageEvBox, Gtk::PACK_SHRINK, 0); headerHBox->pack_start(*imageEvBox, Gtk::PACK_SHRINK, 0);
} else { } else {
statusImage = Gtk::manage(new RTImage(*(openedImage.get()))); statusImage = Gtk::manage(new RTImage(*(openedImage.operator ->())));
headerHBox->pack_start(*statusImage, Gtk::PACK_SHRINK, 0); headerHBox->pack_start(*statusImage, Gtk::PACK_SHRINK, 0);
} }
@@ -1457,7 +1457,6 @@ TextOrIcon::TextOrIcon (const Glib::ustring &fname, const Glib::ustring &labelTx
{ {
RTImage *img = Gtk::manage(new RTImage(fname)); RTImage *img = Gtk::manage(new RTImage(fname));
printf(">>> TOI \"%s\" : %d x %d\n", fname.c_str(), img->get_width(), img->get_height());
pack_start(*img, Gtk::PACK_SHRINK, 0); pack_start(*img, Gtk::PACK_SHRINK, 0);
set_tooltip_markup("<span font_size=\"large\" font_weight=\"bold\">" + labelTx + "</span>\n" + tooltipTx); set_tooltip_markup("<span font_size=\"large\" font_weight=\"bold\">" + labelTx + "</span>\n" + tooltipTx);

View File

@@ -201,9 +201,7 @@ RTWindow::RTWindow ()
fpanelLabelGrid->attach_next_to (*folderIcon, Gtk::POS_TOP, 1, 1); fpanelLabelGrid->attach_next_to (*folderIcon, Gtk::POS_TOP, 1, 1);
fpanelLabelGrid->attach_next_to (*fpl, Gtk::POS_TOP, 1, 1); fpanelLabelGrid->attach_next_to (*fpl, Gtk::POS_TOP, 1, 1);
} else { } else {
printf("---------------- folder-closed\n");
RTImage* folderIcon = Gtk::manage (new RTImage ("folder-closed.png")); RTImage* folderIcon = Gtk::manage (new RTImage ("folder-closed.png"));
printf("---------------- folder-closed : %dx%d\n", folderIcon->get_width(), folderIcon->get_height());
fpanelLabelGrid->attach_next_to (*folderIcon, Gtk::POS_RIGHT, 1, 1); fpanelLabelGrid->attach_next_to (*folderIcon, Gtk::POS_RIGHT, 1, 1);
fpanelLabelGrid->attach_next_to (*fpl, Gtk::POS_RIGHT, 1, 1); fpanelLabelGrid->attach_next_to (*fpl, Gtk::POS_RIGHT, 1, 1);
} }
@@ -405,9 +403,7 @@ bool RTWindow::on_configure_event (GdkEventConfigure* event)
get_position (options.windowX, options.windowY); get_position (options.windowX, options.windowY);
} }
printf("RTWindow::on_configure_event : May update the RTImage and RTSurface\n");
int newScale = scale; int newScale = scale;
printf("********** scale = %d / get_window()->get_scale_factor() = %d\n", scale, get_window()->get_scale_factor());
double newDPI = get_window()->get_screen()->get_resolution(); double newDPI = get_window()->get_screen()->get_resolution();
RTImage::setDPInScale(newDPI, newScale); // will update the RTImage on scale/resolution change RTImage::setDPInScale(newDPI, newScale); // will update the RTImage on scale/resolution change
RTSurface::setDPInScale(newDPI, newScale); // will update the RTSurface on scale/resolution change RTSurface::setDPInScale(newDPI, newScale); // will update the RTSurface on scale/resolution change

View File

@@ -701,8 +701,6 @@ void ThumbBrowserBase::enableInspector()
bool ThumbBrowserBase::Internal::on_configure_event(GdkEventConfigure *configure_event) bool ThumbBrowserBase::Internal::on_configure_event(GdkEventConfigure *configure_event)
{ {
double resolution = get_window()->get_screen()->get_resolution(); double resolution = get_window()->get_screen()->get_resolution();
printf("ThumbBrowserBase::Internal::on_configure_event / Scale:%d StyleScale:%d X:%d Y:%d W:%d H:%d / DPI: %.3f\n",
get_scale_factor(), get_style_context()->get_scale(), configure_event->x, configure_event->y, configure_event->width, configure_event->height, (float)resolution);
return true; return true;
} }