diff options
author | fvogel <fvogelnew1@free.fr> | 2017-04-03 06:29:04 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2017-04-03 06:29:04 (GMT) |
commit | d74ea96f8de64d42ea66d687e6ce4df95c2a1849 (patch) | |
tree | 8dfc746cf50436f76f671f78e3825fe6370c6494 | |
parent | b067e33b380775ccdb269def17dfb8699f22bf5a (diff) | |
download | tk-d74ea96f8de64d42ea66d687e6ce4df95c2a1849.zip tk-d74ea96f8de64d42ea66d687e6ce4df95c2a1849.tar.gz tk-d74ea96f8de64d42ea66d687e6ce4df95c2a1849.tar.bz2 |
Fix [2912962fff]: Notebook does not set TTK_STATE_USER1. Patch from Jos Decoster.
-rw-r--r-- | generic/ttk/ttkNotebook.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 81a8b64..726257d 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -295,6 +295,7 @@ static Ttk_State TabState(Notebook *nb, int index) { Ttk_State state = nb->core.state; Tab *tab = Ttk_SlaveData(nb->notebook.mgr, index); + int i = 0; if (index == nb->notebook.currentIndex) { state |= TTK_STATE_SELECTED; @@ -305,8 +306,15 @@ static Ttk_State TabState(Notebook *nb, int index) if (index == nb->notebook.activeIndex) { state |= TTK_STATE_ACTIVE; } - if (index == 0) { - state |= TTK_STATE_USER1; + for (i = 0; i < Ttk_NumberSlaves(nb->notebook.mgr); ++i) { + Tab *tab = Ttk_SlaveData(nb->notebook.mgr, i); + if (tab->state == TAB_STATE_HIDDEN) { + continue; + } + if (index == i) { + state |= TTK_STATE_USER1; + } + break; } if (index == Ttk_NumberSlaves(nb->notebook.mgr) - 1) { state |= TTK_STATE_USER2; |