Revision: 12722 http://sourceforge.net/p/skim-app/code/12722 Author: hofman Date: 2022-01-19 17:17:17 +0000 (Wed, 19 Jan 2022) Log Message: ----------- Add comments. Make sure note column width offset is set when unhiding note column.
Modified Paths: -------------- trunk/SKMainWindowController_UI.m trunk/SKNotesDocument.m Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2022-01-19 17:03:11 UTC (rev 12721) +++ trunk/SKMainWindowController_UI.m 2022-01-19 17:17:17 UTC (rev 12722) @@ -860,6 +860,8 @@ if (mwcFlags.autoResizeNoteRows && [ov isEqual:rightSideController.noteOutlineView] && [[tableColumn identifier] isEqualToString:NOTE_COLUMNID]) { + if (noteColumnWidthOffset <= 0.0 && [tableColumn isHidden] == NO) + noteColumnWidthOffset = [tableColumn width] - NSWidth([ov frameOfCellAtColumn:[[ov tableColumns] indexOfObject:tableColumn] row:0]); [rowHeights removeAllFloats]; [rightSideController.noteOutlineView noteHeightOfRowsChangedAnimating:NO]; } @@ -874,6 +876,7 @@ CGFloat width = 0.0; id cell = [tableColumn dataCell]; [cell setObjectValue:[item objectValue]]; + // don't use cellFrameAtRow:column: as this needs the row height which we are calculating if ([(PDFAnnotation *)item type] == nil) { for (NSTableColumn *tc in [ov tableColumns]) { if ([tc isHidden] == NO) @@ -1188,6 +1191,8 @@ - (void)toggleAutoResizeNoteRows:(id)sender { if (noteColumnWidthOffset <= 0.0 && mwcFlags.autoResizeNoteRows == 0) { + // calculate the difference between the cell width and the column width for the putline column + // which depends on the style and the OS version NSOutlineView *ov = rightSideController.noteOutlineView; NSTableColumn *tc = [ov tableColumnWithIdentifier:NOTE_COLUMNID]; if ([tc isHidden] == NO) Modified: trunk/SKNotesDocument.m =================================================================== --- trunk/SKNotesDocument.m 2022-01-19 17:03:11 UTC (rev 12721) +++ trunk/SKNotesDocument.m 2022-01-19 17:17:17 UTC (rev 12722) @@ -764,6 +764,8 @@ - (void)outlineView:(NSOutlineView *)ov didChangeHiddenOfTableColumn:(NSTableColumn *)tableColumn { if (ndFlags.autoResizeRows && [[tableColumn identifier] isEqualToString:NOTE_COLUMNID]) { + if (noteColumnWidthOffset <= 0.0 && [tableColumn isHidden] == NO) + noteColumnWidthOffset = [tableColumn width] - NSWidth([ov frameOfCellAtColumn:[[ov tableColumns] indexOfObject:tableColumn] row:0]); [rowHeights removeAllFloats]; [outlineView noteHeightOfRowsChangedAnimating:NO]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit