open presets from the brush preview, fix scrollbar redraw
This commit is contained in:
@@ -252,7 +252,7 @@ void NodePanelStroke::init_controls()
|
||||
m_presets_popup->create();
|
||||
m_presets_popup->loaded();
|
||||
m_presets_popup->SetPositioning(YGPositionTypeAbsolute);
|
||||
m_presets_popup->SetSize(300, 400);
|
||||
m_presets_popup->SetSize(YGUndefined, 400);
|
||||
m_presets_popup->m_mouse_ignore = false;
|
||||
m_presets_popup->m_flood_events = true;
|
||||
m_presets_popup->m_capture_children = false;
|
||||
@@ -272,7 +272,7 @@ void NodePanelStroke::init_controls()
|
||||
|
||||
// BRUSH PRESETS
|
||||
|
||||
m_preset_button = find<NodeButton>("preset-button");
|
||||
m_preset_button = find<NodeButtonCustom>("preset-button");
|
||||
m_preset_button->on_click = [this](Node*) {
|
||||
auto screen = root()->m_size;
|
||||
glm::vec2 pos = m_preset_button->m_pos + glm::vec2(m_preset_button->m_size.x, 0);
|
||||
@@ -283,7 +283,7 @@ void NodePanelStroke::init_controls()
|
||||
tick->SetPosition(pos.x, pos.y + (m_preset_button->m_size.y - 32) * 0.5f);
|
||||
tick->set_image("data/ui/popup-tick.png");
|
||||
float hh = m_presets_popup->m_container->m_children.size() > 10 ? App::I.height / App::I.zoom * .75f : 400.f;
|
||||
m_presets_popup->SetSize(300, glm::max(hh, 400.f));
|
||||
m_presets_popup->SetHeight(glm::max(hh, 400.f));
|
||||
root()->update();
|
||||
if ((pos.y + m_presets_popup->m_size.y) > screen.y)
|
||||
pos.y = screen.y - m_presets_popup->m_size.y;
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
NodeImage* m_brush_thumb;
|
||||
NodeImage* m_dual_brush_thumb;
|
||||
NodeImage* m_pattern_thumb;
|
||||
NodeButton* m_preset_button;
|
||||
NodeButtonCustom* m_preset_button;
|
||||
|
||||
NodeCheckBox* m_tip_invert;
|
||||
NodeCheckBox* m_tip_flipx;
|
||||
|
||||
@@ -34,7 +34,10 @@ void NodeScroll::on_tick(float dt)
|
||||
float sz = m_size.y - (pad[0] + pad[2]);
|
||||
float new_pad = rect.w == 0 || rect.w <= sz ? 5 : 35;
|
||||
if (pad[1] != new_pad)
|
||||
{
|
||||
YGNodeStyleSetPadding(y_node, YGEdgeRight, new_pad);
|
||||
app_redraw();
|
||||
}
|
||||
}
|
||||
|
||||
void NodeScroll::draw()
|
||||
|
||||
Reference in New Issue
Block a user