changeset 1963:80f6be39b7fe

Mac: Miscellaneous container/listox fixes. Add a single pixel to the column width during optimization, to prevent cases of abbreviating the column. During _cont_new() which is used by both containers and listboxes force the striping to be disabled initially. Automatically optimize the column sizes of listboxes when adding or deleting contents.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 26 Jul 2019 23:20:54 +0000
parents 50c71474709b
children cdd0561de878
files mac/dw.m
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Fri Jul 26 21:54:14 2019 +0000
+++ b/mac/dw.m	Fri Jul 26 23:20:54 2019 +0000
@@ -2618,12 +2618,13 @@
                     /* Sanity check... don't set the width to 0 */
                     if(width)
                     {
-                        [column setWidth:width];
+                        [column setWidth:width+1];
                     }
                 }
                 else
                 {
-                    [column sizeToFit];
+                    if(self.headerView)
+                        [column sizeToFit];
                 }
             }
         }
@@ -5356,6 +5357,7 @@
     [scrollview setDocumentView:cont];
     [cont setTag:cid];
     [cont autorelease];
+    [cont setRowBgOdd:DW_RGB_TRANSPARENT andEven:DW_RGB_TRANSPARENT];
     return cont;
 }
 
@@ -5409,10 +5411,8 @@
         NSArray *newrow = [NSArray arrayWithObject:nstr];
 
         [cont addRow:newrow];
-        /*[cont performSelectorOnMainThread:@selector(addRow:)
-                               withObject:newrow
-                            waitUntilDone:YES];*/
         [cont reloadData];
+        [cont optimize];
         [cont setNeedsDisplay:YES];
     }
     DW_FUNCTION_RETURN_NOTHING;
@@ -5447,6 +5447,7 @@
 
         [cont insertRow:newrow at:pos];
         [cont reloadData];
+        [cont optimize];
         [cont setNeedsDisplay:YES];
     }
     DW_FUNCTION_RETURN_NOTHING;
@@ -5490,6 +5491,7 @@
             [cont addRow:newrow];
         }
         [cont reloadData];
+        [cont optimize];
         [cont setNeedsDisplay:YES];
     }
     DW_FUNCTION_RETURN_NOTHING;
@@ -5669,6 +5671,7 @@
 
             [cont editCell:nstr at:index and:0];
             [cont reloadData];
+            [cont optimize];
             [cont setNeedsDisplay:YES];
         }
     }