improve window manager refresh process

This commit is contained in:
Jinhao
2016-04-20 02:07:38 +08:00
parent 3dbe94cd6c
commit c512b2dad5
13 changed files with 98 additions and 76 deletions

View File

@@ -118,6 +118,8 @@ namespace detail
bool is_draw_through() const; ///< Determines whether it is a draw-through window.
basic_window * seek_non_lite_widget_ancestor() const;
void set_action(mouse_action);
public:
/// Override event_holder
bool set_events(const std::shared_ptr<general_events>&) override;
@@ -169,6 +171,7 @@ namespace detail
unsigned Reserved :18;
unsigned char tab; ///< indicate a window that can receive the keyboard TAB
mouse_action action;
mouse_action action_before;
}flags;
struct

View File

@@ -24,7 +24,7 @@ namespace nana{
return object;
}
unsigned weight() const
constexpr unsigned weight() const
{
return 2;
}
@@ -122,9 +122,22 @@ namespace nana{
}
}
rectangle wd_r{ wd->pos_root, wd->dimension };
wd_r.pare_off(-static_cast<int>(this->weight()));
//Render
for (auto & rd : rd_set)
_m_render_edge_nimbus(rd.second, rd.first);
{
auto other_wd = rd.second;
if (other_wd != wd)
{
rectangle other_r{ other_wd->pos_root, other_wd->dimension };
other_r.pare_off(-static_cast<int>(this->weight()));
if (!overlapped(wd_r, other_r))
continue;
}
_m_render_edge_nimbus(other_wd, rd.first);
}
}
private:
static bool _m_edge_nimbus(core_window_t * focused_wd, core_window_t * wd)
@@ -138,6 +151,8 @@ namespace nana{
void _m_render_edge_nimbus(core_window_t* wd, const nana::rectangle & visual)
{
wd->flags.action_before = wd->flags.action;
auto r = visual;
r.pare_off(-static_cast<int>(weight()));
rectangle good_r;

View File

@@ -18,7 +18,7 @@
namespace nana
{
//overlap test if overlaped between r1 and r2
bool overlap(const rectangle& r1, const rectangle& r2);
bool overlapped(const rectangle& r1, const rectangle& r2);
// overlap, compute the overlap area between r1 and r2. the r is for root
bool overlap(const rectangle& r1, const rectangle& r2, rectangle& r);

View File

@@ -256,7 +256,7 @@ namespace nana{ namespace widgets
bool scroll(bool upwards, bool vertical);
bool focus_changed(const arg_focus&);
bool mouse_enter(bool);
bool mouse_enter(bool entering);
bool mouse_move(bool left_button, const point& screen_pos);
bool mouse_pressed(const arg_mouse& arg);
@@ -274,7 +274,7 @@ namespace nana{ namespace widgets
::nana::upoint _m_put(::std::wstring);
::nana::upoint _m_erase_select();
bool _m_make_select_string(::std::wstring&) const;
::std::wstring _m_make_select_string() const;
static bool _m_resolve_text(const ::std::wstring&, std::vector<std::pair<std::size_t, std::size_t>> & lines);
bool _m_cancel_select(int align);