From c5ac86725db2296eefc52268d7617393a70abd5b Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 7 May 2021 04:50:26 +0200 Subject: [PATCH] Two gigaseconds (#147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix look of position time field to match the rest of the UI. * Fix typo. * Improve position time display. * Add days, hours support to position time display. * Fix "Current Time" toolbar item geometry/layout. * Don’t enforce leading double-digits in position time display. * MainMenu.xib touched by Xcode. * Implement and use MonospacedDigitTextFieldCell. This way the digits of numbers in playlist columns consisting of mostly digits will be aligned vertically. * Disable font scaling code without effect. * Set "Current Time" toolbar item to use MonospacedDigitTextFieldCell. * Improve SecondsFormatter. * Merge in SecondsFormatter improvements from Play. * Move formatter setup into XIB. * Add CogTests. These can later be used for integration tests. * Add SecondsFormatterTests. Tests are stubbed out. * Pouring foundation for SecondsFormatterTests. * Implement -testPositive. * Replace unsigned with int in SecondsFormatter. * Implement negative support, tests. * Rewrite SecondsFormatter in preparation for better readability.. * Rewrite SecondsFormatter for better readability. * Add negative zero support. * Improve SecondsFormatter readability. * Refactor into -stringForTimeInterval: in SecondsFormatter. * Cleanup. * Mark TimeField as space-indented. * Replace custom time formatting code in TimeField with SecondsFormatter. * Cleanup. * Improve SecondsFormatter format strings. * Add internal type for time calculations. Co-authored-by: Jan Weiß --- Base.lproj/MainMenu.xib | 326 +++++++++--------- Cog.xcodeproj/project.pbxproj | 298 +++++++++++++++- .../xcshareddata/xcschemes/Cog.xcscheme | 10 + .../xcschemes/SecondsFormatterTests.xcscheme | 52 +++ CogTests/CogTests.m | 36 ++ CogTests/Info.plist | 22 ++ Formatters/SecondsFormatter.h | 2 + Formatters/SecondsFormatter.m | 212 +++++++++--- Playlist/PlaylistView.m | 20 +- SecondsFormatterTests/Info.plist | 22 ++ SecondsFormatterTests/SecondsFormatterTests.m | 131 +++++++ Utils/MonospacedDigitTextFieldCell.h | 18 + Utils/MonospacedDigitTextFieldCell.m | 23 ++ Window/PositionSlider.m | 6 +- Window/TimeField.h | 4 +- Window/TimeField.m | 51 ++- 16 files changed, 996 insertions(+), 237 deletions(-) create mode 100644 Cog.xcodeproj/xcshareddata/xcschemes/SecondsFormatterTests.xcscheme create mode 100644 CogTests/CogTests.m create mode 100644 CogTests/Info.plist create mode 100644 SecondsFormatterTests/Info.plist create mode 100644 SecondsFormatterTests/SecondsFormatterTests.m create mode 100644 Utils/MonospacedDigitTextFieldCell.h create mode 100644 Utils/MonospacedDigitTextFieldCell.m diff --git a/Base.lproj/MainMenu.xib b/Base.lproj/MainMenu.xib index 854465c55..8ca33ddec 100644 --- a/Base.lproj/MainMenu.xib +++ b/Base.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -18,7 +18,7 @@ - + @@ -46,7 +46,8 @@ - + + @@ -147,16 +148,18 @@ - + + - + - + + 0 @@ -167,7 +170,8 @@ - + + @@ -200,7 +204,8 @@ - + + @@ -291,7 +296,7 @@ - + @@ -412,10 +417,10 @@ - + - - + + @@ -567,7 +572,7 @@ - +