Add ui::MenuSeparator widget

This commit is contained in:
David Capello 2015-06-24 13:14:41 -03:00
parent e4df25f4df
commit b12e6c3398
5 changed files with 15 additions and 9 deletions

View File

@ -209,7 +209,7 @@ Widget* AppMenus::convertXmlelemToMenuitem(TiXmlElement* elem)
{
// is it a <separator>?
if (strcmp(elem->Value(), "separator") == 0)
return new Separator("", HORIZONTAL);
return new MenuSeparator;
const char* command_name = elem->Attribute("command");
Command* command =
@ -265,7 +265,7 @@ Widget* AppMenus::createInvalidVersionMenuitem()
subMenu->addChild(new AppMenuItem(PACKAGE " is using a customized gui.xml (maybe from your HOME directory)."));
subMenu->addChild(new AppMenuItem("You should update your customized gui.xml file to the new version to get"));
subMenu->addChild(new AppMenuItem("the latest commands available."));
subMenu->addChild(new Separator("", HORIZONTAL));
subMenu->addChild(new MenuSeparator);
subMenu->addChild(new AppMenuItem("You can bypass this validation adding the correct version"));
subMenu->addChild(new AppMenuItem("number in <gui version=\"" VERSION "\"> element."));
menuitem->setSubmenu(subMenu);

View File

@ -72,7 +72,7 @@ protected:
deleteAllItem.Click.connect(&Item::onDeleteAllBrushes, this);
menu.addChild(&lockItem);
menu.addChild(&deleteItem);
menu.addChild(new Separator("", HORIZONTAL));
menu.addChild(new MenuSeparator);
menu.addChild(&deleteAllItem);
// Here we make the popup window temporaly floating, so it's

View File

@ -299,12 +299,12 @@ void ColorBar::onPaletteButtonClick()
des("Descending");
menu.addChild(&rev);
menu.addChild(&grd);
menu.addChild(new ui::Separator("", HORIZONTAL));
menu.addChild(new ui::MenuSeparator);
menu.addChild(&hue);
menu.addChild(&sat);
menu.addChild(&bri);
menu.addChild(&lum);
menu.addChild(new ui::Separator("", HORIZONTAL));
menu.addChild(new ui::MenuSeparator);
menu.addChild(&asc);
menu.addChild(&des);

View File

@ -1612,7 +1612,7 @@ void Editor::showAnimationSpeedMultiplierPopup(bool withStopBehaviorOptions)
}
if (withStopBehaviorOptions) {
menu.addChild(new Separator("", HORIZONTAL));
menu.addChild(new MenuSeparator);
MenuItem* item = new MenuItem("Rewind on Stop");
item->Click.connect(
[]() {

View File

@ -1,5 +1,5 @@
// Aseprite UI Library
// Copyright (C) 2001-2013 David Capello
// Copyright (C) 2001-2013, 2015 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@ -11,6 +11,7 @@
#include "base/signal.h"
#include "base/unique_ptr.h"
#include "ui/register_message.h"
#include "ui/separator.h"
#include "ui/widget.h"
namespace ui {
@ -19,8 +20,7 @@ namespace ui {
class Timer;
struct MenuBaseData;
class Menu : public Widget
{
class Menu : public Widget {
public:
Menu();
~Menu();
@ -147,6 +147,12 @@ namespace ui {
friend class MenuBox;
};
class MenuSeparator : public Separator {
public:
MenuSeparator() : Separator("", HORIZONTAL) {
}
};
extern RegisterMessage kOpenMenuItemMessage;
extern RegisterMessage kCloseMenuItemMessage;
extern RegisterMessage kClosePopupMessage;