void drawer::_m_button_frame(graph_reference graph, rectangle r, int state) { if (!state) return; ::nana::color clr{0x97, 0x97, 0x97}; //highlight switch(state) { case states::actived: clr.from_rgb(0x86, 0xD5, 0xFD); break; case states::selected: clr.from_rgb(0x3C, 0x7F, 0xB1); break; } graph.rectangle(r, false, clr); clr = clr.blend(colors::white, 0.5); graph.palette(false, clr); r.pare_off(2); if(vertical_) { unsigned half = r.width / 2; graph.rectangle({ r.x + static_cast<int>(r.width - half), r.y, half, r.height }, true); r.width -= half; } else { unsigned half = r.height / 2; graph.rectangle({r.x, r.y + static_cast<int>(r.height - half), r.width, half}, true); r.height -= half; } graph.gradual_rectangle(r, colors::white, clr, !vertical_); }
//private: void drawer::_m_background(graph_reference graph) { graph.rectangle(true, {0xf0, 0xf0, 0xf0}); if (!metrics_.pressed || !_m_check()) return; nana::rectangle_rotator r(vertical_, ::nana::rectangle{ graph.size() }); if(metrics_.what == buttons::forward) { r.x_ref() = static_cast<int>(fixedsize); r.w_ref() = metrics_.scroll_pos; } else if(buttons::backward == metrics_.what) { r.x_ref() = static_cast<int>(fixedsize + metrics_.scroll_pos + metrics_.scroll_length); r.w_ref() = static_cast<unsigned>((vertical_ ? graph.height() : graph.width()) - (fixedsize * 2 + metrics_.scroll_pos + metrics_.scroll_length)); } else return; auto result = r.result(); if (!result.empty()) graph.rectangle(result, true, static_cast<color_rgb>(0xDCDCDC)); }
void drawer::_m_draw_border(graph_reference graph, nana::color_t bgcolor) { if (!API::widget_borderless(widget_->handle())) { nana::rectangle r(graph.size()); graph.rectangle(r, (status_.has_focus ? 0x0595E2 : 0x999A9E), false); graph.rectangle(r.pare_off(1), bgcolor, false); } }
void drawer::_m_draw_border(graph_reference graph) { if(status_.border) { nana::rectangle r(graph.size()); graph.rectangle(r, (status_.has_focus ? 0x0595E2 : 0x999A9E), false); r.pare_off(1); graph.rectangle(r, 0xFFFFFF, false); } }
void trigger::_m_draw_border(graph_reference graph) { nana::rectangle r(graph.size()); ::nana::color lt(static_cast<color_rgb>(0x7f7f7f)), rb(static_cast<color_rgb>(0x707070)); graph.frame_rectangle(r, lt, lt, rb, rb); graph.set_color(colors::button_face); draw_corner_point(graph, r); graph.set_color(static_cast<color_rgb>(0x919191)); draw_corner_point(graph, r.pare_off(1)); if (element_state::pressed == attr_.e_state) graph.rectangle(r, false, static_cast<color_rgb>(0xc3c3c3)); }
void drawer::_m_draw_background(graph_reference graph) { if(bground_mode::basic != API::effects_bground_mode(*widget_)) graph.rectangle(true, API::bgcolor(*widget_)); }
void refresh(graph_reference graph) { graph.rectangle(false, colors::black); graph.rectangle(::nana::rectangle(graph.size()).pare_off(1), true, {0xf0, 0xf0, 0xf0}); }
void drawer::refresh(graph_reference graph) { if (!API::dev::copy_transparent_background(window_, graph)) graph.rectangle(true, API::bgcolor(window_)); }
void trigger::refresh(graph_reference graph) { graph.rectangle(true, API::bgcolor(*wd_)); }
void drawer::refresh(graph_reference graph) { if(bground_mode::basic != API::effects_bground_mode(window_)) graph.rectangle(true, API::bgcolor(window_)); }