mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 18:00:26 +00:00
Fix regression with Pal Edit button
The icon/stylus was inverted. We've also moved the icon for each state to the theme xml (so we don't need to use setIcon() manually anymore for this button).
This commit is contained in:
parent
9332642de9
commit
5ea89141fd
@ -1074,12 +1074,14 @@
|
||||
<style id="selection_mode" extends="context_bar_button" padding-top="1" />
|
||||
<style id="symmetry_field" extends="context_bar_button" padding-top="1" />
|
||||
<style id="symmetry_options" extends="context_bar_text_button" padding-left="3" padding-bottom="3" />
|
||||
<style id="pal_edit_button" extends="buttonset_item_icon" width="15" />
|
||||
<style id="pal_edit_button_hot" extends="buttonset_item" width="15">
|
||||
<style id="pal_edit_button_lock" extends="buttonset_item_icon" width="15">
|
||||
<icon part="timeline_closed_padlock_normal" />
|
||||
<icon part="timeline_closed_padlock_normal" state="capture selected" />
|
||||
</style>
|
||||
<style id="pal_edit_button_unlock" extends="pal_edit_button_lock">
|
||||
<background color="edit_pal_face" />
|
||||
<icon />
|
||||
<icon state="disabled" color="disabled" />
|
||||
<icon state="capture selected" color="button_selected_text" />
|
||||
<newlayer />
|
||||
<icon part="timeline_open_padlock_active" />
|
||||
</style>
|
||||
<style id="pal_button" extends="buttonset_item_icon" minwidth="15" padding-top="1" />
|
||||
<style id="debugger_button" extends="buttonset_item_icon" width="17" height="19" />
|
||||
|
@ -186,11 +186,12 @@ ColorBar::ColorBar(int align, TooltipManager* tooltipManager)
|
||||
|
||||
auto theme = SkinTheme::get(this);
|
||||
|
||||
auto item = m_editPal.addItem(theme->parts.timelineOpenPadlockActive());
|
||||
auto item = m_editPal.addItem("");
|
||||
item->InitTheme.connect(
|
||||
[this, item](){
|
||||
auto style = m_editMode ? SkinTheme::instance()->styles.palEditButton() :
|
||||
SkinTheme::instance()->styles.palEditButtonHot();
|
||||
auto style =
|
||||
(m_editMode ? SkinTheme::instance()->styles.palEditButtonUnlock() :
|
||||
SkinTheme::instance()->styles.palEditButtonLock());
|
||||
item->setStyle(style);
|
||||
});
|
||||
m_buttons.addItem(theme->parts.palSort(), "pal_button");
|
||||
@ -532,13 +533,12 @@ bool ColorBar::inEditMode() const
|
||||
|
||||
void ColorBar::setEditMode(bool state)
|
||||
{
|
||||
auto theme = SkinTheme::get(this);
|
||||
ButtonSet::Item* item = m_editPal.getItem(0);
|
||||
|
||||
m_editMode = state;
|
||||
item->setIcon(state ? theme->parts.timelineClosedPadlockNormal():
|
||||
theme->parts.timelineOpenPadlockActive());
|
||||
|
||||
// The item icon/style will be set depending on m_editMode state.
|
||||
ButtonSet::Item* item = m_editPal.getItem(0);
|
||||
item->initTheme();
|
||||
item->invalidate();
|
||||
|
||||
// Deselect color entries when we cancel editing
|
||||
if (!state)
|
||||
|
Loading…
Reference in New Issue
Block a user