Merge branch 'hotfix-1.6.2' into develop-1.7
This commit is contained in:
@@ -163,7 +163,8 @@ namespace nana
|
||||
bld_fgcolor = fgcolor.blend(highlighted, 0.6);
|
||||
break;
|
||||
case element_state::disabled:
|
||||
bld_bgcolor = bld_fgcolor = static_cast<color_rgb>(0xb2b7bc);
|
||||
bld_bgcolor = static_cast<color_rgb>(0xE0E0E0);
|
||||
bld_fgcolor = static_cast<color_rgb>(0x999A9E);
|
||||
break;
|
||||
default:
|
||||
//Leave things as they are
|
||||
|
||||
@@ -85,9 +85,13 @@ namespace nana{ namespace drawerbase
|
||||
graph.text_metrics(txt_px, descent, ileading);
|
||||
txt_px += (descent + 2);
|
||||
|
||||
auto e_state = API::element_state(*wdg);
|
||||
if(!wdg->enabled())
|
||||
e_state = element_state::disabled;
|
||||
|
||||
impl_->crook.draw(graph,
|
||||
impl_->scheme_ptr->square_bgcolor.get(wdg->bgcolor()), impl_->scheme_ptr->square_border_color.get(wdg->fgcolor()),
|
||||
rectangle(0, txt_px > 16 ? (txt_px - 16) / 2 : 0, 16, 16), API::element_state(*wdg));
|
||||
rectangle(0, txt_px > 16 ? (txt_px - 16) / 2 : 0, 16, 16), e_state);
|
||||
}
|
||||
|
||||
void drawer::mouse_down(graph_reference graph, const arg_mouse&)
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace nana{
|
||||
{
|
||||
label caption;
|
||||
align caption_align{ align::left };
|
||||
background_mode caption_mode{ background_mode::blending };
|
||||
place place_content;
|
||||
unsigned gap{2};
|
||||
std::string usr_div_str;
|
||||
@@ -154,7 +155,7 @@ namespace nana{
|
||||
return *impl_->options.back();
|
||||
}
|
||||
|
||||
void group::caption_align(align position)
|
||||
group& group::caption_align(align position)
|
||||
{
|
||||
if (position != impl_->caption_align)
|
||||
{
|
||||
@@ -163,6 +164,32 @@ namespace nana{
|
||||
impl_->place_content.collocate();
|
||||
API::refresh_window(*this);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
group& group::caption_background_mode(background_mode mode)
|
||||
{
|
||||
if (mode != impl_->caption_mode)
|
||||
{
|
||||
impl_->caption_mode = mode;
|
||||
switch (mode)
|
||||
{
|
||||
case background_mode::none:
|
||||
impl_->caption.bgcolor(this->bgcolor());
|
||||
impl_->caption.transparent(false);
|
||||
break;
|
||||
case background_mode::blending:
|
||||
impl_->caption.transparent(true);
|
||||
impl_->caption.bgcolor(API::bgcolor(this->parent()).blend(colors::black, 0.025));
|
||||
break;
|
||||
case background_mode::transparent:
|
||||
impl_->caption.transparent(true);
|
||||
impl_->caption.bgcolor(API::bgcolor(this->parent()).blend(colors::black, 0.025));
|
||||
break;
|
||||
}
|
||||
API::refresh_window(*this);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
group& group::radio_mode(bool enable)
|
||||
@@ -295,17 +322,20 @@ namespace nana{
|
||||
),
|
||||
3, 3, this->scheme().border, true, this->bgcolor());
|
||||
|
||||
auto opt_r = API::window_rectangle(impl_->caption);
|
||||
if (opt_r)
|
||||
if (background_mode::blending == impl_->caption_mode)
|
||||
{
|
||||
rectangle grad_r{ opt_r->position(), nana::size{ opt_r->width + 4, static_cast<unsigned>(top_round_line - opt_r->y) } };
|
||||
auto opt_r = API::window_rectangle(impl_->caption);
|
||||
if (opt_r)
|
||||
{
|
||||
rectangle grad_r{ opt_r->position(), nana::size{ opt_r->width + 4, static_cast<unsigned>(top_round_line - opt_r->y) } };
|
||||
|
||||
grad_r.y += top_round_line*2 / 3;
|
||||
grad_r.x -= 2;
|
||||
grad_r.y += top_round_line * 2 / 3;
|
||||
grad_r.x -= 2;
|
||||
|
||||
graph.gradual_rectangle(grad_r,
|
||||
API::bgcolor(this->parent()), this->bgcolor(), true
|
||||
);
|
||||
graph.gradual_rectangle(grad_r,
|
||||
API::bgcolor(this->parent()), this->bgcolor(), true
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace nana
|
||||
if (!_m_foreach_visual_line(graph, rs))
|
||||
break;
|
||||
|
||||
rs.pos.y += static_cast<int>(rs.vslines.back().extent_height_px);
|
||||
//Now the y-position of rs has been modified to next line.
|
||||
}
|
||||
|
||||
if (transient_.current_font != pre_font)
|
||||
@@ -531,10 +531,6 @@ namespace nana
|
||||
|
||||
bool _m_foreach_visual_line(graph_reference graph, render_status& rs)
|
||||
{
|
||||
std::wstring text;
|
||||
|
||||
content_element_iterator block_start;
|
||||
|
||||
auto const bottom = static_cast<int>(graph.height()) - 1;
|
||||
|
||||
for (auto & vsline : rs.vslines)
|
||||
|
||||
@@ -2002,7 +2002,7 @@ namespace nana {
|
||||
|
||||
auto fgcolor = scheme_->foreground.get_color();
|
||||
if (!API::window_enabled(window_))
|
||||
fgcolor.blend(bgcolor, 0.5);
|
||||
fgcolor = fgcolor.blend(bgcolor, 0.5); //Thank to besh81 for getting the fgcolor to be changed
|
||||
|
||||
if (API::widget_borderless(window_))
|
||||
graph_.rectangle(false, bgcolor);
|
||||
|
||||
@@ -758,6 +758,10 @@ namespace nana
|
||||
|
||||
void trigger::mouse_move(graph_reference graph, const arg_mouse& arg)
|
||||
{
|
||||
// check if slider is disabled
|
||||
if(!API::get_widget(arg.window_handle)->enabled())
|
||||
return; // do nothing
|
||||
|
||||
bool updated = false;
|
||||
if (model_ptr_->if_trace_slider())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user