mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-15 03:40:35 +00:00
Double-clicking a band on the Timeline will expand/collapse it (#920)
This commit is contained in:
parent
937306f4be
commit
04475a825d
@ -1049,12 +1049,7 @@ bool Timeline::onProcessMessage(Message* msg)
|
||||
|
||||
case PART_FRAME_TAG_SWITCH_BAND_BUTTON:
|
||||
if (m_clk.band >= 0) {
|
||||
if (m_tagFocusBand < 0) {
|
||||
m_tagFocusBand = m_clk.band;
|
||||
}
|
||||
else {
|
||||
m_tagFocusBand = -1;
|
||||
}
|
||||
focusTagBand(m_clk.band);
|
||||
regenRows = true;
|
||||
relayout = true;
|
||||
}
|
||||
@ -1123,6 +1118,15 @@ bool Timeline::onProcessMessage(Message* msg)
|
||||
return true;
|
||||
}
|
||||
|
||||
case PART_FRAME_TAG_BAND:
|
||||
if (m_hot.band >= 0) {
|
||||
focusTagBand(m_hot.band);
|
||||
regenerateRows();
|
||||
invalidate();
|
||||
layout();
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
@ -3127,6 +3131,16 @@ void Timeline::showCurrentCel()
|
||||
showCel(layer, m_frame);
|
||||
}
|
||||
|
||||
void Timeline::focusTagBand(int band)
|
||||
{
|
||||
if (m_tagFocusBand < 0) {
|
||||
m_tagFocusBand = band;
|
||||
}
|
||||
else {
|
||||
m_tagFocusBand = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::cleanClk()
|
||||
{
|
||||
invalidateHit(m_clk);
|
||||
@ -3360,7 +3374,7 @@ void Timeline::updateDropRange(const gfx::Point& pt)
|
||||
// Special drop target for expanded groups
|
||||
else if (m_range.type() == Range::kLayers &&
|
||||
m_hot.layer >= 0 &&
|
||||
m_hot.layer < m_rows.size() &&
|
||||
m_hot.layer < int(m_rows.size()) &&
|
||||
m_rows[m_hot.layer].layer()->isGroup() &&
|
||||
static_cast<LayerGroup*>(m_rows[m_hot.layer].layer())->isExpanded()) {
|
||||
m_dropTarget.vhit = DropTarget::FirstChild;
|
||||
|
@ -267,6 +267,7 @@ namespace app {
|
||||
void setHot(const Hit& hit);
|
||||
void showCel(layer_t layer, frame_t frame);
|
||||
void showCurrentCel();
|
||||
void focusTagBand(int band);
|
||||
void cleanClk();
|
||||
gfx::Size getScrollableSize() const;
|
||||
gfx::Point getMaxScrollablePos() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user