mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 01:20:17 +00:00
Don't focus context bar when we use selection behavior modifiers (fix #1103)
This commit is contained in:
parent
c99a187256
commit
918acb6bc8
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -322,15 +322,15 @@ int ButtonSet::selectedItem() const
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ButtonSet::setSelectedItem(int index)
|
||||
void ButtonSet::setSelectedItem(int index, bool focusItem)
|
||||
{
|
||||
if (index >= 0 && index < (int)children().size())
|
||||
setSelectedItem(static_cast<Item*>(at(index)));
|
||||
setSelectedItem(static_cast<Item*>(at(index)), focusItem);
|
||||
else
|
||||
setSelectedItem(static_cast<Item*>(NULL));
|
||||
setSelectedItem(static_cast<Item*>(nullptr), focusItem);
|
||||
}
|
||||
|
||||
void ButtonSet::setSelectedItem(Item* item)
|
||||
void ButtonSet::setSelectedItem(Item* item, bool focusItem)
|
||||
{
|
||||
if (!m_multipleSelection) {
|
||||
if (item && item->isSelected())
|
||||
@ -343,7 +343,8 @@ void ButtonSet::setSelectedItem(Item* item)
|
||||
|
||||
if (item) {
|
||||
item->setSelected(!item->isSelected());
|
||||
item->requestFocus();
|
||||
if (focusItem)
|
||||
item->requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -44,8 +44,8 @@ namespace app {
|
||||
Item* getItem(int index);
|
||||
|
||||
int selectedItem() const;
|
||||
void setSelectedItem(int index);
|
||||
void setSelectedItem(Item* item);
|
||||
void setSelectedItem(int index, bool focusItem = true);
|
||||
void setSelectedItem(Item* item, bool focusItem = true);
|
||||
void deselectItems();
|
||||
|
||||
void setOfferCapture(bool state);
|
||||
|
@ -1112,7 +1112,7 @@ public:
|
||||
}
|
||||
|
||||
void setSelectionMode(gen::SelectionMode mode) {
|
||||
setSelectedItem((int)mode);
|
||||
setSelectedItem((int)mode, false);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user