Projects

Ticket #300: toolbar_item_ordering.diff

File toolbar_item_ordering.diff, 0.8 KB (added by dj2@…, 3 years ago)
  • lib/hotcocoa/mappings/toolbar.rb

     
    5151      def build_custom_items 
    5252        if @allowed && @default 
    5353          ary = @default.select { |x| x.is_a?(NSToolbarItem) } 
    54           @default -= ary 
     54           
     55          @default.map! { |x| x.is_a?(NSToolbarItem) ? x.itemIdentifier : x } 
     56          @allowed.map! { |x| x.is_a?(NSToolbarItem) ? x.itemIdentifier : x } 
     57 
    5558          @custom_items = {} 
    5659          ary.each { |x| @custom_items[x.itemIdentifier] = x }  
    57           @allowed.concat(@custom_items.keys) 
    58           @default.concat(@custom_items.keys) 
    5960 
    6061          [@allowed, @default].each do |a| 
    6162            a.map! do |i|