| 4950 | } |
| 4951 | |
| 4952 | void |
| 4953 | LayoutViewBase::background_color (tl::Color c) |
| 4954 | { |
| 4955 | if (c == mp_canvas->background_color ()) { |
| 4956 | return; |
| 4957 | } |
| 4958 | |
| 4959 | // replace by "real" background color if required |
| 4960 | if (! c.is_valid ()) { |
| 4961 | c = default_background_color (); |
| 4962 | } |
| 4963 | |
| 4964 | tl::Color contrast; |
| 4965 | if (c.to_mono ()) { |
| 4966 | contrast = tl::Color (0, 0, 0); |
| 4967 | } else { |
| 4968 | contrast = tl::Color (255, 255, 255); |
| 4969 | } |
| 4970 | |
| 4971 | do_set_background_color (c, contrast); |
| 4972 | |
| 4973 | // Set the color for all ViewService interfaces |
| 4974 | for (std::vector<lay::Plugin *>::iterator p = mp_plugins.begin (); p != mp_plugins.end (); ++p) { |
| 4975 | lay::ViewService *svc = (*p)->view_service_interface (); |
| 4976 | if (svc) { |
| 4977 | svc->set_colors (c, contrast); |
| 4978 | } |
| 4979 | } |
| 4980 | |
| 4981 | mp_canvas->set_colors (c, contrast, mp_canvas->active_color ()); |
| 4982 | |
| 4983 | update_content (); |
| 4984 | |
| 4985 | background_color_changed_event (); |
| 4986 | } |
| 4987 | |
| 4988 | void |
| 4989 | LayoutViewBase::dbu_coordinates (bool f) |
no test coverage detected