diff options
author | Kevin Walzer <kw@codebykevin.com> | 2021-08-22 01:57:21 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2021-08-22 01:57:21 (GMT) |
commit | 6efcf291c8d6222a6b808f3cdfca5ddf249661dd (patch) | |
tree | 921766a9ad9eb215d741c6e1274bad25eaae6bcc | |
parent | d0ef3d76b3cbe0e0b35d0e90b27d48cfcc83e8a5 (diff) | |
download | tk-6efcf291c8d6222a6b808f3cdfca5ddf249661dd.zip tk-6efcf291c8d6222a6b808f3cdfca5ddf249661dd.tar.gz tk-6efcf291c8d6222a6b808f3cdfca5ddf249661dd.tar.bz2 |
Clean up some hiccups in X11 implementation
-rw-r--r-- | library/iconbadges.tcl | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/library/iconbadges.tcl b/library/iconbadges.tcl index 1d25a20..4d4d8a8 100644 --- a/library/iconbadges.tcl +++ b/library/iconbadges.tcl @@ -220,13 +220,43 @@ if {[tk windowingsystem] eq "x11"} { wm iconphoto $win $::tk::icons::base_icon - if {[expr $badgenumber > 9] == 1} { - set badge ::tk::icons::9plus-badge - } else if {$badgenumber eq "!"} { - set badge ::tk::icons::!-badge - } else { - set badge ::tk::icons::$badgenumber-badge - } + switch $badgenumber { + ! { + set badge ::tk::icons::!-badge + } + 1 { + set badge ::tk::icons::$badgenumber-badge + } + 2 { + set badge ::tk::icons::$badgenumber-badge + } + 3 { + set badge ::tk::icons::$badgenumber-badge + } + 4 { + set badge ::tk::icons::$badgenumber-badge + } + 5 { + set badge ::tk::icons::$badgenumber-badge + } + 6 { + set badge ::tk::icons::$badgenumber-badge + } + 7 { + set badge ::tk::icons::$badgenumber-badge + } + 8 { + set badge ::tk::icons::$badgenumber-badge + } + 9 { + set badge ::tk::icons::$badgenumber-badge + } + + default { + set badge ::tk::icons::9plus-badge + } + + } update idletasks overlay copy $::tk::icons::base_icon @@ -234,4 +264,4 @@ if {[tk windowingsystem] eq "x11"} { wm iconphoto $win overlay } -} +}
\ No newline at end of file |