Renamed expr_color to color
This commit is contained in:
@@ -220,7 +220,7 @@ namespace nana{ namespace drawerbase
|
||||
//color_t fgcolor = (attr_.focus_color ? (attr_.focused ? 0xFF : attr_.fgcolor) : attr_.fgcolor);
|
||||
auto fgcolor = attr_.fgcolor;
|
||||
if (attr_.focus_color && attr_.focused)
|
||||
fgcolor = ::nana::expr_color(colors::blue);
|
||||
fgcolor = ::nana::color(colors::blue);
|
||||
|
||||
graph.set_text_color(fgcolor);
|
||||
|
||||
@@ -241,17 +241,17 @@ namespace nana{ namespace drawerbase
|
||||
}
|
||||
else
|
||||
{
|
||||
graph.set_text_color(::nana::expr_color(colors::white));
|
||||
graph.set_text_color(::nana::color(colors::white));
|
||||
if(attr_.omitted)
|
||||
{
|
||||
tr.render(point{ pos.x + 1, pos.y + 1 }, txtptr, txtlen, omitted_pixels, true);
|
||||
graph.set_text_color(::nana::expr_color(colors::gray));
|
||||
graph.set_text_color(::nana::color(colors::gray));
|
||||
tr.render(pos, txtptr, txtlen, omitted_pixels, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
graph.bidi_string(point{ pos.x + 1, pos.y + 1 }, txtptr, txtlen);
|
||||
graph.set_text_color(::nana::expr_color(colors::gray));
|
||||
graph.set_text_color(::nana::color(colors::gray));
|
||||
graph.bidi_string(pos, txtptr, txtlen);
|
||||
}
|
||||
}
|
||||
@@ -298,9 +298,9 @@ namespace nana{ namespace drawerbase
|
||||
nana::rectangle r(graph.size());
|
||||
r.pare_off(1);
|
||||
|
||||
::nana::expr_color from(colors::white);
|
||||
::nana::color from(colors::white);
|
||||
from.blend(attr_.bgcolor, 0.8);
|
||||
::nana::expr_color to(colors::black);
|
||||
::nana::color to(colors::black);
|
||||
to.blend(attr_.bgcolor, 0.05);
|
||||
|
||||
if (element_state::pressed == attr_.e_state)
|
||||
@@ -317,7 +317,7 @@ namespace nana{ namespace drawerbase
|
||||
int right = r.width - 1;
|
||||
int bottom = r.height - 1;
|
||||
|
||||
::nana::expr_color lt{0x7f,0x7f,0x7f}, rb{0x70,0x70,0x70};
|
||||
::nana::color lt{0x7f,0x7f,0x7f}, rb{0x70,0x70,0x70};
|
||||
graph.frame_rectangle(r, lt, lt, rb, rb);
|
||||
|
||||
graph.set_color({0x91,0x91,0x91});
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace nana
|
||||
|
||||
if(ue.what == ue.none || (API::window_enabled(wd) == false))
|
||||
{ //the mouse is out of the widget.
|
||||
style_.bgcolor.blend(expr_color{ 0xa0, 0xc9, 0xf5 }, 0.9);
|
||||
style_.bgcolor.blend(color{ 0xa0, 0xc9, 0xf5 }, 0.9);
|
||||
}
|
||||
graph.rectangle(r, true, style_.bgcolor);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace nana
|
||||
if(ui_el_.what == ui_el_.item_root)
|
||||
{
|
||||
_m_item_bground(graph, r.x + 1, r.y, r.width - 2, r.height, (state == mouse_action::pressed ? mouse_action::pressed : mouse_action::over));
|
||||
graph.rectangle(r, false, expr_color{ 0x3C, 0x7F, 0xB1 });
|
||||
graph.rectangle(r, false, color{ 0x3C, 0x7F, 0xB1 });
|
||||
if(state == mouse_action::pressed)
|
||||
{
|
||||
++x;
|
||||
@@ -127,7 +127,7 @@ namespace nana
|
||||
unsigned width = r.width - 2;
|
||||
unsigned height = r.height - 2;
|
||||
|
||||
::nana::expr_color clr{ 0x3C, 0x7F, 0xB1 };
|
||||
::nana::color clr{ 0x3C, 0x7F, 0xB1 };
|
||||
if(has_child)
|
||||
{
|
||||
width -= 16;
|
||||
@@ -155,8 +155,8 @@ namespace nana
|
||||
|
||||
graph.rectangle(r, false, { 0xf0, 0xf0, 0xf0 });
|
||||
|
||||
expr_color lb(0x9d, 0xab, 0xb9);
|
||||
expr_color tr(0x48, 0x4e, 0x55);
|
||||
color lb(0x9d, 0xab, 0xb9);
|
||||
color tr(0x48, 0x4e, 0x55);
|
||||
graph.frame_rectangle(r.pare_off(1), lb, tr, tr, lb);
|
||||
}
|
||||
private:
|
||||
@@ -165,7 +165,7 @@ namespace nana
|
||||
const unsigned half = (height - 2) / 2;
|
||||
int left = x + 1;
|
||||
int top = y + 1;
|
||||
nana::expr_color clr_top(0xea, 0xea, 0xea), clr_bottom(0xdc, 0xdc, 0xdc);
|
||||
nana::color clr_top(0xea, 0xea, 0xea), clr_bottom(0xdc, 0xdc, 0xdc);
|
||||
switch(state)
|
||||
{
|
||||
case mouse_action::over:
|
||||
@@ -189,12 +189,12 @@ namespace nana
|
||||
int bottom = y + height - 1;
|
||||
int right = x + width - 1;
|
||||
|
||||
graph.set_color(expr_color(0x6e, 0x8d, 0x9f));
|
||||
graph.set_color(color(0x6e, 0x8d, 0x9f));
|
||||
graph.line(point{ x, y }, point{right, y});
|
||||
graph.line(point{ x, y + 1 }, point{ x, bottom });
|
||||
++x;
|
||||
++y;
|
||||
graph.set_color(expr_color(0xa6, 0xc7, 0xd9));
|
||||
graph.set_color(color(0xa6, 0xc7, 0xd9));
|
||||
graph.line(point{ x, y }, point{ right, y });
|
||||
graph.line(point{ x, y + 1 }, point{ x, bottom });
|
||||
}
|
||||
@@ -206,8 +206,8 @@ namespace nana
|
||||
{
|
||||
//nana::color_t bgcolor;
|
||||
//nana::color_t fgcolor;
|
||||
expr_color bgcolor;
|
||||
expr_color fgcolor;
|
||||
color bgcolor;
|
||||
color fgcolor;
|
||||
}style_;
|
||||
};
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace nana
|
||||
{
|
||||
widget_ = static_cast< ::nana::combox*>(&wd);
|
||||
editor_ = new widgets::skeletons::text_editor(widget_->handle(), graph);
|
||||
editor_->border_renderer([this](graph_reference graph, const ::nana::expr_color& bgcolor){
|
||||
editor_->border_renderer([this](graph_reference graph, const ::nana::color& bgcolor){
|
||||
draw_border(graph, bgcolor);
|
||||
});
|
||||
editor_->multi_lines(false);
|
||||
@@ -284,9 +284,9 @@ namespace nana
|
||||
_m_draw_image();
|
||||
}
|
||||
|
||||
void draw_border(graph_reference graph, const ::nana::expr_color& bgcolor)
|
||||
void draw_border(graph_reference graph, const ::nana::color& bgcolor)
|
||||
{
|
||||
graph.rectangle(false, (state_.focused ? ::nana::expr_color(0x05, 0x95, 0xE2) : ::nana::expr_color(0x99, 0x9A, 0x9E)));
|
||||
graph.rectangle(false, (state_.focused ? ::nana::color(0x05, 0x95, 0xE2) : ::nana::color(0x99, 0x9A, 0x9E)));
|
||||
nana::rectangle r(graph.size());
|
||||
graph.rectangle(r.pare_off(1), false, bgcolor);
|
||||
}
|
||||
@@ -439,7 +439,7 @@ namespace nana
|
||||
}
|
||||
}
|
||||
|
||||
void _m_draw_background(graph_reference graph, const rectangle&, const ::nana::expr_color&)
|
||||
void _m_draw_background(graph_reference graph, const rectangle&, const ::nana::color&)
|
||||
{
|
||||
::nana::rectangle r(graph.size());
|
||||
auto clr_from = colors::button_face_shadow_start;
|
||||
@@ -467,8 +467,8 @@ namespace nana
|
||||
int bottom = graph_->height() - 2;
|
||||
int mid = top + (bottom - top) * 5 / 18;
|
||||
|
||||
::nana::expr_color topcol, topcol_ln, botcol, botcol_ln;
|
||||
::nana::expr_color arrow_color{ colors::white };
|
||||
::nana::color topcol, topcol_ln, botcol, botcol_ln;
|
||||
::nana::color arrow_color{ colors::white };
|
||||
if (enabled && items_.size())
|
||||
{
|
||||
double percent = 1;
|
||||
@@ -477,10 +477,10 @@ namespace nana
|
||||
else if (state_.state == state_t::mouse_over)
|
||||
percent = 0.9;
|
||||
|
||||
topcol_ln = expr_color{ 0x3F, 0x47, 0x6C }.blend(arrow_color, percent);
|
||||
botcol_ln = expr_color{ 0x03, 0x31, 0x114 }.blend(arrow_color, percent);
|
||||
topcol = expr_color{ 0x3F, 83, 84 }.blend(arrow_color, percent);
|
||||
botcol = expr_color{ 0x0c, 0x4a, 0x9a }.blend(arrow_color, percent);
|
||||
topcol_ln = color{ 0x3F, 0x47, 0x6C }.blend(arrow_color, percent);
|
||||
botcol_ln = color{ 0x03, 0x31, 0x114 }.blend(arrow_color, percent);
|
||||
topcol = color{ 0x3F, 83, 84 }.blend(arrow_color, percent);
|
||||
botcol = color{ 0x0c, 0x4a, 0x9a }.blend(arrow_color, percent);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace nana
|
||||
{
|
||||
if (state == StateHighlighted)
|
||||
{
|
||||
::nana::expr_color clr{ 0xaf, 0xc7, 0xe3 };
|
||||
::nana::color clr{ 0xaf, 0xc7, 0xe3 };
|
||||
graph.rectangle(r, false, clr);
|
||||
|
||||
graph.set_color(colors::white);
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace nana
|
||||
return true;
|
||||
}
|
||||
|
||||
void render(graph_reference graph, const ::nana::expr_color& fgcolor, align th, align_v tv)
|
||||
void render(graph_reference graph, const ::nana::color& fgcolor, align th, align_v tv)
|
||||
{
|
||||
traceable_.clear();
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace nana
|
||||
}
|
||||
}
|
||||
|
||||
void _m_set_default(const ::nana::paint::font& ft, const ::nana::expr_color& fgcolor)
|
||||
void _m_set_default(const ::nana::paint::font& ft, const ::nana::color& fgcolor)
|
||||
{
|
||||
def_.font_name = ft.name();
|
||||
def_.font_size = ft.size();
|
||||
@@ -224,7 +224,7 @@ namespace nana
|
||||
def_.fgcolor = fgcolor;
|
||||
}
|
||||
|
||||
const ::nana::expr_color& _m_fgcolor(nana::widgets::skeletons::fblock* fp)
|
||||
const ::nana::color& _m_fgcolor(nana::widgets::skeletons::fblock* fp)
|
||||
{
|
||||
while(fp->fgcolor.invisible())
|
||||
{
|
||||
@@ -609,7 +609,7 @@ namespace nana
|
||||
::nana::string font_name;
|
||||
std::size_t font_size;
|
||||
bool font_bold;
|
||||
::nana::expr_color fgcolor;
|
||||
::nana::color fgcolor;
|
||||
}def_;
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace nana
|
||||
namespace listbox
|
||||
{
|
||||
//struct cell
|
||||
cell::format::format(const ::nana::expr_color& bgcolor, const ::nana::expr_color& fgcolor)
|
||||
cell::format::format(const ::nana::color& bgcolor, const ::nana::color& fgcolor)
|
||||
: bgcolor{ bgcolor }, fgcolor{ fgcolor }
|
||||
{}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace nana
|
||||
custom_format(new format{ fmt }) //make_unique
|
||||
{}
|
||||
|
||||
cell::cell(nana::string text, const ::nana::expr_color& bgcolor, const ::nana::expr_color& fgcolor)
|
||||
cell::cell(nana::string text, const ::nana::color& bgcolor, const ::nana::color& fgcolor)
|
||||
: text(std::move(text)),
|
||||
custom_format{ new format{ bgcolor, fgcolor } } //make_unique
|
||||
{}
|
||||
@@ -577,8 +577,8 @@ namespace nana
|
||||
typedef std::vector<cell> container;
|
||||
|
||||
container cells;
|
||||
nana::expr_color bgcolor;
|
||||
nana::expr_color fgcolor;
|
||||
nana::color bgcolor;
|
||||
nana::color fgcolor;
|
||||
paint::image img;
|
||||
nana::size img_show_size;
|
||||
|
||||
@@ -616,7 +616,7 @@ namespace nana
|
||||
cells.emplace_back(std::move(s));
|
||||
}
|
||||
|
||||
item_t(nana::string&& s, const nana::expr_color& bg, const nana::expr_color& fg)
|
||||
item_t(nana::string&& s, const nana::color& bg, const nana::color& fg)
|
||||
: bgcolor(bg),
|
||||
fgcolor(fg)
|
||||
{
|
||||
@@ -2280,9 +2280,9 @@ namespace nana
|
||||
}
|
||||
|
||||
template<typename Item>
|
||||
void _m_draw_item(graph_reference graph, int x, int y, unsigned height, int txtop, const ::nana::expr_color& fgcolor, const Item& item, essence_t::state_t state)
|
||||
void _m_draw_item(graph_reference graph, int x, int y, unsigned height, int txtop, const ::nana::color& fgcolor, const Item& item, essence_t::state_t state)
|
||||
{
|
||||
::nana::expr_color bgcolor;
|
||||
::nana::color bgcolor;
|
||||
typedef essence_t::state_t state_t;
|
||||
switch(state)
|
||||
{
|
||||
@@ -2460,14 +2460,14 @@ namespace nana
|
||||
}
|
||||
}
|
||||
private:
|
||||
void _m_draw_categ(const category_t& categ, int x, int y, int txtoff, unsigned width, const nana::rectangle& r, nana::expr_color bgcolor, essence_t::state_t state) const
|
||||
void _m_draw_categ(const category_t& categ, int x, int y, int txtoff, unsigned width, const nana::rectangle& r, nana::color bgcolor, essence_t::state_t state) const
|
||||
{
|
||||
bool sel = categ.selected();
|
||||
if(sel && (categ.expand == false))
|
||||
bgcolor = nana::expr_color(0xD5, 0xEF, 0xFC);
|
||||
bgcolor = nana::color(0xD5, 0xEF, 0xFC);
|
||||
|
||||
if (state == essence_t::state_t::highlighted)
|
||||
bgcolor.blend(::nana::expr_color(0x99, 0xde, 0xfd), 0.8);
|
||||
bgcolor.blend(::nana::color(0x99, 0xde, 0xfd), 0.8);
|
||||
|
||||
auto graph = essence_->graph;
|
||||
graph->set_color(bgcolor);
|
||||
@@ -2499,10 +2499,10 @@ namespace nana
|
||||
}
|
||||
}
|
||||
|
||||
void _m_draw_item(const item_t& item, int x, int y, int txtoff, unsigned width, const nana::rectangle& r, const std::vector<size_type>& seqs, nana::expr_color bgcolor, nana::expr_color fgcolor, essence_t::state_t state) const
|
||||
void _m_draw_item(const item_t& item, int x, int y, int txtoff, unsigned width, const nana::rectangle& r, const std::vector<size_type>& seqs, nana::color bgcolor, nana::color fgcolor, essence_t::state_t state) const
|
||||
{
|
||||
if(item.flags.selected)
|
||||
bgcolor = nana::expr_color(0xD5, 0xEF, 0xFC);
|
||||
bgcolor = nana::color(0xD5, 0xEF, 0xFC);
|
||||
else if (!item.bgcolor.invisible())
|
||||
bgcolor = item.bgcolor;
|
||||
|
||||
@@ -2511,7 +2511,7 @@ namespace nana
|
||||
|
||||
auto graph = essence_->graph;
|
||||
if (essence_t::state_t::highlighted == state)
|
||||
bgcolor.blend(::nana::expr_color(0x99, 0xde, 0xfd), 0.8);
|
||||
bgcolor.blend(::nana::color(0x99, 0xde, 0xfd), 0.8);
|
||||
|
||||
unsigned show_w = width - essence_->scroll.offset_x;
|
||||
if(show_w >= r.width) show_w = r.width;
|
||||
@@ -2575,7 +2575,7 @@ namespace nana
|
||||
{
|
||||
auto cell_bgcolor = m_cell.custom_format->bgcolor;
|
||||
if (essence_t::state_t::highlighted == state)
|
||||
cell_bgcolor.blend(::nana::expr_color(0x99, 0xde, 0xfd), 0.8);
|
||||
cell_bgcolor.blend(::nana::color(0x99, 0xde, 0xfd), 0.8);
|
||||
graph->set_color(cell_bgcolor);
|
||||
graph->rectangle(rectangle{ item_xpos, y, header.pixels, essence_->item_size }, true);
|
||||
}
|
||||
@@ -3040,26 +3040,26 @@ namespace nana
|
||||
return cat_->items.at(pos_.item).flags.selected;
|
||||
}
|
||||
|
||||
item_proxy & item_proxy::bgcolor(const nana::expr_color& col)
|
||||
item_proxy & item_proxy::bgcolor(const nana::color& col)
|
||||
{
|
||||
cat_->items.at(pos_.item).bgcolor = col;
|
||||
ess_->update();
|
||||
return *this;
|
||||
}
|
||||
|
||||
nana::expr_color item_proxy::bgcolor() const
|
||||
nana::color item_proxy::bgcolor() const
|
||||
{
|
||||
return cat_->items.at(pos_.item).bgcolor;
|
||||
}
|
||||
|
||||
item_proxy& item_proxy::fgcolor(const nana::expr_color& col)
|
||||
item_proxy& item_proxy::fgcolor(const nana::color& col)
|
||||
{
|
||||
cat_->items.at(pos_.item).fgcolor = col;
|
||||
ess_->update();
|
||||
return *this;
|
||||
}
|
||||
|
||||
nana::expr_color item_proxy::fgcolor() const
|
||||
nana::color item_proxy::fgcolor() const
|
||||
{
|
||||
return cat_->items.at(pos_.item).fgcolor;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace nana
|
||||
{
|
||||
graph.rectangle(r, false, { 0xCD, 0xD3, 0xE6 });
|
||||
|
||||
::nana::expr_color clr(0xE6, 0xEF, 0xF4);
|
||||
::nana::color clr(0xE6, 0xEF, 0xF4);
|
||||
graph.rectangle(nana::rectangle(r).pare_off(1), true, clr);
|
||||
|
||||
nana::rectangle crook_r = r;
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace nana
|
||||
void item_renderer::background(const nana::point& pos, const nana::size& size, state_t state)
|
||||
{
|
||||
auto bground = API::fgcolor(handle_);
|
||||
::nana::expr_color border, body, corner;
|
||||
::nana::color border, body, corner;
|
||||
|
||||
switch(state)
|
||||
{
|
||||
@@ -541,8 +541,8 @@ namespace nana
|
||||
{
|
||||
int x = item_pos.x + item_s.width;
|
||||
int y1 = item_pos.y + 2, y2 = item_pos.y + item_s.height - 1;
|
||||
graph_->line({ x, y1 }, { x, y2 }, ::nana::expr_color(colors::gray_border).blend(bgcolor, 0.6));
|
||||
graph_->line({ x + 1, y1 }, { x + 1, y2 }, ::nana::expr_color(colors::button_face_shadow_end).blend(bgcolor, 0.5));
|
||||
graph_->line({ x, y1 }, { x, y2 }, ::nana::color(colors::gray_border).blend(bgcolor, 0.6));
|
||||
graph_->line({ x + 1, y1 }, { x + 1, y2 }, ::nana::color(colors::button_face_shadow_end).blend(bgcolor, 0.5));
|
||||
}
|
||||
|
||||
//Draw text, the text is transformed from orignal for hotkey character
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace nana
|
||||
backimg_.image = img;
|
||||
}
|
||||
|
||||
void picture_drawer::set_shadow_background(const ::nana::expr_color& from, const ::nana::expr_color& to, bool horizontal)
|
||||
void picture_drawer::set_shadow_background(const ::nana::color& from, const ::nana::color& to, bool horizontal)
|
||||
{
|
||||
bground_.gradual_from = from;
|
||||
bground_.gradual_to = to;
|
||||
@@ -277,7 +277,7 @@ namespace nana
|
||||
API::refresh_window(*this);
|
||||
}
|
||||
|
||||
void picture::set_gradual_background(const ::nana::expr_color& from, const ::nana::expr_color& to, bool horizontal)
|
||||
void picture::set_gradual_background(const ::nana::color& from, const ::nana::color& to, bool horizontal)
|
||||
{
|
||||
get_drawer_trigger().set_shadow_background(from, to, horizontal);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace nana
|
||||
{
|
||||
rectangle r = graph.size();
|
||||
graph.gradual_rectangle(r, colors::button_face_shadow_end, colors::button_face_shadow_start, true);
|
||||
::nana::expr_color lt{ 0x80, 0x80, 0x80 }, rb{colors::white};
|
||||
::nana::color lt{ 0x80, 0x80, 0x80 }, rb{colors::white};
|
||||
graph.frame_rectangle(r, lt, lt, rb, rb);
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace nana
|
||||
{
|
||||
if(state)
|
||||
{
|
||||
::nana::expr_color clr{0x97, 0x97, 0x97}; //highlight
|
||||
::nana::color clr{0x97, 0x97, 0x97}; //highlight
|
||||
switch(state)
|
||||
{
|
||||
case states::actived:
|
||||
@@ -318,7 +318,7 @@ namespace nana
|
||||
else
|
||||
r.y = (static_cast<int>(sz.height) - 16) / 2;
|
||||
|
||||
arrow_16_pixels(graph, r.x, r.y, (_m_check() ? expr_color(colors::black) : expr_color(0x80, 0x80, 0x80)), (states::none == state ? 0 : 1), dir);
|
||||
arrow_16_pixels(graph, r.x, r.y, (_m_check() ? color(colors::black) : color(0x80, 0x80, 0x80)), (states::none == state ? 0 : 1), dir);
|
||||
}
|
||||
}
|
||||
//end class drawer
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace nana{ namespace widgets
|
||||
virtual std::size_t take_lines(std::size_t pos) const = 0;
|
||||
|
||||
virtual void update_line(std::size_t textline, std::size_t secondary_before) = 0;
|
||||
virtual void render(const ::nana::expr_color& fgcolor) = 0;
|
||||
virtual void render(const ::nana::color& fgcolor) = 0;
|
||||
virtual nana::point caret_to_screen(upoint) = 0;
|
||||
virtual nana::upoint screen_to_caret(point scrpos) = 0;
|
||||
virtual bool move_caret_ns(bool to_north) = 0;
|
||||
@@ -286,7 +286,7 @@ namespace nana{ namespace widgets
|
||||
editor_._m_draw_string(top, API::fgcolor(editor_.window_), nana::upoint(0, editor_.points_.caret.y), editor_.textbase_.getline(textline), true);
|
||||
}
|
||||
|
||||
void render(const ::nana::expr_color& fgcolor) override
|
||||
void render(const ::nana::color& fgcolor) override
|
||||
{
|
||||
auto & points = editor_.points_;
|
||||
|
||||
@@ -700,7 +700,7 @@ namespace nana{ namespace widgets
|
||||
editor_.render(API::is_focus_window(editor_.window_));
|
||||
}
|
||||
|
||||
void render(const ::nana::expr_color& fgcolor) override
|
||||
void render(const ::nana::color& fgcolor) override
|
||||
{
|
||||
std::size_t scrlines = editor_.screen_lines();
|
||||
|
||||
@@ -1246,7 +1246,7 @@ namespace nana{ namespace widgets
|
||||
return false;
|
||||
}
|
||||
|
||||
void text_editor::border_renderer(std::function<void(nana::paint::graphics&, const ::nana::expr_color&)> f)
|
||||
void text_editor::border_renderer(std::function<void(nana::paint::graphics&, const ::nana::color&)> f)
|
||||
{
|
||||
text_area_.border_renderer = f;
|
||||
}
|
||||
@@ -2036,9 +2036,9 @@ namespace nana{ namespace widgets
|
||||
return false;
|
||||
}
|
||||
|
||||
::nana::expr_color text_editor::_m_bgcolor() const
|
||||
::nana::color text_editor::_m_bgcolor() const
|
||||
{
|
||||
return (!API::window_enabled(window_) ? expr_color{ 0xE0, 0xE0, 0xE0 } : API::bgcolor(window_));
|
||||
return (!API::window_enabled(window_) ? color{ 0xE0, 0xE0, 0xE0 } : API::bgcolor(window_));
|
||||
}
|
||||
|
||||
bool text_editor::_m_scroll_text(bool vert)
|
||||
@@ -2500,7 +2500,7 @@ namespace nana{ namespace widgets
|
||||
graph_.string({ text_area_.area.x - points_.offset.x, text_area_.area.y }, attributes_.tip_string, {0x78, 0x78, 0x78});
|
||||
}
|
||||
|
||||
void text_editor::_m_draw_string(int top, const ::nana::expr_color& clr, const nana::upoint& str_pos, const nana::string& linestr, bool if_mask) const
|
||||
void text_editor::_m_draw_string(int top, const ::nana::color& clr, const nana::upoint& str_pos, const nana::string& linestr, bool if_mask) const
|
||||
{
|
||||
::nana::point text_pos{ text_area_.area.x - points_.offset.x, top };
|
||||
const int xend = text_area_.area.x + static_cast<int>(text_area_.area.width);
|
||||
@@ -2575,11 +2575,13 @@ namespace nana{ namespace widgets
|
||||
if ((text_pos.x + static_cast<int>(str_w) > text_area_.area.x) && (text_pos.x < xend))
|
||||
{
|
||||
std::size_t pos = ent.begin - strbeg + str_pos.x;
|
||||
const auto str_end = pos + len;
|
||||
|
||||
if ((pos + len <= a.x || pos >= b.x) || (a.x <= pos && pos + len <= b.x))
|
||||
//NOT selected or Wholly seleceted
|
||||
if ((str_end <= a.x || pos >= b.x) || (a.x <= pos && str_end <= b.x))
|
||||
{
|
||||
//NOT selected or Wholly seleceted
|
||||
if (a.x <= pos)
|
||||
//Wholly selected
|
||||
if (a.x <= pos && str_end <= b.x)
|
||||
{
|
||||
graph_.rectangle({ text_pos, { str_w, line_h_pixels } }, true);
|
||||
graph_.set_text_color(colors::white);
|
||||
@@ -2589,9 +2591,9 @@ namespace nana{ namespace widgets
|
||||
|
||||
graph_.string(text_pos, ent.begin, len);
|
||||
}
|
||||
else if (pos <= a.x && a.x < pos + len)
|
||||
else if (pos <= a.x && a.x < str_end)
|
||||
{ //Partial selected
|
||||
int endpos = static_cast<int>(b.x < pos + len ? b.x : pos + len);
|
||||
int endpos = static_cast<int>(b.x < str_end ? b.x : str_end);
|
||||
std::unique_ptr<unsigned> pxbuf_ptr(new unsigned[len]);
|
||||
unsigned * pxbuf = pxbuf_ptr.get();
|
||||
if (graph_.glyph_pixels(ent.begin, len, pxbuf))
|
||||
@@ -2616,15 +2618,16 @@ namespace nana{ namespace widgets
|
||||
graph_.set_text_color(colors::white);
|
||||
graph_.string(part_pos, ent.begin + (a.x - pos), endpos - a.x);
|
||||
|
||||
if (static_cast<size_t>(endpos) < pos + len)
|
||||
if (static_cast<size_t>(endpos) < str_end)
|
||||
{
|
||||
graph_.set_text_color(clr);
|
||||
part_pos.x += static_cast<int>(sel_w);
|
||||
graph_.string(part_pos, ent.begin + (endpos - pos), pos + len - endpos);
|
||||
graph_.string(part_pos, ent.begin + (endpos - pos), str_end - endpos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pos <= b.x && b.x < pos + len)
|
||||
else if (pos <= b.x && b.x < str_end)
|
||||
{ //Partial selected
|
||||
int endpos = b.x;
|
||||
unsigned sel_w = graph_.glyph_extent_size(ent.begin, len, 0, endpos - pos).width;
|
||||
@@ -2641,12 +2644,12 @@ namespace nana{ namespace widgets
|
||||
graph_.set_text_color(colors::white);
|
||||
graph_.string(text_pos, ent.begin, endpos - pos);
|
||||
graph_.set_text_color(clr);
|
||||
graph_.string(text_pos + ::nana::point(static_cast<int>(sel_w), 0), ent.begin + (endpos - pos), pos + len - endpos);
|
||||
graph_.string(text_pos + ::nana::point(static_cast<int>(sel_w), 0), ent.begin + (endpos - pos), str_end - endpos);
|
||||
}
|
||||
}
|
||||
}
|
||||
text_pos.x += static_cast<int>(str_w);
|
||||
}
|
||||
}//end for
|
||||
}
|
||||
else if (a.y == str_pos.y)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace nana
|
||||
virtual void bar(window, graph_reference graph, const bar_t& bi)
|
||||
{
|
||||
//draw border
|
||||
::nana::expr_color lt(0x83, 0x90, 0x97), rb(0x9d,0xae,0xc2);
|
||||
::nana::color lt(0x83, 0x90, 0x97), rb(0x9d,0xae,0xc2);
|
||||
graph.frame_rectangle(bi.r, lt, lt, rb, rb);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace nana
|
||||
auto len = static_cast<const unsigned>(ad.bound.y - ad.bound.x);
|
||||
const auto upperblock = ad.block - ad.block / 2;
|
||||
|
||||
::nana::expr_color clr_from(0x84, 0xc5, 0xff), clr_trans(0x0f, 0x41, 0xcd), clr_to(0x6e, 0x96, 0xff);
|
||||
::nana::color clr_from(0x84, 0xc5, 0xff), clr_trans(0x0f, 0x41, 0xcd), clr_to(0x6e, 0x96, 0xff);
|
||||
if(ad.horizontal)
|
||||
{
|
||||
graph.gradual_rectangle({ ad.bound.x, ad.fixedpos, len, upperblock }, clr_from, clr_trans, true);
|
||||
|
||||
@@ -27,22 +27,22 @@ namespace nana
|
||||
nana::string text;
|
||||
any value;
|
||||
|
||||
::nana::expr_color bgcolor;
|
||||
::nana::expr_color fgcolor;
|
||||
::nana::color bgcolor;
|
||||
::nana::color fgcolor;
|
||||
};
|
||||
|
||||
class def_renderer
|
||||
: public item_renderer
|
||||
{
|
||||
private:
|
||||
virtual void background(graph_reference graph, const nana::rectangle& r, const ::nana::expr_color& bgcolor)
|
||||
virtual void background(graph_reference graph, const nana::rectangle& r, const ::nana::color& bgcolor)
|
||||
{
|
||||
if(bgcolor_ != bgcolor)
|
||||
{
|
||||
bgcolor_ = bgcolor;
|
||||
dark_bgcolor_ = ::nana::expr_color{ colors::black }.blend(bgcolor, 0.1);
|
||||
blcolor_ = ::nana::expr_color{ colors::black }.blend(bgcolor, 0.5);
|
||||
ilcolor_ = ::nana::expr_color{ colors::white }.blend(bgcolor, 0.1);
|
||||
dark_bgcolor_ = ::nana::color{ colors::black }.blend(bgcolor, 0.1);
|
||||
blcolor_ = ::nana::color{ colors::black }.blend(bgcolor, 0.5);
|
||||
ilcolor_ = ::nana::color{ colors::white }.blend(bgcolor, 0.1);
|
||||
}
|
||||
|
||||
graph.rectangle(true, bgcolor);
|
||||
@@ -52,9 +52,9 @@ namespace nana
|
||||
{
|
||||
//*
|
||||
const nana::rectangle & r = m.r;
|
||||
expr_color bgcolor;
|
||||
expr_color blcolor;
|
||||
expr_color dark_bgcolor;
|
||||
color bgcolor;
|
||||
color blcolor;
|
||||
color dark_bgcolor;
|
||||
|
||||
if(m.bgcolor.invisible())
|
||||
{
|
||||
@@ -65,8 +65,8 @@ namespace nana
|
||||
else
|
||||
{
|
||||
bgcolor = m.bgcolor;
|
||||
blcolor = expr_color{ colors::black }.blend(m.bgcolor, 0.5);
|
||||
dark_bgcolor = expr_color{ colors::black }.blend(m.bgcolor, 0.1);
|
||||
blcolor = color{ colors::black }.blend(m.bgcolor, 0.5);
|
||||
dark_bgcolor = color{ colors::black }.blend(m.bgcolor, 0.1);
|
||||
}
|
||||
|
||||
auto round_r = r;
|
||||
@@ -81,7 +81,7 @@ namespace nana
|
||||
if (m.bgcolor.invisible())
|
||||
beg = ilcolor_;
|
||||
else
|
||||
beg = expr_color{ m.bgcolor }.blend(colors::white, 0.5);
|
||||
beg = color{ m.bgcolor }.blend(colors::white, 0.5);
|
||||
end = bgcolor;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace nana
|
||||
int x = r.x + (static_cast<int>(r.width) - 14) / 2;
|
||||
int y = r.y + (static_cast<int>(r.height) - 14) / 2;
|
||||
|
||||
::nana::expr_color clr;
|
||||
::nana::color clr;
|
||||
|
||||
switch(sta)
|
||||
{
|
||||
@@ -123,20 +123,20 @@ namespace nana
|
||||
virtual void close_fly(graph_reference graph, const nana::rectangle& r, bool active, state_t sta)
|
||||
{
|
||||
using namespace nana::paint;
|
||||
::nana::expr_color clr{ colors::black };
|
||||
::nana::color clr{ colors::black };
|
||||
|
||||
if (sta == item_renderer::highlight)
|
||||
{
|
||||
::nana::expr_color bgcolor{ 0xCC, 0xD2, 0xDD };
|
||||
::nana::expr_color rect_clr{0x9d, 0xa3, 0xab};
|
||||
::nana::color bgcolor{ 0xCC, 0xD2, 0xDD };
|
||||
::nana::color rect_clr{0x9d, 0xa3, 0xab};
|
||||
graph.round_rectangle(r, 1, 1, rect_clr, false, {});
|
||||
nana::rectangle draw_r(r);
|
||||
graph.rectangle(draw_r.pare_off(1), false, ::nana::expr_color{ rect_clr }.blend(bgcolor, 0.8));
|
||||
graph.rectangle(draw_r.pare_off(1), false, ::nana::expr_color{ rect_clr }.blend(bgcolor, 0.4));
|
||||
graph.rectangle(draw_r.pare_off(1), false, ::nana::expr_color{ rect_clr }.blend(bgcolor, 0.2));
|
||||
graph.rectangle(draw_r.pare_off(1), false, ::nana::color{ rect_clr }.blend(bgcolor, 0.8));
|
||||
graph.rectangle(draw_r.pare_off(1), false, ::nana::color{ rect_clr }.blend(bgcolor, 0.4));
|
||||
graph.rectangle(draw_r.pare_off(1), false, ::nana::color{ rect_clr }.blend(bgcolor, 0.2));
|
||||
}
|
||||
else if (!active)
|
||||
clr = ::nana::expr_color{ 0x92, 0x99, 0xA4 };
|
||||
clr = ::nana::color{ 0x92, 0x99, 0xA4 };
|
||||
|
||||
gadget::close_16_pixels(graph, r.x - (16 - r.width) / 2, r.y - (16 - r.height) / 2, 1, clr);
|
||||
}
|
||||
@@ -163,7 +163,7 @@ namespace nana
|
||||
{
|
||||
using namespace nana::paint::gadget;
|
||||
|
||||
::nana::expr_color fgcolor(colors::black);
|
||||
::nana::color fgcolor(colors::black);
|
||||
int style = 1;
|
||||
if(sta == item_renderer::disable)
|
||||
{
|
||||
@@ -176,10 +176,10 @@ namespace nana
|
||||
graph.rectangle(r, false, { 0xA0, 0xA0, 0xA0 });
|
||||
}
|
||||
private:
|
||||
::nana::expr_color bgcolor_;
|
||||
::nana::expr_color dark_bgcolor_;
|
||||
::nana::expr_color blcolor_;
|
||||
::nana::expr_color ilcolor_;
|
||||
::nana::color bgcolor_;
|
||||
::nana::color dark_bgcolor_;
|
||||
::nana::color blcolor_;
|
||||
::nana::color ilcolor_;
|
||||
};
|
||||
|
||||
class toolbox
|
||||
@@ -593,7 +593,7 @@ namespace nana
|
||||
}
|
||||
}
|
||||
|
||||
bool tab_color(std::size_t pos, bool is_bgcolor, const ::nana::expr_color& clr)
|
||||
bool tab_color(std::size_t pos, bool is_bgcolor, const ::nana::color& clr)
|
||||
{
|
||||
if(pos < list_.size())
|
||||
{
|
||||
@@ -1019,7 +1019,7 @@ namespace nana
|
||||
basis_.graph->line({ end, bottom }, { right, bottom });
|
||||
}
|
||||
|
||||
void _m_render_toolbox(const ::nana::expr_color& bgcolor)
|
||||
void _m_render_toolbox(const ::nana::color& bgcolor)
|
||||
{
|
||||
bool backable = (basis_.scroll_pixels != 0);
|
||||
int xbase = _m_toolbox_pos();
|
||||
@@ -1165,7 +1165,7 @@ namespace nana
|
||||
layouter_->relate(i, wd);
|
||||
}
|
||||
|
||||
void trigger::tab_color(std::size_t i, bool is_bgcolor, const ::nana::expr_color& clr)
|
||||
void trigger::tab_color(std::size_t i, bool is_bgcolor, const ::nana::color& clr)
|
||||
{
|
||||
if(layouter_->tab_color(i, is_bgcolor, clr))
|
||||
API::refresh_window(layouter_->widget_handle());
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace nana{ namespace drawerbase {
|
||||
|
||||
editor_ = new text_editor(wd, graph);
|
||||
editor_->textbase().set_event_agent(evt_agent_.get());
|
||||
editor_->border_renderer([this](graph_reference graph, const ::nana::expr_color& clr){
|
||||
editor_->border_renderer([this](graph_reference graph, const ::nana::color& clr){
|
||||
this->_m_draw_border(graph, clr);
|
||||
});
|
||||
|
||||
@@ -177,12 +177,12 @@ namespace nana{ namespace drawerbase {
|
||||
}
|
||||
}
|
||||
|
||||
void drawer::_m_draw_border(graph_reference graph, const ::nana::expr_color& bgcolor)
|
||||
void drawer::_m_draw_border(graph_reference graph, const ::nana::color& bgcolor)
|
||||
{
|
||||
if (!API::widget_borderless(widget_->handle()))
|
||||
{
|
||||
nana::rectangle r(graph.size());
|
||||
graph.rectangle(r, false, (status_.has_focus ? ::nana::expr_color(0x05, 0x95, 0xE2) : ::nana::expr_color(0x99, 0x9A, 0x9E)));
|
||||
graph.rectangle(r, false, (status_.has_focus ? ::nana::color(0x05, 0x95, 0xE2) : ::nana::color(0x99, 0x9A, 0x9E)));
|
||||
graph.rectangle(r.pare_off(1), false, bgcolor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace nana
|
||||
enum class state_t{normal, highlighted, selected};
|
||||
const static unsigned extra_size = 6;
|
||||
|
||||
item_renderer(nana::paint::graphics& graph, bool textout, unsigned scale, const ::nana::expr_color& bgcolor)
|
||||
item_renderer(nana::paint::graphics& graph, bool textout, unsigned scale, const ::nana::color& bgcolor)
|
||||
:graph(graph), textout(textout), scale(scale), bgcolor(bgcolor)
|
||||
{}
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace nana
|
||||
gh.paste(graph, pos.x, pos.y);
|
||||
}
|
||||
else if(state == state_t::normal)
|
||||
graph.blend(nana::rectangle(pos, size), ::nana::expr_color(0xc0, 0xdd, 0xfc).blend(bgcolor, 0.5), 0.25);
|
||||
graph.blend(nana::rectangle(pos, size), ::nana::color(0xc0, 0xdd, 0xfc).blend(bgcolor, 0.5), 0.25);
|
||||
|
||||
x += scale;
|
||||
width -= scale;
|
||||
@@ -194,7 +194,7 @@ namespace nana
|
||||
nana::paint::graphics& graph;
|
||||
bool textout;
|
||||
unsigned scale;
|
||||
::nana::expr_color bgcolor;
|
||||
::nana::color bgcolor;
|
||||
};
|
||||
|
||||
struct drawer::drawer_impl_type
|
||||
@@ -393,9 +393,9 @@ namespace nana
|
||||
return npos;
|
||||
}
|
||||
|
||||
void drawer::_m_draw_background(const ::nana::expr_color& clr)
|
||||
void drawer::_m_draw_background(const ::nana::color& clr)
|
||||
{
|
||||
graph_->gradual_rectangle(graph_->size(), ::nana::expr_color(colors::white).blend(clr, 0.1), ::nana::expr_color(colors::black).blend(clr, 0.05), true);
|
||||
graph_->gradual_rectangle(graph_->size(), ::nana::color(colors::white).blend(clr, 0.1), ::nana::color(colors::black).blend(clr, 0.05), true);
|
||||
}
|
||||
|
||||
void drawer::_m_draw()
|
||||
|
||||
@@ -1078,10 +1078,10 @@ namespace nana
|
||||
class internal_renderer
|
||||
: public renderer_interface
|
||||
{
|
||||
nana::expr_color bgcolor_;
|
||||
nana::expr_color fgcolor_;
|
||||
nana::color bgcolor_;
|
||||
nana::color fgcolor_;
|
||||
|
||||
void set_color(const nana::expr_color & bgcolor, const nana::expr_color& fgcolor) override
|
||||
void set_color(const nana::color & bgcolor, const nana::color& fgcolor) override
|
||||
{
|
||||
bgcolor_ = bgcolor;
|
||||
fgcolor_ = fgcolor;
|
||||
@@ -1093,12 +1093,12 @@ namespace nana
|
||||
|
||||
if(compset->comp_attribute(component::bground, attr))
|
||||
{
|
||||
const ::nana::expr_color color_table[][2] = { { { 0xE8, 0xF5, 0xFD }, { 0xD8, 0xF0, 0xFA } }, //highlighted
|
||||
const ::nana::color color_table[][2] = { { { 0xE8, 0xF5, 0xFD }, { 0xD8, 0xF0, 0xFA } }, //highlighted
|
||||
{ { 0xC4, 0xE8, 0xFA }, { 0xB6, 0xE6, 0xFB } }, //Selected and highlighted
|
||||
{ { 0xD5, 0xEF, 0xFC }, {0x99, 0xDE, 0xFD } } //Selected but not highlighted
|
||||
};
|
||||
|
||||
const ::nana::expr_color *clrptr = nullptr;
|
||||
const ::nana::color *clrptr = nullptr;
|
||||
if(compset->item_attribute().mouse_pointed)
|
||||
{
|
||||
if(compset->item_attribute().selected)
|
||||
@@ -1131,7 +1131,7 @@ namespace nana
|
||||
style = 0;
|
||||
dir = gadget::directions::to_east;
|
||||
}
|
||||
gadget::arrow_16_pixels(graph, attr.area.x, attr.area.y + (attr.area.height - 16) / 2, (attr.mouse_pointed ? expr_color(0x1C, 0xC4, 0xF7) : expr_color(colors::black)), style, dir);
|
||||
gadget::arrow_16_pixels(graph, attr.area.x, attr.area.y + (attr.area.height - 16) / 2, (attr.mouse_pointed ? color(0x1C, 0xC4, 0xF7) : color(colors::black)), style, dir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1351,8 +1351,8 @@ namespace nana
|
||||
}
|
||||
private:
|
||||
trigger::implement * impl_;
|
||||
::nana::expr_color bgcolor_;
|
||||
::nana::expr_color fgcolor_;
|
||||
::nana::color bgcolor_;
|
||||
::nana::color fgcolor_;
|
||||
::nana::point pos_;
|
||||
const node_type * iterated_node_;
|
||||
item_attribute_t node_attr_;
|
||||
|
||||
@@ -141,22 +141,22 @@ namespace nana
|
||||
_m_move(r);
|
||||
}
|
||||
|
||||
void widget::fgcolor(const nana::expr_color& col)
|
||||
void widget::fgcolor(const nana::color& col)
|
||||
{
|
||||
_m_fgcolor(col);
|
||||
}
|
||||
|
||||
nana::expr_color widget::fgcolor() const
|
||||
nana::color widget::fgcolor() const
|
||||
{
|
||||
return _m_fgcolor();
|
||||
}
|
||||
|
||||
void widget::bgcolor(const nana::expr_color& col)
|
||||
void widget::bgcolor(const nana::color& col)
|
||||
{
|
||||
_m_bgcolor(col);
|
||||
}
|
||||
|
||||
nana::expr_color widget::bgcolor() const
|
||||
nana::color widget::bgcolor() const
|
||||
{
|
||||
return _m_bgcolor();
|
||||
}
|
||||
@@ -276,22 +276,22 @@ namespace nana
|
||||
return API::typeface(handle());
|
||||
}
|
||||
|
||||
void widget::_m_fgcolor(const nana::expr_color& col)
|
||||
void widget::_m_fgcolor(const nana::color& col)
|
||||
{
|
||||
API::fgcolor(handle(), col);
|
||||
}
|
||||
|
||||
nana::expr_color widget::_m_fgcolor() const
|
||||
nana::color widget::_m_fgcolor() const
|
||||
{
|
||||
return API::fgcolor(handle());
|
||||
}
|
||||
|
||||
void widget::_m_bgcolor(const nana::expr_color& col)
|
||||
void widget::_m_bgcolor(const nana::color& col)
|
||||
{
|
||||
API::bgcolor(handle(), col);
|
||||
}
|
||||
|
||||
nana::expr_color widget::_m_bgcolor() const
|
||||
nana::color widget::_m_bgcolor() const
|
||||
{
|
||||
return API::bgcolor(handle());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user