diff options
author | fvogel <fvogelnew1@free.fr> | 2017-04-03 14:44:48 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2017-04-03 14:44:48 (GMT) |
commit | 914ca2a804f2d3e32ab2da849bf5070166803b48 (patch) | |
tree | e050d40a799fecba2dd7b65c528e014b079d6a0d /generic/ttk | |
parent | bacd73b98df4a66b93db07b702a59ea4e9d0206e (diff) | |
download | tk-914ca2a804f2d3e32ab2da849bf5070166803b48.zip tk-914ca2a804f2d3e32ab2da849bf5070166803b48.tar.gz tk-914ca2a804f2d3e32ab2da849bf5070166803b48.tar.bz2 |
Fixed TTK_STATE_USER2 similarly as TTK_STATE_USER1. These bits are set for the leftmost and rightmost *visible* (i.e. non hidden) tabs
Diffstat (limited to 'generic/ttk')
-rw-r--r-- | generic/ttk/ttkNotebook.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 726257d..2bb9f82 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -288,8 +288,8 @@ static void ActivateTab(Notebook *nb, int index) * TabState -- * Return the state of the specified tab, based on * notebook state, currentIndex, activeIndex, and user-specified tab state. - * The USER1 bit is set for the leftmost tab, and USER2 - * is set for the rightmost tab. + * The USER1 bit is set for the leftmost visible tab, and USER2 + * is set for the rightmost visible tab. */ static Ttk_State TabState(Notebook *nb, int index) { @@ -316,8 +316,15 @@ static Ttk_State TabState(Notebook *nb, int index) } break; } - if (index == Ttk_NumberSlaves(nb->notebook.mgr) - 1) { - state |= TTK_STATE_USER2; + for (i = Ttk_NumberSlaves(nb->notebook.mgr) - 1; i >= 0; --i) { + Tab *tab = Ttk_SlaveData(nb->notebook.mgr, i); + if (tab->state == TAB_STATE_HIDDEN) { + continue; + } + if (index == i) { + state |= TTK_STATE_USER2; + } + break; } if (tab->state == TAB_STATE_DISABLED) { state |= TTK_STATE_DISABLED; |