Commit graph

208 commits

Author SHA1 Message Date
Sergii Stoian
42a79060b9
Make white as default selection highlight color for NSTableView (#312) 2024-11-02 00:03:20 +01:00
Gregory John Casamento
5befed5855 Fix a number of issues pointed out by @fredkiefer 2024-08-18 17:25:47 -04:00
Gregory John Casamento
abfc782a6c Move check for dataSource or binding into NSOutlineView before calling method to draw the row per discussion with @fredkiefer 2024-07-27 18:29:00 -04:00
Gregory John Casamento
6b808f2d24 Whitespace cleanup, remove unneeded methods, remove NSLogs 2024-06-27 05:54:06 -04:00
Gregory John Casamento
fb2f605e18 Update drawing code to handle binding, add NSString private method to helpers, remove debugging code from binding connector and outline 2024-06-26 18:17:21 -04:00
Gregory John Casamento
cf7b9ebd39 Final changes suggested by @fredkiefer and some small fixes before merge 2024-06-16 20:52:06 -04:00
Gregory John Casamento
f9b89c41e6 Correct minor theme drawing issues, fix issue pointed out by @fredkiefer to address out of order row fetching 2024-06-16 17:36:15 -04:00
Gregory John Casamento
77bf2f823b Move method back, eliminate possible duplicate call to render outline cell, changes suggested by review with @fredkiefer 2024-06-16 16:25:00 -04:00
Gregory John Casamento
b4c98b329b Move method that renders the outline icon per discussion with @fredkiefer, also includes some whitespace fixes 2024-06-16 08:38:12 -04:00
Gregory John Casamento
a815ad5bb8 Edits suggested by @fredkiefer during review 2024-06-16 07:25:44 -04:00
Gregory John Casamento
b7bea0213b Fix issue with view refresh/editability, refactor so that view sizing happens in the correct place 2024-05-03 10:40:08 -04:00
Gregory John Casamento
b9c5ba35be Rename variables to be a bit more meaningful 2024-04-30 04:38:41 -04:00
Gregory John Casamento
9070a9d30f Move view rendering to viewAtColumn:row:makeIfNecessary: and eliminate uneeded private method 2024-04-28 15:04:29 -04:00
Gregory John Casamento
4d5957eaf7 Fully refactor delegate calls into NSTableView/NSOutlineView and move outlineColumn drawing to a public method 2024-04-28 09:49:19 -04:00
Gregory John Casamento
77ce97c266 Update to use NSTableRowView 2024-04-28 07:17:43 -04:00
Gregory Casamento
82dce67eb4
Reduce code duplication in GSThemeDrawing table/outline view drawing methods (#262)
* Reduce code duplication in drawViewCell:... method

* Further reduce code duplication, add common private method for calculating starting and ending column

* Use the tableView in the method that calculates the starting and ending rows

* Add code to properly handle prototypeViews, the XIB is NOT split, I was confused

* Call awakeFromNib on view as well

* Refactor so that the outlineColumn drawing code is shared

* Adjust the image drawing and the clickable area to be more aligned also make it easier to expand or collapse an item in the outline view
2024-04-26 18:40:11 +02:00
Gregory John Casamento
0e36b42837 Add a check to make sure that ov is set 2024-04-23 02:19:17 -04:00
Gregory John Casamento
3ff5efed30 Encapsulate the renderedPaths and pathsToViews ivars that track which views were displayed in a viewBased table 2024-04-22 09:00:53 -04:00
Gregory John Casamento
c1e3cf2f08 Fix the image position and refresh when opening and closing items if it is a viewBased outline view. Tested and behavior seems consistent with macOS 14. 2024-04-22 09:00:53 -04:00
Gregory John Casamento
3c01238988 Remove checks for the class/subclass of NSTableView/NSOutlineView, but make the decision about how to render by depending on which delegate method is implemented 2024-04-22 09:00:53 -04:00
Gregory John Casamento
64150ff2ba Minor cleanup 2024-04-22 09:00:53 -04:00
Gregory John Casamento
a11f562997 Remove GSXibInternal, since it is not needed for this PR. Make drawing method parameter types more explicit, correct delegate method name in NSOutlineView 2024-04-22 09:00:53 -04:00
Gregory John Casamento
48d031a14a Add improvements suggested by @fredkiefer 2024-04-22 09:00:53 -04:00
Gregory John Casamento
5d17658b0e Add 10.12 imageViewWithImage to NSImageView, show outline view image to let the user know the item is expandable 2024-04-22 09:00:53 -04:00
Gregory John Casamento
8c9278e12a Fix memory leak when creating the blank image, the image is retained by -[NSCell initImageCell:] 2024-04-22 09:00:53 -04:00
Gregory John Casamento
e74144b1bd Fix memory leak when creating the blank image, the image is retained by -[NSCell initImageCell:] 2024-04-22 09:00:53 -04:00
Gregory John Casamento
6ca3708722 Code cleanup, remove duplicates, reorganize some methods so that it is the same as in the header 2024-04-22 09:00:53 -04:00
Gregory John Casamento
f787edfcfb Consolidate and refactor the cellview methods in the theme drawing code, so that there is no repeated code 2024-04-22 09:00:53 -04:00
Gregory John Casamento
8d9cb6f933 Add logic to get the column / row for a given view 2024-04-22 09:00:53 -04:00
Gregory John Casamento
53e040a6bb Changes to support view based NSOutlineView, untested 2024-04-22 09:00:53 -04:00
Gregory John Casamento
f71ee8641b Initial changes for NSOutlineView view-based support 2024-04-22 09:00:53 -04:00
Gregory John Casamento
db773ae9ec Don't add the view again if it's one that has already been added, this causes the application to poll unneccessarily 2024-04-22 09:00:53 -04:00
Gregory John Casamento
e19038665b Use an NSMapTable to store which views have been displayed 2024-04-22 09:00:53 -04:00
Gregory John Casamento
a73c3cc876 Add code to track if a view has been rendered, fix issue with duplication of the view, I am not sure if this method of tracking that the view has been rendered is correct, but it works for now 2024-04-22 09:00:53 -04:00
Gregory John Casamento
20f29b2d1d Add code to cause delegate methods which are not used for viewBased tables to be called in viewBased mode, add code to instantiate the prototypeCellView when adding it to the tableView 2024-04-22 09:00:53 -04:00
Gregory John Casamento
5294e2a126 Add private method to return the prototypeCellViews array 2024-04-22 09:00:53 -04:00
Gregory John Casamento
e4c7bb540c Add prototype cell view support, remove code that forces prototypeCellView to be NSView 2024-04-22 09:00:53 -04:00
Gregory John Casamento
b06b23c97c Add code to instnatiate the NSTableCellView if the delegate method does not exist 2024-04-22 09:00:53 -04:00
Gregory John Casamento
74487bcfa5 Remove comment 2024-04-22 09:00:53 -04:00
Gregory John Casamento
d11c7e3dbc Remove unused variables 2024-04-22 09:00:53 -04:00
Gregory John Casamento
a9653a71a2 Draw the view in the confines of the cell frame 2024-04-22 09:00:53 -04:00
Gregory John Casamento
ebdbe0930f Add methods to theme and to NSTableView to get the view from the delegate, this is a partial commit to save my place here... will follow up shortly 2024-04-22 09:00:53 -04:00
Frederik Carlier
892ed4877e
NSBox: (re-)implement isOpaque (#254)
This (re-)implements logic where a box is marked
as opaque if it is a custom box which is not
transparent, but moves the logic to `GSTheme`,
allowing themes to override this loggic.

This fixes the rendering of custom boxes with a
custom fill color; the current implementation
would mark them as non-opaque and hence the fill
color would not be rendered.

- The original implementation (from 1999) always
  returned `YES`
  (53bcb50240)
- A more complete implementation was backported
  from the Testplant branch in 2012
  (e85b16bc05, by
  @fredkiefer, upstream commit
  36e77b95f7)
- More recently, the a return value of `NO` was
  hardcoded
  (02bc49e2d5, by
  @ericwa)
2024-04-04 22:23:14 +02:00
Frederik Carlier
059d13f5ab
highlightTableViewSelection: Always use default selection color if not set. (#253)
The current implementation will attempt to assign a default value for selectionColor if backgroundColor is white.  There's two issues with that:

1. `backgroundColor` is likely in the `NSNamedColorSpace`,  whereas it is being compared to `[NSColor whiteColor]`, which is in the `NSCalibratedWhiteColorSpace`. That comparision will always return false.
2. Users will probably expect the selected item to be highlighted in a different color even if the background color is not white.  For example, the consider a scenario where the default background color is white, and the alternate background color is grey.  It makes sense to always highlight the selected row in blue.  This aligns with the behavior when `highlightedTableRowBackgroundColor` is defined.
2024-04-03 23:43:33 +02:00
Fred Kiefer
3a6dce02be Remove some gcc compiler warnings 2023-12-28 14:45:16 +01:00
Kyle J Cardoza
096327e87b Addressed changes requested in PR 201 2023-09-22 15:20:23 -04:00
Kyle J Cardoza
07f1b8759a Added window titlebar GSTheme hooks. 2023-09-22 01:42:47 -04:00
Gregory Casamento
f2b79365f4
NSDockTile - Implement methods to update the icon and show badge (#185)
NSDockTile - Implement methods to update the icon and show badge using a NSCustomImageRep. Link the NSDockTile view with the AppIcon window contentView.
GSTheme - add badgeColor color and corresponding methods to theme background, decoration and text color
2023-07-27 09:17:18 +02:00
Riccardo Mottola
e0012349f6 Refactor resize bar notch width to be a constant and private inside GSTheme, making it accessible through -[GSTheme resizebarNotchWidth]. 2022-03-31 23:43:52 +02:00
Gregory John Casamento
73c03767df Add tabview enum to header, fix signture issue. 2021-10-13 08:26:37 -04:00