Add "Frame:" label in StatusBar

This commit is contained in:
David Capello 2015-04-07 11:15:28 -03:00
parent 0576bafaa3
commit 41309b369d
2 changed files with 11 additions and 5 deletions

View File

@ -162,10 +162,12 @@ StatusBar::StatusBar()
Box* box1 = new Box(JI_HORIZONTAL);
Box* box2 = new Box(JI_HORIZONTAL | JI_HOMOGENEOUS);
Box* box4 = new Box(JI_HORIZONTAL);
m_slider = new Slider(0, 255, 255);
m_frameLabel = new Label("Frame:");
m_currentFrame = new GotoFrameEntry();
m_newFrame = new Button("+");
m_newFrame->Click.connect(Bind<void>(&StatusBar::newFrame, this));
m_slider = new Slider(0, 255, 255);
setup_mini_look(m_currentFrame);
setup_mini_look(m_newFrame);
@ -179,6 +181,7 @@ StatusBar::StatusBar()
box4->addChild(m_currentFrame);
box4->addChild(m_newFrame);
box1->addChild(m_frameLabel);
box1->addChild(box4);
box1->addChild(m_slider);
@ -370,9 +373,11 @@ void StatusBar::onResize(ResizeEvent& ev)
rc.x += w + border.left();
rc.w = w;
m_currentFrame->setVisible(w > 250*ui::guiscale());
m_newFrame->setVisible(w > 250*ui::guiscale());
m_slider->setVisible(w > 200*ui::guiscale());
bool frameControls = (w > 200*ui::guiscale());
m_frameLabel->setVisible(frameControls);
m_currentFrame->setVisible(frameControls);
m_newFrame->setVisible(frameControls);
m_slider->setVisible(w > 250*ui::guiscale());
m_commandsBox->setBounds(rc);
}

View File

@ -13,7 +13,6 @@
#include "base/observers.h"
#include "doc/layer_index.h"
#include "ui/base.h"
#include "ui/link_label.h"
#include "ui/widget.h"
#include <string>
@ -23,6 +22,7 @@ namespace ui {
class Box;
class Button;
class Entry;
class Label;
class Slider;
class Window;
}
@ -102,6 +102,7 @@ namespace app {
// Box of main commands
ui::Widget* m_commandsBox;
ui::Label* m_frameLabel;
ui::Slider* m_slider; // Opacity slider
ui::Entry* m_currentFrame; // Current frame and go to frame entry
ui::Button* m_newFrame; // Button to create a new frame