Commit Graph

64 Commits

Author SHA1 Message Date
Allan Odgaard
79172d552e Set controlSize on NSControl instead of its cell 2018-11-17 20:20:55 +07:00
Allan Odgaard
f95c68475d Use systemFontSizeForControlSize: when changing button’s control size 2018-11-17 11:35:40 +07:00
Allan Odgaard
9d147c0218 Do not pass default value for argument to OakCreateButton 2018-11-15 16:08:41 +07:00
Ronald Wampler
e64b09b688 Introduce overloads for the new divider styles
Also, switch to use the new divider styles in most places. The remaining usage of the old "OakCreateLine" functions are in the OakChooser windows. These will be refactor for better dark mode support next.
2018-10-28 11:07:03 +07:00
Allan Odgaard
f6fa273912 Update coding style for where to place colon after dictionary keys
This follows the Swift style and also makes it possible to align dictionary values using TextMate’s Align Assignments command.
2018-10-07 09:54:45 +02:00
Allan Odgaard
e70791ee89 Rename a bunch of constants to fix deprecation warnings (10.12) 2018-06-16 22:55:30 +02:00
Ronald Wampler
f3cd0b0797 Resolve ambiguous autolayout issues
Most of these layout changes are related to the common pattern we used to set constraints for "dividers", where one of the dividers is specified to be connected to both edges of its superview then setting the other dividers' constraints to have equal widths (e.g., @"H:|[divider(==divider2,==divider3)]"). On 10.12, this now appears to result in ambiguous layout. We can resolve it by connecting at least one of the edges for each divider to its superview.
2017-05-31 21:58:31 +02:00
Ronald Wampler
33167c8c52 Update to modern sheet API (10.9) 2017-05-31 10:03:41 +02:00
Ronald Wampler
30891b1a62 Remove OakShowAlertForWindow wrapper (10.9) 2017-05-31 10:03:41 +02:00
Allan Odgaard
f28faeafcb Do not pass bundle items by reference
When executing a bundle item without any default document open, we may first “load” the document, which is done via a callback (for when the document is loaded), and at that time, the bundle item reference has become invalid.
2016-11-04 19:22:39 +07:00
Allan Odgaard
ad01eb1ac6 Use stringArrayForKey: where appropriate 2016-09-21 20:39:41 +02:00
Allan Odgaard
553e89ceb6 Update include statements and link declarations 2016-09-11 12:47:39 +02:00
Allan Odgaard
4a328a84e4 Restoring previous commit message now use project specific settings
Related to 8fd1e1088d
2016-09-11 11:03:40 +02:00
Allan Odgaard
da5fdd78a8 Remove document_t from OakDocumentView
This also updates the commit window to only use OakDocument API.

The bundle editor and document controller still require updating.
2016-09-11 08:49:32 +02:00
Allan Odgaard
ebf6ae9346 Rename document property to cppDocument as intermediate refactoring step 2016-09-11 08:43:46 +02:00
Ronald Wampler
0c71b54a9e Don't set our document with a default constructed document_ptr
This was never necessary since our documentView will set this to
document_ptr() when it's released, though it was harmless. But now,
document_ptr is just a thin wrapper around OakDocument and the default
constructor does nothing. As a result we were basically setting the
text view OakDocument instance to nil.

After commit f9e02d9, when the commit window closes, this would
noticeably cause the text view to turn "white" when using a dark theme.
2016-09-09 05:32:19 +02:00
Allan Odgaard
3e2ed6ca40 NSWindowController will set isReleasedWhenClosed to NO 2016-09-08 11:41:34 +02:00
Allan Odgaard
417193e089 Update link dependencies for all targets
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.

The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.

Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
2016-05-07 13:00:55 +02:00
Ronald Wampler
87df09684f CommitWindow: Force update of constraints after animation is completed
This is necessary to prevent resizing of the document view when removing and then immediately adding a new constraint to the document view.
2016-02-04 23:51:50 +07:00
Allan Odgaard
bdcba4d66e Change --amend option to --commit-button-title Amend
This allows us to set arbitrary titles, should we need it in the future.

It also changes the code slightly so that there is only one method to create the full button title.
2015-10-29 09:30:23 +07:00
Allan Odgaard
e1bbc9f358 Change --rebase-in-progress option to --show-continue-button
Also change the property accordingly.
2015-10-29 09:03:16 +07:00
Jacob Carlborg
d988cf18c2 Support "Amend" as button title in the commit window
When the --amend flag is passed to the "commit" command, the commit
window will used "Amend" instead of "Commit" as the title for the
commit button.
2015-10-29 08:54:06 +07:00
Jacob Carlborg
cc7e2e8322 Add support for commit and continue in the commit window
The use case for this feature is when an interactive rebase is in
progress and be able to, in one command, amend the current commit
and continue with rebase.

By default, if the --rebase-in-progress flag is passed when the
"commit" command is invoked the commit button will be in a
"commit and continue" state. This is indicated by the title of the
commit button now being "Commit & Continue". If the option (⌥) key
is being hold down the state will revert back to the standard "commit"
state and the title will change to "Continue".

If the butten was clicked when it was in the "commit and continue"
state the "commit" command will print "TM_SCM_COMMIT_CONTINUE=1"
(without the quotes) to stdout as the last line. If the button was
clicked when it was in the standard "commit" state the output may
contain "TM_SCM_COMMIT_CONTINUE=0", or the "TM_SCM_COMMIT_CONTINUE"
string will be absent.
2015-10-29 08:54:06 +07:00
Allan Odgaard
37df09bf7b Use to_s instead of sending UTF8String 2014-11-29 10:01:23 +07:00
Allan Odgaard
b581e20ad9 Add wrapper for adding views with auto layout enabled 2014-11-05 00:09:37 +01:00
Allan Odgaard
7ead6d418c Make the OakCreateLabel function more versatile 2014-11-04 22:22:57 +01:00
Allan Odgaard
dc01d80c55 Use local variable instead of property
The property is “assign” so in theory the text field could be released before we add it to its superview. Using the local variable ensures that won’t happen.
2014-11-04 22:10:30 +01:00
Ronald Wampler
b9b9a7fa54 Bring the action button back for the commit window
The new layout allows us to place the action button back in its original place when the table is revealed.
2014-10-28 23:03:40 -04:00
Ronald Wampler
b9b6ecf025 Disable toggle button in the commit window when animating 2014-10-28 23:03:40 -04:00
Ronald Wampler
c4f7b38882 Rename populateTableView to setupArrayController
With the previous refactoring the new name is more appropriate.
2014-10-28 23:00:47 -04:00
Ronald Wampler
12f964c3fa Commit Window: Refactor
The view layout is rearranged in order to animate showing the table, which is now shown below the toggle button with the Cancel and Commit buttons sliding down. Additionally, when not showing the table we remove all relevant views from memory.
2014-10-28 22:59:19 -04:00
Allan Odgaard
844f24eb63 Remove the commit window framework’s Info.plist
This is only required when we have resources (and need to build the target as a framework bundle).
2014-10-19 21:59:37 +02:00
Ronald Wampler
986b9f54af Switch to programmatic CWTableCellView 2014-10-19 21:59:37 +02:00
Ronald Wampler
8902ccf4fe Don't use deprecated mate API 2014-10-19 21:59:37 +02:00
Allan Odgaard
a0e297c3e0 Set custom name for the commit window document
This causes it to release its untitled token so that untitled documents created while the commit sheet is showing, does not appear to skip a number.
2014-10-19 21:59:25 +02:00
Ronald Wampler
8fd1e1088d Set path for the commit window document
This is so that the commit window’s text view sources project specific settings.
2014-10-19 21:52:26 +02:00
Allan Odgaard
e4bf017147 Ensure commit dialog attaches to the correct window 2014-10-13 23:20:24 +02:00
Allan Odgaard
e54a170eae NSBox is an implementation detail so use NSView instead 2014-09-25 19:33:17 +02:00
Ronald Wampler
d60c47ef42 Commit button title summarizes the number of files to be committed 2014-08-28 13:40:24 +02:00
Ronald Wampler
0361afe340 Rework the commit window as a sheet (document modal)
Previously, the commit window was changed from a "always on top" window to a more typical window that could be minimized or sent to the background. While this made viewing the diffs more convenient, we could easily loose track of it or at worst end up with multiple dangling commit windows. By making it document modal, this prevents dangling windows. Furthermore, since the commit window is now attached to the main project window and the file browser already has the SCM status, we hide the file list by default and dropped the action button. Users can choose to show the file list via a checkbox and the action button's menu is still available via the file list's context menu.
2014-08-28 13:40:24 +02:00
Ronald Wampler
4b31a3fde0 Send diffs to a separate window 2014-08-28 10:16:25 +02:00
Ronald Wampler
3934f1be46 Use dictionary literals 2014-08-08 14:53:43 +02:00
Ronald Wampler
dab45a5c08 Remove no longer used option for the Commit Window
Originally, the "--ask" option was used in the previous commit window to change the NSTextField above the text view; however, no SCM bundles (in textmate's repos) currently uses it.
2014-08-08 14:53:43 +02:00
Ronald Wampler
fc5dcf4020 Prefer NULL to nop: in most cases
This change was prompted by the appearance of the `tabSizePopUp` button in the status bar. After dismissing the menu, the title would be disabled.

To ensure we do not have similar issues elsewhere, let's prefer the use of `NULL` to `nop:` when assigning the action for menu items unless we are sure that the menu item should always be disabled (e.g., the item is used as a label).
2014-04-30 12:09:47 +07:00
Allan Odgaard
c272afaff2 Cleanup/harmonize whitespace
Leading indent should consist only of tabs, beyond that, only spaces should be used.
2014-04-25 16:55:31 +07:00
Allan Odgaard
4474419405 Use API available on 10.7 for the commit window’s NSTableView
We’re using an NSViewController to load the nib so that we do not need to manually release the top level objects.
2014-04-16 22:55:16 +07:00
Allan Odgaard
39b94e6ac3 Harmonize whitespace and add trailing newline 2014-04-14 14:26:52 +07:00
Allan Odgaard
3e8fd7b72a Use bundle item name in Commit Window’s title
This means using Git → Amend Last Commit… will show “Amend Last Commit” in the window title.
2014-04-13 13:09:11 +07:00
Allan Odgaard
3f55166f15 Assign ⌘. to the commit window’s cancel button
While ⌘. already triggers any cancelOperation:/cancel: method found in the responder chain, making it explicit gives visual feedback when user press the key, and ensures that another control doesn’t get the key (by responding to cancelOperation:/cancel:).
2014-04-12 14:13:50 +07:00
Allan Odgaard
eaa2faa18a Change to project folder when running commands from commit window 2014-04-11 13:12:48 +07:00