@@ -980,16 +980,17 @@ static void TabElementSize(
980980 TCL_UNUSED (int * ), /* heightPtr */
981981 Ttk_Padding * paddingPtr )
982982{
983- Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S ;
983+ Ttk_PositionSpec nbTabPlacementStickBit = TTK_STICK_S ;
984984 TkMainInfo * mainInfoPtr = ((TkWindow * ) tkwin )-> mainPtr ;
985985 int borderWidth = 2 ;
986986
987987 if (mainInfoPtr != NULL ) {
988- nbTabsStickBit = (Ttk_PositionSpec ) mainInfoPtr -> ttkNbTabsStickBit ;
988+ nbTabPlacementStickBit =
989+ (Ttk_PositionSpec ) (mainInfoPtr -> nbTabPlacement & 0x0f );
989990 }
990991
991992 * paddingPtr = Ttk_UniformPadding ((short )borderWidth );
992- switch (nbTabsStickBit ) {
993+ switch (nbTabPlacementStickBit ) {
993994 default :
994995 case TTK_STICK_S :
995996 paddingPtr -> bottom = 0 ;
@@ -1014,7 +1015,8 @@ static void TabElementDraw(
10141015 Ttk_Box b ,
10151016 Ttk_State state )
10161017{
1017- Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S ;
1018+ Ttk_PositionSpec nbTabPosStickBit = TTK_STICK_W ;
1019+ Ttk_PositionSpec nbTabPlcStickBit = TTK_STICK_S ;
10181020 TkMainInfo * mainInfoPtr = ((TkWindow * ) tkwin )-> mainPtr ;
10191021 int borderWidth = 2 , delta = 0 ;
10201022 NotebookElement * tab = (NotebookElement * )elementRecord ;
@@ -1025,14 +1027,17 @@ static void TabElementDraw(
10251027 const int w = WIN32_XDRAWLINE_HACK ;
10261028
10271029 if (mainInfoPtr != NULL ) {
1028- nbTabsStickBit = (Ttk_PositionSpec ) mainInfoPtr -> ttkNbTabsStickBit ;
1030+ nbTabPosStickBit =
1031+ (Ttk_PositionSpec ) (mainInfoPtr -> nbTabPosition & 0x0f );
1032+ nbTabPlcStickBit =
1033+ (Ttk_PositionSpec ) (mainInfoPtr -> nbTabPlacement & 0x0f );
10291034 }
10301035
10311036 if (state & TTK_STATE_SELECTED ) {
10321037 delta = borderWidth ;
10331038 }
10341039
1035- switch (nbTabsStickBit ) {
1040+ switch (nbTabPlcStickBit ) {
10361041 default :
10371042 case TTK_STICK_S :
10381043 if (state & TTK_STATE_LAST ) { /* rightmost tab */
@@ -1048,9 +1053,14 @@ static void TabElementDraw(
10481053
10491054 gc = Ttk_GCForColor (tkwin , tab -> borderColorObj , d );
10501055 XDrawLine (display , d , gc , x1 , y1 + 1 , x1 , y2 + 1 + w );
1051- XDrawLine (display , d , gc , x2 , y1 + 1 , x2 , y2 + 1 + w );
10521056 XDrawLine (display , d , gc , x1 + 1 , y1 , x2 - 1 + w , y1 );
10531057
1058+ if ((state & TTK_STATE_LAST ) && nbTabPosStickBit == TTK_STICK_E ) {
1059+ XDrawLine (display , d , gc , x2 , y1 + 1 , x2 , y2 + 2 + w );
1060+ } else {
1061+ XDrawLine (display , d , gc , x2 , y1 + 1 , x2 , y2 + 1 + w );
1062+ }
1063+
10541064 gc = Ttk_GCForColor (tkwin , tab -> lightColorObj , d );
10551065 XDrawLine (display , d , gc , x1 + 1 , y1 + 1 , x1 + 1 , y2 + delta + w );
10561066 XDrawLine (display , d , gc , x1 + 1 , y1 + 1 , x2 - 1 + w , y1 + 1 );
@@ -1070,9 +1080,14 @@ static void TabElementDraw(
10701080
10711081 gc = Ttk_GCForColor (tkwin , tab -> borderColorObj , d );
10721082 XDrawLine (display , d , gc , x1 , y1 - 1 , x1 , y2 - 1 - w );
1073- XDrawLine (display , d , gc , x2 , y1 - 1 , x2 , y2 - 1 - w );
10741083 XDrawLine (display , d , gc , x1 + 1 , y1 , x2 - 1 + w , y1 );
10751084
1085+ if ((state & TTK_STATE_LAST ) && nbTabPosStickBit == TTK_STICK_E ) {
1086+ XDrawLine (display , d , gc , x2 , y1 - 1 , x2 , y2 - 2 - w );
1087+ } else {
1088+ XDrawLine (display , d , gc , x2 , y1 - 1 , x2 , y2 - 1 - w );
1089+ }
1090+
10761091 gc = Ttk_GCForColor (tkwin , tab -> lightColorObj , d );
10771092 XDrawLine (display , d , gc , x1 + 1 , y1 - 1 , x1 + 1 , y2 - delta - w );
10781093 XDrawLine (display , d , gc , x1 + 1 , y1 - 1 , x2 - 1 + w , y1 - 1 );
@@ -1093,7 +1108,12 @@ static void TabElementDraw(
10931108 gc = Ttk_GCForColor (tkwin , tab -> borderColorObj , d );
10941109 XDrawLine (display , d , gc , x1 , y1 + 1 , x1 , y2 - 1 + w );
10951110 XDrawLine (display , d , gc , x1 + 1 , y1 , x2 + 1 + w , y1 );
1096- XDrawLine (display , d , gc , x1 + 1 , y2 , x2 + 1 + w , y2 );
1111+
1112+ if ((state & TTK_STATE_LAST ) && nbTabPosStickBit == TTK_STICK_S ) {
1113+ XDrawLine (display , d , gc , x1 + 1 , y2 , x2 + 2 + w , y2 );
1114+ } else {
1115+ XDrawLine (display , d , gc , x1 + 1 , y2 , x2 + 1 + w , y2 );
1116+ }
10971117
10981118 gc = Ttk_GCForColor (tkwin , tab -> lightColorObj , d );
10991119 XDrawLine (display , d , gc , x1 + 1 , y1 + 1 , x1 + 1 , y2 - 1 + w );
@@ -1115,7 +1135,12 @@ static void TabElementDraw(
11151135 gc = Ttk_GCForColor (tkwin , tab -> borderColorObj , d );
11161136 XDrawLine (display , d , gc , x1 , y1 + 1 , x1 , y2 - 1 + w );
11171137 XDrawLine (display , d , gc , x1 - 1 , y1 , x2 - 1 - w , y1 );
1118- XDrawLine (display , d , gc , x1 - 1 , y2 , x2 - 1 - w , y2 );
1138+
1139+ if ((state & TTK_STATE_LAST ) && nbTabPosStickBit == TTK_STICK_S ) {
1140+ XDrawLine (display , d , gc , x1 - 1 , y2 , x2 - 2 - w , y2 );
1141+ } else {
1142+ XDrawLine (display , d , gc , x1 - 1 , y2 , x2 - 1 - w , y2 );
1143+ }
11191144
11201145 gc = Ttk_GCForColor (tkwin , tab -> lightColorObj , d );
11211146 XDrawLine (display , d , gc , x1 - 1 , y1 + 1 , x1 - 1 , y2 - 1 + w );
0 commit comments