Пример #1
0
void StatusBar::onResize(ResizeEvent& ev)
{
  setBoundsQuietly(ev.getBounds());

  Border border = this->border();
  Rect rc = ev.getBounds();
  bool docControls = (rc.w > 300*ui::guiscale());
  if (docControls) {
    int prefWidth = m_docControls->getPreferredSize().w;
    int toolBarWidth = ToolBar::instance()->getPreferredSize().w;

    rc.x += rc.w - prefWidth - border.right() - toolBarWidth;
    rc.w = prefWidth;

    m_docControls->setVisible(m_doc != nullptr);
    m_docControls->setBounds(rc);
  }
  else
    m_docControls->setVisible(false);
}
Пример #2
0
void StatusBar::onResize(ResizeEvent& ev)
{
  setBoundsQuietly(ev.getBounds());

  Border border = getBorder();
  Rect rc = ev.getBounds();
  bool frameControls = (rc.w > 300*ui::guiscale());

  if (frameControls) {
    m_slider->setVisible(rc.w > 400*ui::guiscale());
    int prefWidth = m_commandsBox->getPreferredSize().w;
    int toolBarWidth = ToolBar::instance()->getPreferredSize().w;

    rc.x += rc.w - prefWidth - border.right() - toolBarWidth;
    rc.w = prefWidth;

    m_commandsBox->setVisible(true && m_hasDoc);
    m_commandsBox->setBounds(rc);
  }
  else
    m_commandsBox->setVisible(false);
}