mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-05 21:57:20 +00:00
Fix StatusBar::onResize() layout when we don't have enough width
This commit is contained in:
parent
61edf07fdc
commit
669765c708
@ -29,6 +29,7 @@
|
|||||||
#include "app/ui/skin/skin_theme.h"
|
#include "app/ui/skin/skin_theme.h"
|
||||||
#include "app/ui/status_bar.h"
|
#include "app/ui/status_bar.h"
|
||||||
#include "app/ui/timeline.h"
|
#include "app/ui/timeline.h"
|
||||||
|
#include "app/ui/toolbar.h"
|
||||||
#include "app/ui_context.h"
|
#include "app/ui_context.h"
|
||||||
#include "app/util/range_utils.h"
|
#include "app/util/range_utils.h"
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
@ -321,18 +322,22 @@ void StatusBar::onResize(ResizeEvent& ev)
|
|||||||
|
|
||||||
Border border = getBorder();
|
Border border = getBorder();
|
||||||
Rect rc = ev.getBounds();
|
Rect rc = ev.getBounds();
|
||||||
int w = rc.w/2 - border.getSize().w;
|
bool frameControls = (rc.w > 300*ui::guiscale());
|
||||||
rc.x += w + border.left();
|
|
||||||
rc.w = w;
|
|
||||||
|
|
||||||
bool frameControls = (w > 200*ui::guiscale());
|
if (frameControls) {
|
||||||
m_frameLabel->setVisible(frameControls);
|
m_slider->setVisible(rc.w > 400*ui::guiscale());
|
||||||
m_currentFrame->setVisible(frameControls);
|
int prefWidth = m_commandsBox->getPreferredSize().w;
|
||||||
m_newFrame->setVisible(frameControls);
|
int toolBarWidth = ToolBar::instance()->getPreferredSize().w;
|
||||||
m_slider->setVisible(w > 250*ui::guiscale());
|
|
||||||
|
|
||||||
|
rc.x += rc.w - prefWidth - border.right() - toolBarWidth;
|
||||||
|
rc.w = prefWidth;
|
||||||
|
|
||||||
|
m_commandsBox->setVisible(true);
|
||||||
m_commandsBox->setBounds(rc);
|
m_commandsBox->setBounds(rc);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
m_commandsBox->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
void StatusBar::onPreferredSize(PreferredSizeEvent& ev)
|
void StatusBar::onPreferredSize(PreferredSizeEvent& ev)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user