]> git.sesse.net Git - vlc/commitdiff
macosx: fix table column indentation (close #6929)
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 27 Dec 2012 11:51:57 +0000 (12:51 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 27 Dec 2012 12:05:48 +0000 (13:05 +0100)
For indentation, the outline table column needs to be set, which used to be the title column. This is not a bad choice, since it is only column populated by all items.

However, one can't remove the outline table column easily, so I chose to disable the ability to remove it, something virtually all users don't want to do anyway.

modules/gui/macosx/MainMenu.m
modules/gui/macosx/playlist.m

index 401ad1ff64a165ad41d53306e3f58dde752622e9..02e77d31ca0f209a09e1cc30115764fad89eeb47 100644 (file)
@@ -434,13 +434,17 @@ static VLCMainMenu *_o_sharedInstance = nil;
         o_mi_tmp = [o_mu_playlistTableColumns addItemWithTitle:o_title
                                                         action:@selector(togglePlaylistColumnTable:)
                                                  keyEquivalent:@""];
-        [o_mi_tmp setTarget:self];
+        /* don't set a valid target for the title column selector, since we want it to be disabled */
+        if (![[o_ptc_menuorder objectAtIndex:i] isEqualToString: TITLE_COLUMN])
+            [o_mi_tmp setTarget:self];
         [o_mi_tmp setTag:i];
 
         o_mi_tmp = [o_context_menu addItemWithTitle:o_title
                                              action:@selector(togglePlaylistColumnTable:)
                                       keyEquivalent:@""];
-        [o_mi_tmp setTarget:self];
+        /* don't set a valid target for the title column selector, since we want it to be disabled */
+        if (![[o_ptc_menuorder objectAtIndex:i] isEqualToString: TITLE_COLUMN])
+            [o_mi_tmp setTarget:self];
         [o_mi_tmp setTag:i];
     }
     if (!o_mu_playlistTableColumnsContextMenu)
index b1531a9e7ea83c8cf5eea9c8d78eca0e8ae6a4a1..4995d95f04bc578e1005c66fa7d0b1c4e92c23be 100644 (file)
     }
     else
         [o_outline_view removeTableColumn: [o_outline_view tableColumnWithIdentifier: o_column]];
+
+    [o_outline_view setOutlineTableColumn: [o_outline_view tableColumnWithIdentifier:TITLE_COLUMN]];
 }
 
 - (void)saveTableColumns