diff --git a/backend/wbprivate/workbench/home_screen_connections.cpp b/backend/wbprivate/workbench/home_screen_connections.cpp index d471ab27e..7884fda82 100644 --- a/backend/wbprivate/workbench/home_screen_connections.cpp +++ b/backend/wbprivate/workbench/home_screen_connections.cpp @@ -287,9 +287,9 @@ class wb::ConnectionInfoPopup : public mforms::Popup cairo_select_font_face(cr, HOME_DETAILS_FONT, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, HOME_DETAILS_FONT_SIZE); if (is_fabric) - print_fabric_details_text(cr, content_bounds); + print_fabric_details_text(cr, content_bounds); else - print_details_text(cr, content_bounds); + print_details_text(cr, content_bounds); // Buttons at the bottom. base::Point position = base::Point(content_bounds.left(), content_bounds.bottom() - POPUP_BUTTON_HEIGHT); @@ -1389,7 +1389,7 @@ ConnectionsSection::ConnectionsSection(HomeScreen *owner) _mouse_over_icon = mforms::Utilities::load_icon("wb_tile_mouseover.png"); _mouse_over2_icon = mforms::Utilities::load_icon("wb_tile_mouseover_2.png"); _network_icon = mforms::Utilities::load_icon("wb_tile_network.png"); - // TODO: We need an tile icon for the group filter and the status + // TODO: We need a tile icon for the group filter and the status. _ha_filter_icon = mforms::Utilities::load_icon("wb_tile_network.png"); _managed_status_icon = mforms::Utilities::load_icon("wb_tile_network.png"); _page_down_icon = mforms::Utilities::load_icon("wb_tile_page-down.png"); @@ -1397,7 +1397,7 @@ ConnectionsSection::ConnectionsSection(HomeScreen *owner) _plus_icon = mforms::Utilities::load_icon("wb_tile_plus.png"); _sakila_icon = mforms::Utilities::load_icon("wb_tile_sakila.png"); _fabric_icon = mforms::Utilities::load_icon("wb_tile_fabric.png"); - _schema_icon = mforms::Utilities::load_icon("wb_tile_schema.png", true); + _schema_icon = mforms::Utilities::load_icon("wb_tile_schema.png"); _user_icon = mforms::Utilities::load_icon("wb_tile_user.png"); _manage_icon = mforms::Utilities::load_icon("wb_tile_manage.png"); diff --git a/images/home/wb_tile_fabric.png b/images/home/wb_tile_fabric.png index d2ef16b46..bfa1927c9 100644 Binary files a/images/home/wb_tile_fabric.png and b/images/home/wb_tile_fabric.png differ diff --git a/images/home/wb_tile_fabric@2x.png b/images/home/wb_tile_fabric@2x.png index d108b0c36..45fb10a2f 100644 Binary files a/images/home/wb_tile_fabric@2x.png and b/images/home/wb_tile_fabric@2x.png differ diff --git a/library/forms/mforms/utilities.h b/library/forms/mforms/utilities.h index 75f8e5e85..4ea2a8c5b 100644 --- a/library/forms/mforms/utilities.h +++ b/library/forms/mforms/utilities.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -322,7 +322,6 @@ namespace mforms { static std::string shorten_string(cairo_t* cr, const std::string& text, double width); - //XXX TODO Linux, Windows static double get_text_width(const std::string &text, const std::string &font); #endif diff --git a/library/forms/utilities.cpp b/library/forms/utilities.cpp index 47b684dec..e4d375b48 100644 --- a/library/forms/utilities.cpp +++ b/library/forms/utilities.cpp @@ -738,10 +738,15 @@ cairo_surface_t* Utilities::load_icon(const std::string& name, bool allow_hidpi) if (name.empty()) return NULL; +#ifdef __APPLE__ + allow_hidpi = true; // For OSX we always want hires images. +#endif + if (allow_hidpi && mforms::App::get()->backing_scale_factor() > 1.0) { std::string hidpi_name = base::strip_extension(name) + "@2x" + base::extension(name); - cairo_surface_t *tmp = load_icon(hidpi_name, false); + std::string icon_path = App::get()->get_resource_path(hidpi_name); + cairo_surface_t *tmp = mdc::surface_from_png_image(icon_path); if (tmp) { // Mark the surface as being a hi-res variant of a standard icon. @@ -750,8 +755,8 @@ cairo_surface_t* Utilities::load_icon(const std::string& name, bool allow_hidpi) } } - std::string icon_path= App::get()->get_resource_path(name); - return mdc::surface_from_png_image(icon_path.c_str()); + std::string icon_path = App::get()->get_resource_path(name); + return mdc::surface_from_png_image(icon_path); } //--------------------------------------------------------------------------------------------------