summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkProgress.c
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2020-12-14 23:50:14 (GMT)
committermarc_culler <marc.culler@gmail.com>2020-12-14 23:50:14 (GMT)
commit063b218f2d7e9b7e05452b79c520f312da3b8490 (patch)
tree16d9c1582353d137c75ec5620dcab23c2e1e673a /generic/ttk/ttkProgress.c
parent0bb310366d8c74f3e467949ccd797bc7dadd7d0c (diff)
downloadtk-063b218f2d7e9b7e05452b79c520f312da3b8490.zip
tk-063b218f2d7e9b7e05452b79c520f312da3b8490.tar.gz
tk-063b218f2d7e9b7e05452b79c520f312da3b8490.tar.bz2
Fix [80e4c6f695]: progress bars are weird on macOS 11.0.
Diffstat (limited to 'generic/ttk/ttkProgress.c')
-rw-r--r--generic/ttk/ttkProgress.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c
index ae945ae..42da84d 100644
--- a/generic/ttk/ttkProgress.c
+++ b/generic/ttk/ttkProgress.c
@@ -102,7 +102,6 @@ static void AnimateProgressProc(ClientData clientData)
Progressbar *pb = (Progressbar *)clientData;
pb->progress.timer = 0;
-
if (AnimationEnabled(pb)) {
int phase = 0;
Tcl_GetIntFromObj(NULL, pb->progress.phaseObj, &phase);
@@ -110,9 +109,11 @@ static void AnimateProgressProc(ClientData clientData)
/*
* Update -phase:
*/
+
++phase;
- if (pb->progress.maxPhase)
- phase %= pb->progress.maxPhase;
+ if (phase > pb->progress.maxPhase) {
+ phase = 0;
+ }
Tcl_DecrRefCount(pb->progress.phaseObj);
pb->progress.phaseObj = Tcl_NewIntObj(phase);
Tcl_IncrRefCount(pb->progress.phaseObj);
@@ -120,9 +121,9 @@ static void AnimateProgressProc(ClientData clientData)
/*
* Reschedule:
*/
+
pb->progress.timer = Tcl_CreateTimerHandler(
pb->progress.period, AnimateProgressProc, clientData);
-
TtkRedisplayWidget(&pb->core);
}
}