| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Removed executable bit from regular files | 10 年前 | |
Update dark mode branch colors (#540) | 7 年前 | |
Fixes #597 Xcode 11 warnings (#598) | 6 年前 | |
Revert "Some MRC to ARC conversions in GitUpKit (#827)" 9282c9b0ced859c2f86aaee55ec97b6aa3e26692 | 3 年前 | |
Add key navigation between index and workdir files (#921) * Add key navigation between index and workdir files Navigate to index files controller when Down button pressed while on the last file of the workdir list Navigate to workdir files controller when Up button pressed while on the first files of the index list * Use NSEventModifierFlags for declared modifiers Use more precise type for long flags | 3 年前 | |
Text size setting (#620) * Add font size user defaults key Users should be able to control text size. The value in this user defaults key is the starting point for allowing any part of the GitUp UI to be scalable. One limitation of storing the font size in the standard user defaults is that this is global state so an app using GitUpKit that wants to show two diff views at the same time would not be able to make them use different font sizes. I don’t think this use case is particularly important. As a framework, GitUpKit should not register default values in user defaults, and it can’t guarantee that the app using GitUpKit registers a sensible default for this key. Therefore the font size should always be read from user defaults wrapped in a `GIFontSize()` function call, which ensures the value is greater than zero The `GIFontSize` function was put in `GIAppKit.h/m` because that’s where other GitUpKit user defaults keys are defined. I didn’t think this fits in in `GIFunctions` because it’s only available in the Mac version of GitUpKit. Putting it in `GIFunctions` wrapped in `#if __GI_HAS_APPKIT__` would work too but makes less sense to me. I thought it would be messy to do the `#ifdef __cplusplus` like in `GIFunctions` for this one function, so I used `FOUNDATION_EXPORT`. (My preferred way to do this would be to drop the `#ifdef __cplusplus` from `GIFunctions` and define a `GIEXPORT` used for every public function.) Naming of the constant: I mirrored `GICommitMessageViewUserDefaultKey_ShowMargins` but removed the `CommitMessageView` part because this one is more general. * Update MainMenu.xib Modifications made automatically by Xcode 11.3 when opening first making a change to the file. There is nothing meaningful. This has been separated from the real change that is coming in the next commit. * Make commit message view scale with font size Must call `setNeedsDisplay:` otherwise the 50 and 72 character markers are sometimes not updated (such as when there is selected text). The font size is 10% larger than the font size in user defaults, to match before where the font size here was 11 points compared to 10 in the diff view. * Add slider in Preferences to change font size Letting the user specify a scale but the application specify the typefaces and relative sizes seems like the best trade-off between allowing the user to see the app comfortably without asking them to be the designer. Also different views have use different fonts and relative sizes. Therefore, the user does not set an explicit typeface name or numerical size and instead a slider without value labels has been added to General Preferences to set the scale. This (deliberately) results in the exact size used hard to find. I decided to store the most obvious thing in user defaults: the font size used in the diff view in points. This simplicity comes at the cost of making the slider in Preferences more complicated as a linear slider would not be very good: the difference between 10 and 11 points is much more important than the difference between 18 and 19 points. A value transformer is used to map between the discrete slider value and a non-linear array of font sizes that match the preset sizes in the Mac system font picker. * Make diff view scale with font size The font size matches the font size from user defaults directly. The global variables associated with the diff view that have become properties on instances that update in `updateMetricsFromCurrentFontSize` when the user defaults change. Constants have been replaced by functions. The table view should always be reloaded when the font size changes to ensure the content size is correct. The threshold for switching from unified to split diff is now specified as a multiple of the font size. Similar scaling is used for drawing the column separators for line numbers and positioning text. This ensures the layout is the same as GitUp was designed except for being scaled. | 6 年前 | |
Bump to macOS 12.4 min target (#2785) * Bump to macOS 12.4 min target Uses angle bracket notation for public framework imports * Fix test cases | 4 个月前 | |
Fix highlight range computation for non-ascii characters (#2742) Fixes #2740 We were previously matching on the less specific 2-byte unicode point values, but this meant that something with with a 3 or 4 byte value (asian characters or emoji) would be first offset by 2 then loop incorrectly looking at the next character. The fix is to look for the largest byte match first and then narrow down to the smaller bit matches. | 9 个月前 | |
Updated upper copyright year to 2019 | 7 年前 | |
Fix highlight range computation for non-ascii characters (#2742) Fixes #2740 We were previously matching on the less specific 2-byte unicode point values, but this meant that something with with a 3 or 4 byte value (asian characters or emoji) would be first offset by 2 then loop incorrectly looking at the next character. The fix is to look for the largest byte match first and then narrow down to the smaller bit matches. | 9 个月前 | |
Updated upper copyright year to 2019 | 7 年前 | |
Updated upper copyright year to 2019 | 7 年前 | |
Run clang-format and revert GIFunctions code to original | 2 年前 | |
Diff between 2 arbitrary commits Co-authored-by: Guan Che <guan.che@ihandysoft.com> Fixes #257 | 4 年前 | |
Fix incorrect geometry for first point calculation | 5 个月前 | |
[Feature] Image Diff Preview (#748) * Introduce GIImageDiffView files This view will be used very similarly to GIDiffView, as both are variably sized diffing cell contents. * Attach GIImageDiffView to GIDiffContentData Again, similarly to the approach used for GIDiffView, we are attaching this content view to the diff data, so it can later be integrated into a cell. * Show a GIImageDiffCellView for image diffs Once again, this is mimicking GIDiffView and the associated GITextDiffCellView. For now we merely use the previously introduced imageDiffView as a way to identify whether an image cell should be shown. * Allow GIImageDiffView to request a height This will later be necessary to request enough height to display images at their full resolution (or a fraction of that depending on width constraints). * Inject GIImageDiffView into GIImageDiffCellView Following the example of GIDiffView, we attach (and detach) the content view to a designated cell. * Inject the repository into each GIImageDiffView To be able to export blobs of images later on, we'll need access to the repository. This commit lays the necessary foundation for that step. * Pass along the GCDiffDelta to GIImageDiffView Adds another necessary resource to be able to display images later on. * Add an image view for the current (new) image * Update the frame of the current image view * Update the current image when the delta is set This preliminary solution only covers showing the absolute newest version of the file and is therefore usually wrong. It does however establish the connection between delta, repository and the final image. * Avoid unnecessary image updates * Show the proper new file for all cases This code is very similar to the viewDeltasInDiffTool utility method, as we are fundamentally doing the same thing (exporting the image file referenced by the SHA1 value and then displaying it). The most noteworthy detail is that we are defaulting back to the canonical path for untracked files. * Add the second comparison image view * Position the old image view alongside the new one * Display the correct old comparison image This works analogous to the previously added updateNewImage method. The major difference is that we are looking at the oldFile and there is no fallback if it does not exist. * Add a method to calculate the combined image size The goal is to make the GIImageDiffView a slide style view image comparison tool, in which the two images are displayed in the same area, but hidden or revealed by sliding a divider across them. This method allows us to calculate how big this combined area needs to be. * Add a method to calculate the comparison frame This method is designed to work within a given frame and will return a rectangle that will provide the correct dimensions to display both the old and new image in a shared area. * Move old and new image into the shared area Currently this will overlay the old image over the new one. However, this is only setting up for the ability to partially hide both images. * Make the image diff view ask for the proper height Instead of asking for a somewhat random, large height to fit the image, we can now ask for exactly the required height. To do this, we try to fit the image at full resolution, but scale down according to width constraints if necessary. * Add percentage to keep track of shown fractions This property will be used to figure out how much to show of the old and new image. A value of 0 will represent showing just the new image, while a value of 1 will mean only the old image is shown. Everything in between will move the divider in between accordingly. * Reset the percentage when delta is updated * Partially hide the images according to percentage By using masking layers, we can easily hide parts of the old and new images. Originally, we considered drawing the images directly, but the draw calls turned out to be very slow. This mask layer solution seems to be about four times as fast. * Update the percentage according to mouse input By adding gesture recognizers to the view, we can use the entire image area as a large input field for the user to select the split between the old and new image. Whenever we change the percentage value we need to trigger a redraw. * Avoid implicit layer animation By default, changing a CALayer's frame causes it to animate to the new position. This prevents that behavior, as we need the change to happen as fast as possible. * Show the entire new image if there is no old one * Add a transparency background layer This adds the commonly used checkerboard transparency indicator. The pattern had already been used by the GIMapViewController, so no new assets were necessary. * Update colors on every draw call In order to reliably obey dark mode, it seems to be necessary to reassign the colors constantly. We tried to handle it via viewDidChangeEffectiveAppearance, but the behavior was unreliable. Since we couldn't notice any performance downsides to reassigning the colors with every draw call, we went with this solution. * Add indicator borders Another common design element in slide style image comparison tools are red and green borders to separate old and new images. This is a simple implementation of that, which once again reassigns the colors on every draw call to handle dark mode properly. * Add a divider line The final common design element of slider style image comparison tools. To further indicate where the old and new images meet, we add a thin line right between them. * Infer file type based on UTI The previous approach of initializing an NSImage to figure out whether a file is an image was questionable when taking large binaries into account. This new solution uses the file ending to determine the uniform type identifier of a file, which can be used to check for image files. * Limit maximum size of images in memory To ensure fast performance and a reasonable memory impact even for very large image files, we now create thumbnails of a limited size. * Restrict image diffing to NSImage compatible types * Separate image loading and cell size calculation To ensure maximum performance we now offload loading the image into memory to a separate thread. As we still need the image size to lay out cells properly, we query just this information before starting to load the full image. * Show the entire deleted image | 4 年前 | |
Bump to macOS 12.4 min target (#2785) * Bump to macOS 12.4 min target Uses angle bracket notation for public framework imports * Fix test cases | 4 个月前 | |
Bump to macOS 12.4 min target (#2785) * Bump to macOS 12.4 min target Uses angle bracket notation for public framework imports * Fix test cases | 4 个月前 | |
Updated upper copyright year to 2019 | 7 年前 | |
Revert "Some MRC to ARC conversions in GitUpKit (#827)" 9282c9b0ced859c2f86aaee55ec97b6aa3e26692 | 3 年前 | |
Updated upper copyright year to 2019 | 7 年前 | |
Revert "Some MRC to ARC conversions in GitUpKit (#827)" 9282c9b0ced859c2f86aaee55ec97b6aa3e26692 | 3 年前 | |
Updated upper copyright year to 2019 | 7 年前 | |
Revert "Refactoring. MRC removal. Part two. (#857)" 26cc95c84119ac21a395c197904f62237e48a1be | 3 年前 | |
Bump to macOS 12.4 min target (#2785) * Bump to macOS 12.4 min target Uses angle bracket notation for public framework imports * Fix test cases | 4 个月前 | |
Updated upper copyright year to 2019 | 7 年前 | |
Bump to macOS 12.4 min target (#2785) * Bump to macOS 12.4 min target Uses angle bracket notation for public framework imports * Fix test cases | 4 个月前 | |
Bump to macOS 12.4 min target (#2785) * Bump to macOS 12.4 min target Uses angle bracket notation for public framework imports * Fix test cases | 4 个月前 | |
Bump to macOS 12.4 min target (#2785) * Bump to macOS 12.4 min target Uses angle bracket notation for public framework imports * Fix test cases | 4 个月前 | |
Bump to macOS 12.4 min target (#2785) * Bump to macOS 12.4 min target Uses angle bracket notation for public framework imports * Fix test cases | 4 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 10 年前 | ||
| 7 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 4 个月前 | ||
| 9 个月前 | ||
| 7 年前 | ||
| 9 个月前 | ||
| 7 年前 | ||
| 7 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 5 个月前 | ||
| 4 年前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 7 年前 | ||
| 3 年前 | ||
| 7 年前 | ||
| 3 年前 | ||
| 7 年前 | ||
| 3 年前 | ||
| 4 个月前 | ||
| 7 年前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 |