mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-27 03:16:58 +00:00
Fixed a couple of bugs:
+ in tabs_remove_tab selected/hot tabs are set to NULL. + the select_callback is called only for the hot tab (if hot is NULL, now the selected is not used anymore).
This commit is contained in:
parent
50ec2cdff9
commit
b585600a19
@ -132,6 +132,9 @@ void tabs_remove_tab(JWidget widget, void *data)
|
||||
Tab *tab = get_tab_by_data(widget, data);
|
||||
|
||||
if (tab) {
|
||||
if (tabs->hot == tab) tabs->hot = NULL;
|
||||
if (tabs->selected == tab) tabs->selected = NULL;
|
||||
|
||||
jlist_remove(tabs->list_of_tabs, tab);
|
||||
delete tab;
|
||||
|
||||
@ -302,15 +305,17 @@ static bool tabs_msg_proc(JWidget widget, JMessage msg)
|
||||
return TRUE;
|
||||
|
||||
case JM_BUTTONPRESSED:
|
||||
if (tabs->selected != tabs->hot && tabs->hot != NULL) {
|
||||
tabs->selected = tabs->hot;
|
||||
jwidget_dirty(widget);
|
||||
}
|
||||
if (tabs->hot != NULL) {
|
||||
if (tabs->selected != tabs->hot) {
|
||||
tabs->selected = tabs->hot;
|
||||
jwidget_dirty(widget);
|
||||
}
|
||||
|
||||
if (tabs->selected && tabs->select_callback)
|
||||
(*tabs->select_callback)(widget,
|
||||
tabs->selected->data,
|
||||
msg->mouse.flags);
|
||||
if (tabs->selected && tabs->select_callback)
|
||||
(*tabs->select_callback)(widget,
|
||||
tabs->selected->data,
|
||||
msg->mouse.flags);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case JM_WHEEL: {
|
||||
|
Loading…
Reference in New Issue
Block a user