From 82c485a054b8a447e9b727acd9e49dc4d564d062 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 7 Apr 2015 02:29:33 -0300 Subject: [PATCH] StatusBar: Improve animation buttons style using a ButtonSet Also now the play button changes to a stop button when the animation is begin played. --- data/skins/default/sheet.png | Bin 12820 -> 12693 bytes data/skins/default/skin.xml | 21 ++--- src/app/commands/cmd_play_animation.cpp | 4 + src/app/ui/button_set.cpp | 16 +++- src/app/ui/button_set.h | 2 + src/app/ui/skin/skin_parts.h | 11 +-- src/app/ui/skin/skin_theme.cpp | 11 +-- src/app/ui/status_bar.cpp | 99 +++++++++++------------- src/app/ui/status_bar.h | 24 +++--- src/app/ui_context.cpp | 2 + 10 files changed, 84 insertions(+), 106 deletions(-) diff --git a/data/skins/default/sheet.png b/data/skins/default/sheet.png index bae3ef75bbd68eb7a316a9e85997aa08b15ccc65..983a538e35e7735654dc1e88cf51b4ef401eba6c 100644 GIT binary patch delta 12135 zcmX9^by$;K8y^TrcS|>Hqf3w;APq_kknWQ1co6CCl$MZglo~CKh_uonUDEaKy}n)7 z{yfk2+~+>`uTH9Ennj`%FecrKgX>g$B`v?u{HCQ+DQ$XhM%r50%PcBcxM2yMDE$pj zx0NC8Yc+$^YI>~3iezo#jf#Kf9PRb1VRh8FULv^Gbt0X-9z4(ee65pQnVo-sy&8NV zBNAE9B|tmwjJyLgy$@LVhENBA3i@=DjN41_a*W%<3VVa;_8Xo@1IIbX;quh$Ekq2G zeCFw+tc!_82q&_x{eMn4DwbI;VE!`lYC%Q1mwxZhf5FUu>LcNIeJ!Tt_Glu9^7niaNf}7s5wi zfKKk%S9&rAYzC8p&QcKFz;y&r!*%N@{E*PGARpBEBy(OZH$sD3xlJhZ+Z)?$}Ri<_^{`y9lOi!R#egEZF+#?yMiD1vGgCdVqtYI9kJ|X!Yn+rkjYL>7+o^ z-l|UjDu|p_o2$Sr63Vrrs(YnR{~{_~+<}ppGrH*1l*zo>WS9jPB$)ld!jXLBb}yMl zOCSG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($unegjMHjI3{!aT&^up~5|J)(v z3|z&ACr~LJ+*i75Y50^B6f?1279xogw$!F$dBySF{%+z;bKKD<6C7-;3M-kVwvU^u z;x{cWxD(3*5b!SLDS*vn*qM#B`8W}jooLeVCU%ZVSeq-jd#9`=1AdR>@AW=#+tamC2{3RQ@)4-2Ioe|utHf;v!kqjneU6&#y6~@?lO!`Z#d5oZ zN0n)CFK8hHBUAqcK-O10G|e!H*|-3Cz}p>U3gxbMeXz>A?l=-gJsT92&P0w1?okP| zv>3}s)6%_-A0e}yx+8r5?bTa!qf6&E1Syz?aCT6%~G*CFNV zBI+<&zr-p1ceGUUH;2tiRNWtT%ab@>^SJ&32|l2*sgUkte_S<#BY33Px?pnT$!olS ztn6{0va0tQ2DiHxVo3s+tXb<({=Y|nAT|0Y=kurQK1C**jWi~Z?gza1ssYfk=NdM= zRLME1YWjl7_Hqd1hZq*b+`t{ZXRQRqKm^?!Te^q0@13)-?x{rn(n`fvLJ_uYv%tYC zhaF%#e1T@7jPL8Z*$&wgZMr*!<4|`CGQoYVZ&&T`#;OCQt7hvAO~wm>J?7f(--ME} zzmw=bCxv~bKDrlp7s{19+0B_s8`tdvUW1qxPDMLf;|i0AF};tO-eG~D!e&o2%Y|%~ zwfElvv#O^g-+R7OPqRjOF$io%#+Jk$qB$r2MwHmC>k28vq zm7iH}{$|XHa`7Eyj2W`tDDYj%k60S92?`)szIN(B9WuL`1XBARj!jkDzaO_?iMvzF z;1J{1k;xJ*(D^P?n;FkaZ_wUpOCN6a`n@XIdf3B+`jis(kB(by4$fcEi9QnWpYzZW f&Hs#@)6;vb_u|Lb9PjsIL6}2RO%GD7Y8U-~h7Q3& diff --git a/data/skins/default/skin.xml b/data/skins/default/skin.xml index 14f09363d..390e749a5 100644 --- a/data/skins/default/skin.xml +++ b/data/skins/default/skin.xml @@ -259,21 +259,12 @@ - - - - - - - - - - - - - - - + + + + + + diff --git a/src/app/commands/cmd_play_animation.cpp b/src/app/commands/cmd_play_animation.cpp index 7a18fcd15..12cfa0c4c 100644 --- a/src/app/commands/cmd_play_animation.cpp +++ b/src/app/commands/cmd_play_animation.cpp @@ -14,6 +14,7 @@ #include "app/context_access.h" #include "app/modules/editors.h" #include "app/ui/editor/editor.h" +#include "app/ui/status_bar.h" namespace app { @@ -60,6 +61,9 @@ void PlayAnimationCommand::onExecute(Context* context) current_editor->stop(); else current_editor->play(); + + // TODO this is an ugly hack, StatusBar should observe Editor changes + StatusBar::instance()->updateUsingEditor(current_editor); } Command* CommandFactory::createPlayAnimationCommand() diff --git a/src/app/ui/button_set.cpp b/src/app/ui/button_set.cpp index d5cedd5d3..ca3d963ca 100644 --- a/src/app/ui/button_set.cpp +++ b/src/app/ui/button_set.cpp @@ -87,7 +87,7 @@ void ButtonSet::Item::onPaint(ui::PaintEvent& ev) if (m_icon) { g->drawRgbaSurface(m_icon, rc.x + rc.w/2 - m_icon->width()/2, - rc.y + rc.h/2 - m_icon->height()/2); + rc.y + rc.h/2 - m_icon->height()/2 - 1*guiscale()); } } @@ -98,12 +98,16 @@ bool ButtonSet::Item::onProcessMessage(ui::Message* msg) case ui::kMouseDownMessage: captureMouse(); buttonSet()->setSelectedItem(this); - buttonSet()->onItemChange(); + if (!buttonSet()->m_triggerOnMouseUp) + buttonSet()->onItemChange(); break; case ui::kMouseUpMessage: - if (hasCapture()) + if (hasCapture()) { releaseMouse(); + if (buttonSet()->m_triggerOnMouseUp) + buttonSet()->onItemChange(); + } break; case ui::kMouseMoveMessage: @@ -135,6 +139,7 @@ void ButtonSet::Item::onPreferredSize(ui::PreferredSizeEvent& ev) ButtonSet::ButtonSet(int columns) : Grid(columns, false) , m_offerCapture(true) + , m_triggerOnMouseUp(false) { noBorderNoChildSpacing(); } @@ -195,6 +200,11 @@ void ButtonSet::setOfferCapture(bool state) m_offerCapture = state; } +void ButtonSet::setTriggerOnMouseUp(bool state) +{ + m_triggerOnMouseUp = state; +} + void ButtonSet::onItemChange() { ItemChange(); diff --git a/src/app/ui/button_set.h b/src/app/ui/button_set.h index 095f3c314..0f64d6f03 100644 --- a/src/app/ui/button_set.h +++ b/src/app/ui/button_set.h @@ -42,6 +42,7 @@ namespace app { void deselectItems(); void setOfferCapture(bool state); + void setTriggerOnMouseUp(bool state); Signal0 ItemChange; @@ -52,6 +53,7 @@ namespace app { Item* findSelectedItem() const; bool m_offerCapture; + bool m_triggerOnMouseUp; }; } // namespace app diff --git a/src/app/ui/skin/skin_parts.h b/src/app/ui/skin/skin_parts.h index 3df46b868..5287e6898 100644 --- a/src/app/ui/skin/skin_parts.h +++ b/src/app/ui/skin/skin_parts.h @@ -114,20 +114,11 @@ namespace app { SKIN_PART_NESW(PART_TOOLTIP_ARROW), PART_ANI_FIRST, - PART_ANI_FIRST_SELECTED, - PART_ANI_FIRST_DISABLED, PART_ANI_PREVIOUS, - PART_ANI_PREVIOUS_SELECTED, - PART_ANI_PREVIOUS_DISABLED, PART_ANI_PLAY, - PART_ANI_PLAY_SELECTED, - PART_ANI_PLAY_DISABLED, + PART_ANI_STOP, PART_ANI_NEXT, - PART_ANI_NEXT_SELECTED, - PART_ANI_NEXT_DISABLED, PART_ANI_LAST, - PART_ANI_LAST_SELECTED, - PART_ANI_LAST_DISABLED, PART_TARGET_ONE, PART_TARGET_ONE_SELECTED, diff --git a/src/app/ui/skin/skin_theme.cpp b/src/app/ui/skin/skin_theme.cpp index c37036d2e..d42c4c6d0 100644 --- a/src/app/ui/skin/skin_theme.cpp +++ b/src/app/ui/skin/skin_theme.cpp @@ -225,20 +225,11 @@ SkinTheme::SkinTheme() sheet_mapping["tooltip"] = PART_TOOLTIP_NW; sheet_mapping["tooltip_arrow"] = PART_TOOLTIP_ARROW_NW; sheet_mapping["ani_first"] = PART_ANI_FIRST; - sheet_mapping["ani_first_selected"] = PART_ANI_FIRST_SELECTED; - sheet_mapping["ani_first_disabled"] = PART_ANI_FIRST_DISABLED; sheet_mapping["ani_previous"] = PART_ANI_PREVIOUS; - sheet_mapping["ani_previous_selected"] = PART_ANI_PREVIOUS_SELECTED; - sheet_mapping["ani_previous_disabled"] = PART_ANI_PREVIOUS_DISABLED; sheet_mapping["ani_play"] = PART_ANI_PLAY; - sheet_mapping["ani_play_selected"] = PART_ANI_PLAY_SELECTED; - sheet_mapping["ani_play_disabled"] = PART_ANI_PLAY_DISABLED; + sheet_mapping["ani_stop"] = PART_ANI_STOP; sheet_mapping["ani_next"] = PART_ANI_NEXT; - sheet_mapping["ani_next_selected"] = PART_ANI_NEXT_SELECTED; - sheet_mapping["ani_next_disabled"] = PART_ANI_NEXT_DISABLED; sheet_mapping["ani_last"] = PART_ANI_LAST; - sheet_mapping["ani_last_selected"] = PART_ANI_LAST_SELECTED; - sheet_mapping["ani_last_disabled"] = PART_ANI_LAST_DISABLED; sheet_mapping["target_one"] = PART_TARGET_ONE; sheet_mapping["target_one_selected"] = PART_TARGET_ONE_SELECTED; sheet_mapping["target_frames"] = PART_TARGET_FRAMES; diff --git a/src/app/ui/status_bar.cpp b/src/app/ui/status_bar.cpp index bfae21b33..77478cbba 100644 --- a/src/app/ui/status_bar.cpp +++ b/src/app/ui/status_bar.cpp @@ -13,6 +13,7 @@ #include "app/commands/commands.h" #include "app/commands/params.h" #include "app/context_access.h" +#include "app/document_access.h" #include "app/document_range.h" #include "app/modules/editors.h" #include "app/modules/gfx.h" @@ -20,6 +21,7 @@ #include "app/modules/palettes.h" #include "app/settings/settings.h" #include "app/tools/tool.h" +#include "app/ui/button_set.h" #include "app/ui/color_button.h" #include "app/ui/editor/editor.h" #include "app/ui/keyboard_shortcuts.h" @@ -30,11 +32,11 @@ #include "app/ui_context.h" #include "app/util/range_utils.h" #include "base/bind.h" -#include "gfx/size.h" #include "doc/cel.h" #include "doc/image.h" #include "doc/layer.h" #include "doc/sprite.h" +#include "gfx/size.h" #include "she/font.h" #include "she/surface.h" #include "ui/ui.h" @@ -90,7 +92,6 @@ private: }; static void slider_change_hook(Slider* slider); -static void ani_button_command(Button* widget, AniAction action); static WidgetType statusbar_type() { @@ -153,19 +154,6 @@ StatusBar::StatusBar() SkinTheme* theme = static_cast(this->getTheme()); setBgColor(theme->getColorById(kStatusBarFace)); -#define BUTTON_NEW(name, text, action) \ - { \ - (name) = new Button(text); \ - setup_mini_look(name); \ - (name)->Click.connect(Bind(&ani_button_command, (name), action)); \ - } - -#define ICON_NEW(name, icon, action) \ - { \ - BUTTON_NEW((name), "", (action)); \ - set_gfxicon_to_button((name), icon, icon##_SELECTED, icon##_DISABLED, JI_CENTER | JI_MIDDLE); \ - } - this->setFocusStop(true); m_timeout = 0; @@ -191,29 +179,25 @@ StatusBar::StatusBar() setup_mini_look(m_currentFrame); setup_mini_look(m_newFrame); - ICON_NEW(m_b_first, PART_ANI_FIRST, ACTION_FIRST); - ICON_NEW(m_b_prev, PART_ANI_PREVIOUS, ACTION_PREV); - ICON_NEW(m_b_play, PART_ANI_PLAY, ACTION_PLAY); - ICON_NEW(m_b_next, PART_ANI_NEXT, ACTION_NEXT); - ICON_NEW(m_b_last, PART_ANI_LAST, ACTION_LAST); + m_buttonSet = new ButtonSet(5); + m_buttonSet->setTriggerOnMouseUp(true); + m_buttonSet->addItem(theme->get_part(PART_ANI_FIRST)); + m_buttonSet->addItem(theme->get_part(PART_ANI_PREVIOUS)); + m_buttonSet->addItem(theme->get_part(PART_ANI_PLAY)); + m_buttonSet->addItem(theme->get_part(PART_ANI_NEXT)); + m_buttonSet->addItem(theme->get_part(PART_ANI_LAST)); + m_buttonSet->ItemChange.connect(Bind(&StatusBar::onPlayButton, this)); m_slider->Change.connect(Bind(&slider_change_hook, m_slider)); m_slider->setMinSize(gfx::Size(ui::display_w()/5, 0)); box1->setBorder(gfx::Border(2, 1, 2, 2)*guiscale()); - box2->noBorderNoChildSpacing(); box4->addChild(m_currentFrame); box4->addChild(m_newFrame); - box2->addChild(m_b_first); - box2->addChild(m_b_prev); - box2->addChild(m_b_play); - box2->addChild(m_b_next); - box2->addChild(m_b_last); - box1->addChild(box4); - box1->addChild(box2); + box1->addChild(m_buttonSet); box1->addChild(m_slider); m_commandsBox = box1; @@ -222,13 +206,10 @@ StatusBar::StatusBar() } App::instance()->CurrentToolChange.connect(&StatusBar::onCurrentToolChange, this); - UIContext::instance()->addObserver(this); } StatusBar::~StatusBar() { - UIContext::instance()->removeObserver(this); - for (Progress* bar : m_progress) delete bar; @@ -255,7 +236,7 @@ void StatusBar::clearText() bool StatusBar::setStatusText(int msecs, const char *format, ...) { // TODO this call should be in an observer of the "current frame" property changes. - updateCurrentFrame(); + updateCurrentFrame(current_editor); if ((ui::clock() > m_timeout) || (msecs > 0)) { char buf[256]; // TODO warning buffer overflow @@ -491,10 +472,11 @@ void StatusBar::onPaint(ui::PaintEvent& ev) } } -void StatusBar::onSetActiveDocument(doc::Document* document) +void StatusBar::updateUsingEditor(Editor* editor) { - updateFromDocument(); - updateCurrentFrame(); + updateFromDocument(editor); + updateCurrentFrame(editor); + updatePlayButton(editor); } bool StatusBar::CustomizedTipWindow::onProcessMessage(Message* msg) @@ -535,37 +517,39 @@ static void slider_change_hook(Slider* slider) } } -static void ani_button_command(Button* widget, AniAction action) +void StatusBar::onPlayButton() { - Command* cmd = NULL; + int item = m_buttonSet->selectedItem(); + m_buttonSet->deselectItems(); - switch (action) { - //case ACTION_LAYER: cmd = CommandsModule::instance()->getCommandByName(CommandId::LayerProperties); break; + Command* cmd = nullptr; + switch (item) { case ACTION_FIRST: cmd = CommandsModule::instance()->getCommandByName(CommandId::GotoFirstFrame); break; case ACTION_PREV: cmd = CommandsModule::instance()->getCommandByName(CommandId::GotoPreviousFrame); break; case ACTION_PLAY: cmd = CommandsModule::instance()->getCommandByName(CommandId::PlayAnimation); break; case ACTION_NEXT: cmd = CommandsModule::instance()->getCommandByName(CommandId::GotoNextFrame); break; case ACTION_LAST: cmd = CommandsModule::instance()->getCommandByName(CommandId::GotoLastFrame); break; } - - if (cmd) + if (cmd) { UIContext::instance()->executeCommand(cmd); + updatePlayButton(current_editor); + } } -void StatusBar::updateFromDocument() +void StatusBar::updateFromDocument(Editor* editor) { try { - if (UIContext::instance()->activeDocument()) { - const ContextReader reader(UIContext::instance()); + if (editor && editor->document()) { + const DocumentReader reader(editor->document()); m_commandsBox->setVisible(true); // Cel opacity const Cel* cel; - if (reader.sprite()->supportAlpha() && - reader.layer() && - reader.layer()->isImage() && - !reader.layer()->isBackground() && - (cel = reader.cel())) { + if (editor->sprite()->supportAlpha() && + editor->layer() && + editor->layer()->isImage() && + !editor->layer()->isBackground() && + (cel = editor->layer()->cel(editor->frame()))) { m_slider->setValue(MID(0, cel->opacity(), 255)); m_slider->setEnabled(true); } @@ -584,18 +568,25 @@ void StatusBar::updateFromDocument() } } -void StatusBar::updateCurrentFrame() +void StatusBar::updateCurrentFrame(Editor* editor) { - DocumentLocation location = UIContext::instance()->activeLocation(); - if (location.sprite()) - m_currentFrame->setTextf("%d", location.frame()+1); + if (editor && editor->sprite()) + m_currentFrame->setTextf("%d", editor->frame()+1); +} + +void StatusBar::updatePlayButton(Editor* editor) +{ + SkinTheme* theme = static_cast(this->getTheme()); + m_buttonSet->getItem(ACTION_PLAY)->setIcon( + theme->get_part( + (editor && editor->isPlaying()) ? PART_ANI_STOP: PART_ANI_PLAY)); } void StatusBar::newFrame() { Command* cmd = CommandsModule::instance()->getCommandByName(CommandId::NewFrame); UIContext::instance()->executeCommand(cmd); - updateCurrentFrame(); + updateCurrentFrame(current_editor); } } // namespace app diff --git a/src/app/ui/status_bar.h b/src/app/ui/status_bar.h index 2ee3720dc..87124987f 100644 --- a/src/app/ui/status_bar.h +++ b/src/app/ui/status_bar.h @@ -11,7 +11,6 @@ #include "app/color.h" #include "base/observers.h" -#include "doc/context_observer.h" #include "doc/layer_index.h" #include "ui/base.h" #include "ui/link_label.h" @@ -29,6 +28,8 @@ namespace ui { } namespace app { + class ButtonSet; + class Editor; class StatusBar; namespace tools { @@ -50,8 +51,7 @@ namespace app { double m_pos; }; - class StatusBar : public ui::Widget - , public doc::ContextObserver { + class StatusBar : public ui::Widget { static StatusBar* m_instance; public: static StatusBar* instance() { return m_instance; } @@ -66,6 +66,8 @@ namespace app { void showColor(int msecs, const char* text, const Color& color, int alpha); void showTool(int msecs, tools::Tool* tool); + void updateUsingEditor(Editor* editor); + // Methods to add and remove progress bars Progress* addProgress(); void removeProgress(Progress* progress); @@ -75,15 +77,13 @@ namespace app { void onPreferredSize(ui::PreferredSizeEvent& ev) override; void onPaint(ui::PaintEvent& ev) override; - // ContextObserver impl - void onSetActiveDocument(doc::Document* document) override; - private: void onCurrentToolChange(); - void updateFromDocument(); - void updateFromLayer(); - void updateCurrentFrame(); + void updateFromDocument(Editor* editor); + void updateCurrentFrame(Editor* editor); + void updatePlayButton(Editor* editor); void newFrame(); + void onPlayButton(); enum State { SHOW_TEXT, SHOW_COLOR, SHOW_TOOL }; @@ -107,11 +107,7 @@ namespace app { 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 - ui::Button* m_b_first; // Go to first frame - ui::Button* m_b_prev; // Go to previous frame - ui::Button* m_b_play; // Play animation - ui::Button* m_b_next; // Go to next frame - ui::Button* m_b_last; // Go to last frame + ButtonSet* m_buttonSet; // Tip window class CustomizedTipWindow; diff --git a/src/app/ui_context.cpp b/src/app/ui_context.cpp index ce602898c..bc68cbee8 100644 --- a/src/app/ui_context.cpp +++ b/src/app/ui_context.cpp @@ -20,6 +20,7 @@ #include "app/ui/editor/editor.h" #include "app/ui/main_window.h" #include "app/ui/preview_editor.h" +#include "app/ui/status_bar.h" #include "app/ui/timeline.h" #include "app/ui/workspace.h" #include "app/ui/workspace_tabs.h" @@ -97,6 +98,7 @@ void UIContext::setActiveView(DocumentView* docView) mainWin->getPreviewEditor()->updateUsingEditor(current_editor); mainWin->getTimeline()->updateUsingEditor(current_editor); + StatusBar::instance()->updateUsingEditor(current_editor); // Change the image-type of color bar. ColorBar::instance()->setPixelFormat(app_get_current_pixel_format());