From 24bbfc649319d13821904c763da63ed088c8fbe3 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Tue, 17 Oct 2017 06:49:39 +0800 Subject: [PATCH] small changes --- include/nana/basic_types.hpp | 9 ++++++++- source/gui/detail/window_manager.cpp | 14 ++------------ source/paint/graphics.cpp | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/include/nana/basic_types.hpp b/include/nana/basic_types.hpp index b190ea42..a041279b 100644 --- a/include/nana/basic_types.hpp +++ b/include/nana/basic_types.hpp @@ -312,7 +312,14 @@ namespace nana /// @param lightness in range of [0, 1] color& from_hsl(double hue, double saturation, double lightness); ///< immutable alpha channel - color blend(const color& blending_color, double alpha) const; + /// Blends color + /** + * Returns a color which is blended as this * (1 - fade_rate) + blending_color * fade_rate + * @param blending_color Color to blend + * @param fade_rate Blending rate for blending_color + * @return a blended color + */ + color blend(const color& blending_color, double fade_rate) const; /// Determines whether the color is completely transparent. bool invisible() const; diff --git a/source/gui/detail/window_manager.cpp b/source/gui/detail/window_manager.cpp index e948aeec..476b657b 100644 --- a/source/gui/detail/window_manager.cpp +++ b/source/gui/detail/window_manager.cpp @@ -219,8 +219,6 @@ namespace detail Key first; Value second; - key_value_rep() = default; - key_value_rep(const Key& k) : first(k), second{} { @@ -258,15 +256,7 @@ namespace detail std::vector table_; }; - //class window_manager - struct window_handle_deleter - { - void operator()(basic_window* wd) const - { - delete wd; - } - }; - + //class window_manager //struct wdm_private_impl struct window_manager::wdm_private_impl { @@ -506,7 +496,7 @@ namespace detail if (impl_->wd_register.available(owner)) { if (owner->flags.destroying) - throw std::runtime_error("the specified owner is destory"); + throw std::runtime_error("the specified owner is destoryed"); #ifndef WIDGET_FRAME_DEPRECATED native = (category::flags::frame == owner->other.category ? diff --git a/source/paint/graphics.cpp b/source/paint/graphics.cpp index f31f3afd..62f74016 100644 --- a/source/paint/graphics.cpp +++ b/source/paint/graphics.cpp @@ -271,7 +271,7 @@ namespace paint graphics::operator bool() const noexcept { - return impl_->handle; + return (impl_->handle != nullptr); } drawable_type graphics::handle() const