diff --git a/app/views/repositories/_dir_list_content.rhtml b/app/views/repositories/_dir_list_content.rhtml
index 799318134e484d707c983e6670bc9976118a914d..bcffed4a55110c6cb609db31350c9357133f43a4 100644
--- a/app/views/repositories/_dir_list_content.rhtml
+++ b/app/views/repositories/_dir_list_content.rhtml
@@ -13,7 +13,7 @@
 <% end %>
 <%=  link_to h(entry.name),
           {:action => (entry.is_dir? ? 'browse' : 'changes'), :id => @project, :path => to_path_param(entry.path), :rev => @rev},
-          :class => (entry.is_dir? ? 'icon icon-folder' : 'icon icon-file')%>
+          :class => (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(entry.name)}")%>
 </td>
 <td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>
 <% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %>
diff --git a/lib/redmine/mime_type.rb b/lib/redmine/mime_type.rb
index dfdfff407516721ce3581c3413a7ad5cb816474e..f0e55cc92cde4eac360b79035e6d8b46c7dfbfbe 100644
--- a/lib/redmine/mime_type.rb
+++ b/lib/redmine/mime_type.rb
@@ -24,6 +24,7 @@ module Redmine
       'text/html' => 'html,htm,xhtml',
       'text/jsp' => 'jsp',
       'text/x-c' => 'c,cpp,cc,h,hh',
+      'text/x-csharp' => 'cs',
       'text/x-java' => 'java',
       'text/x-javascript' => 'js',
       'text/x-html-template' => 'rhtml',
@@ -41,6 +42,9 @@ module Redmine
       'image/tiff' => 'tiff,tif',
       'image/x-ms-bmp' => 'bmp',
       'image/x-xpixmap' => 'xpm',
+      'application/pdf' => 'pdf',
+      'application/zip' => 'zip',
+      'application/x-gzip' => 'gz',
     }.freeze
     
     EXTENSIONS = MIME_TYPES.inject({}) do |map, (type, exts)|
@@ -55,6 +59,13 @@ module Redmine
       EXTENSIONS[m[2].downcase] if m
     end
     
+    # Returns the css class associated to
+    # the mime type of name
+    def self.css_class_of(name)
+      mime = of(name)
+      mime && mime.gsub('/', '-')
+    end
+    
     def self.main_mimetype_of(name)
       mimetype = of(name)
       mimetype.split('/').first if mimetype
diff --git a/public/images/file.png b/public/images/file.png
deleted file mode 100644
index f387dd3052a73db6663f7ce845282757b961ca87..0000000000000000000000000000000000000000
Binary files a/public/images/file.png and /dev/null differ
diff --git a/public/images/files/c.png b/public/images/files/c.png
new file mode 100644
index 0000000000000000000000000000000000000000..34a05cccf064b35701b61ba1d395048873d7b48e
Binary files /dev/null and b/public/images/files/c.png differ
diff --git a/public/images/files/csharp.png b/public/images/files/csharp.png
new file mode 100644
index 0000000000000000000000000000000000000000..ffb8fc932f321d19049a51e0134459e7d6549226
Binary files /dev/null and b/public/images/files/csharp.png differ
diff --git a/public/images/files/default.png b/public/images/files/default.png
new file mode 100644
index 0000000000000000000000000000000000000000..8b8b1ca0000bc8fa8d0379926736029f8fabe364
Binary files /dev/null and b/public/images/files/default.png differ
diff --git a/public/images/files/image.png b/public/images/files/image.png
new file mode 100644
index 0000000000000000000000000000000000000000..134b6693687b2fa5fe36d48a9c0b8001f937c741
Binary files /dev/null and b/public/images/files/image.png differ
diff --git a/public/images/files/pdf.png b/public/images/files/pdf.png
new file mode 100644
index 0000000000000000000000000000000000000000..8f8095e46fa4965700afe1f9d065d8a37b101676
Binary files /dev/null and b/public/images/files/pdf.png differ
diff --git a/public/images/files/php.png b/public/images/files/php.png
new file mode 100644
index 0000000000000000000000000000000000000000..7868a25945cd5e5cb7daaca9591927511ca65c0f
Binary files /dev/null and b/public/images/files/php.png differ
diff --git a/public/images/files/ruby.png b/public/images/files/ruby.png
new file mode 100644
index 0000000000000000000000000000000000000000..f59b7c4365fa1720af1aa04eb47167ddaa6eeed4
Binary files /dev/null and b/public/images/files/ruby.png differ
diff --git a/public/images/files/text.png b/public/images/files/text.png
new file mode 100644
index 0000000000000000000000000000000000000000..813f712f726c935f9adf8d2f2dd0d7683791ef11
Binary files /dev/null and b/public/images/files/text.png differ
diff --git a/public/images/files/xml.png b/public/images/files/xml.png
new file mode 100644
index 0000000000000000000000000000000000000000..0c76bd1297751b66230f74719504b2adb02b1615
Binary files /dev/null and b/public/images/files/xml.png differ
diff --git a/public/images/files/zip.png b/public/images/files/zip.png
new file mode 100644
index 0000000000000000000000000000000000000000..8606ff0fd23c97d71d43afa0bd587e47c1e90441
Binary files /dev/null and b/public/images/files/zip.png differ
diff --git a/public/images/pdf.png b/public/images/pdf.png
deleted file mode 100644
index 68c9bada822ec081f3460c791d8174b7460e67d9..0000000000000000000000000000000000000000
Binary files a/public/images/pdf.png and /dev/null differ
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index a8d8736fd246c4e51b75dcd02d176bd653c19d6d..f4bd102180932d8c3dd4d84e0767acc0660e842b 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -665,7 +665,6 @@ vertical-align: middle;
 .icon-move { background-image: url(../images/move.png); }
 .icon-save { background-image: url(../images/save.png); }
 .icon-cancel { background-image: url(../images/cancel.png); }
-.icon-file { background-image: url(../images/file.png); }
 .icon-folder { background-image: url(../images/folder.png); }
 .open .icon-folder { background-image: url(../images/folder_open.png); }
 .icon-package { background-image: url(../images/package.png); }
@@ -692,6 +691,21 @@ vertical-align: middle;
 .icon-report  { background-image: url(../images/report.png); }
 .icon-comment  { background-image: url(../images/comment.png); }
 
+.icon-file { background-image: url(../images/files/default.png); }
+.icon-file.text-plain { background-image: url(../images/files/text.png); }
+.icon-file.text-x-c { background-image: url(../images/files/c.png); }
+.icon-file.text-x-csharp { background-image: url(../images/files/csharp.png); }
+.icon-file.text-x-php { background-image: url(../images/files/php.png); }
+.icon-file.text-x-ruby { background-image: url(../images/files/ruby.png); }
+.icon-file.text-xml { background-image: url(../images/files/xml.png); }
+.icon-file.image-gif { background-image: url(../images/files/image.png); }
+.icon-file.image-jpeg { background-image: url(../images/files/image.png); }
+.icon-file.image-png { background-image: url(../images/files/image.png); }
+.icon-file.image-tiff { background-image: url(../images/files/image.png); }
+.icon-file.application-pdf { background-image: url(../images/files/pdf.png); }
+.icon-file.application-zip { background-image: url(../images/files/zip.png); }
+.icon-file.application-x-gzip { background-image: url(../images/files/zip.png); }
+
 .icon22-projects { background-image: url(../images/22x22/projects.png); }
 .icon22-users { background-image: url(../images/22x22/users.png); }
 .icon22-tracker { background-image: url(../images/22x22/tracker.png); }
diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb
index c2bb40367785eb8a59b81d4aec97d35903d406fa..aef8c2ef2ece6883f82c1cb8122478ed8bc91cb6 100644
--- a/test/functional/repositories_subversion_controller_test.rb
+++ b/test/functional/repositories_subversion_controller_test.rb
@@ -64,6 +64,7 @@ class RepositoriesSubversionControllerTest < Test::Unit::TestCase
       entry = assigns(:entries).detect {|e| e.name == 'helloworld.c'}
       assert_equal 'file', entry.kind
       assert_equal 'subversion_test/helloworld.c', entry.path
+      assert_tag :a, :content => 'helloworld.c', :attributes => { :class => /text\-x\-c/ }
     end
 
     def test_browse_at_given_revision
diff --git a/test/unit/lib/redmine/mime_type_test.rb b/test/unit/lib/redmine/mime_type_test.rb
new file mode 100644
index 0000000000000000000000000000000000000000..79d086944b205a2e0846082b18a6b8e17f6d636f
--- /dev/null
+++ b/test/unit/lib/redmine/mime_type_test.rb
@@ -0,0 +1,61 @@
+# Redmine - project management software
+# Copyright (C) 2006-2009  Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+require File.dirname(__FILE__) + '/../../../test_helper'
+
+class Redmine::MimeTypeTest < Test::Unit::TestCase
+  
+  def test_of
+    to_test = {'test.unk' => nil,
+               'test.txt' => 'text/plain',
+               'test.c' => 'text/x-c',
+               }
+    to_test.each do |name, expected|
+      assert_equal expected, Redmine::MimeType.of(name)
+    end
+  end
+  
+  def test_css_class_of
+    to_test = {'test.unk' => nil,
+               'test.txt' => 'text-plain',
+               'test.c' => 'text-x-c',
+               }
+    to_test.each do |name, expected|
+      assert_equal expected, Redmine::MimeType.css_class_of(name)
+    end
+  end
+  
+  def test_main_mimetype_of
+    to_test = {'test.unk' => nil,
+               'test.txt' => 'text',
+               'test.c' => 'text',
+               }
+    to_test.each do |name, expected|
+      assert_equal expected, Redmine::MimeType.main_mimetype_of(name)
+    end
+  end
+  
+  def test_is_type
+    to_test = {['text', 'test.unk'] => false,
+               ['text', 'test.txt'] => true,
+               ['text', 'test.c'] => true,
+               }
+    to_test.each do |args, expected|
+      assert_equal expected, Redmine::MimeType.is_type?(*args)
+    end
+  end
+end