Make ctrl+shift+click toggle favorite status
This commit is contained in:
parent
27f5ba199d
commit
a3a3b3be1a
@ -20,7 +20,7 @@ bool Favorite::IsFavorite(ByteString identifier)
|
|||||||
|
|
||||||
bool Favorite::AnyFavorites()
|
bool Favorite::AnyFavorites()
|
||||||
{
|
{
|
||||||
return favoritesList.size() == 0;
|
return favoritesList.size() != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Favorite::AddFavorite(ByteString identifier)
|
void Favorite::AddFavorite(ByteString identifier)
|
||||||
|
@ -543,15 +543,24 @@ public:
|
|||||||
ToolButton *sender = (ToolButton*)sender_;
|
ToolButton *sender = (ToolButton*)sender_;
|
||||||
if (v->ShiftBehaviour() && v->CtrlBehaviour() && !v->AltBehaviour())
|
if (v->ShiftBehaviour() && v->CtrlBehaviour() && !v->AltBehaviour())
|
||||||
{
|
{
|
||||||
if (Favorite::Ref().IsFavorite(tool->GetIdentifier()) && sender->GetSelectionState() == 1)
|
if (sender->GetSelectionState() == 0)
|
||||||
|
{
|
||||||
|
if (Favorite::Ref().IsFavorite(tool->GetIdentifier()))
|
||||||
|
{
|
||||||
Favorite::Ref().RemoveFavorite(tool->GetIdentifier());
|
Favorite::Ref().RemoveFavorite(tool->GetIdentifier());
|
||||||
else if (sender->GetSelectionState() == 0)
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Favorite::Ref().AddFavorite(tool->GetIdentifier());
|
Favorite::Ref().AddFavorite(tool->GetIdentifier());
|
||||||
else if (sender->GetSelectionState() == 2)
|
}
|
||||||
v->c->SetActiveMenu(SC_FAVORITES);
|
|
||||||
|
|
||||||
v->c->RebuildFavoritesMenu();
|
v->c->RebuildFavoritesMenu();
|
||||||
}
|
}
|
||||||
|
else if (sender->GetSelectionState() == 1)
|
||||||
|
{
|
||||||
|
Favorite::Ref().RemoveFavorite(tool->GetIdentifier());
|
||||||
|
v->c->RebuildFavoritesMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (v->CtrlBehaviour() && v->AltBehaviour() && !v->ShiftBehaviour())
|
if (v->CtrlBehaviour() && v->AltBehaviour() && !v->ShiftBehaviour())
|
||||||
@ -612,8 +621,8 @@ void GameView::NotifyMenuListChanged(GameModel * sender)
|
|||||||
String tempString = "";
|
String tempString = "";
|
||||||
tempString += menuList[i]->GetIcon();
|
tempString += menuList[i]->GetIcon();
|
||||||
String description = menuList[i]->GetDescription();
|
String description = menuList[i]->GetDescription();
|
||||||
if (i == SC_FAVORITES && Favorite::Ref().AnyFavorites())
|
if (i == SC_FAVORITES && !Favorite::Ref().AnyFavorites())
|
||||||
description += " (Use ctrl+shift+click to favorite an element)";
|
description += " (Use ctrl+shift+click toggle the favorite status of an element)";
|
||||||
ui::Button * tempButton = new ui::Button(ui::Point(WINDOWW-16, currentY), ui::Point(15, 15), tempString, description);
|
ui::Button * tempButton = new ui::Button(ui::Point(WINDOWW-16, currentY), ui::Point(15, 15), tempString, description);
|
||||||
tempButton->Appearance.Margin = ui::Border(0, 2, 3, 2);
|
tempButton->Appearance.Margin = ui::Border(0, 2, 3, 2);
|
||||||
tempButton->SetTogglable(true);
|
tempButton->SetTogglable(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user