From 1224c147a3298874b0dba1d9fbe08862e3be99c9 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sun, 31 Aug 2008 20:47:41 +0200 Subject: [PATCH] ID column width is set according to ID type --- PciIds/Address/Pci.pm | 7 +++++++ PciIds/Address/PciClass.pm | 5 +++++ PciIds/Address/Toplevel.pm | 9 +++++++++ PciIds/Html/List.pm | 2 +- static/print.css | 4 ---- static/screen.css | 4 ---- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/PciIds/Address/Pci.pm b/PciIds/Address/Pci.pm index 40c37f5..27e1236 100644 --- a/PciIds/Address/Pci.pm +++ b/PciIds/Address/Pci.pm @@ -77,4 +77,11 @@ sub subName( $ ) { die "Can not happend\n"; } +sub subIdSize( $ ) { + my( $self ) = @_; + return 9 if $self->get() =~ /^PC\/....\/..../; + return 4 if $self->get() =~ /^PC\/..../; + die "Can not happen\n"; +} + 1; diff --git a/PciIds/Address/PciClass.pm b/PciIds/Address/PciClass.pm index d0c792d..cb81c34 100644 --- a/PciIds/Address/PciClass.pm +++ b/PciIds/Address/PciClass.pm @@ -54,4 +54,9 @@ sub subName( $ ) { die "Can not happen\n"; } +sub subIdSize( $ ) { + my( $self ) = @_; + return 2; +} + 1; diff --git a/PciIds/Address/Toplevel.pm b/PciIds/Address/Toplevel.pm index bc77a64..2185989 100644 --- a/PciIds/Address/Toplevel.pm +++ b/PciIds/Address/Toplevel.pm @@ -91,4 +91,13 @@ sub subName( $ ) { } } +sub subIdSize( $ ) { + my( $self ) = @_; + if( $self->get() =~ /^PC/ ) { + return 4; + } else { + return 2; + } +} + 1; diff --git a/PciIds/Html/List.pm b/PciIds/Html/List.pm index 44ce977..04a52ff 100644 --- a/PciIds/Html/List.pm +++ b/PciIds/Html/List.pm @@ -23,7 +23,7 @@ sub list( $$$$ ) { my( $ok, $parent, $name, $note, $address, $mid ) = loadItem( $tables, $req->uri() ); return NOT_FOUND unless( $ok ); my $id = $address->pretty(); - genHtmlHead( $req, $id, undef ); + genHtmlHead( $req, $id, "\n" ); print "
\n"; print '

'.encode( $id ).'

'; genMenu( $req, $address, $args, $auth, [ [ 'Help', 'help', 'list' ], $address->helpName() ? [ 'ID syntax', 'help', $address->helpName() ] : () ] ); diff --git a/static/print.css b/static/print.css index 6db1f47..0cb1e38 100644 --- a/static/print.css +++ b/static/print.css @@ -31,10 +31,6 @@ table.subnodes width: 100%; table-layout: fixed; } -col.id-col -{ - width: 3em; -} col.name-col { width: 60%; diff --git a/static/screen.css b/static/screen.css index 15595ef..dd67e24 100644 --- a/static/screen.css +++ b/static/screen.css @@ -86,10 +86,6 @@ table.subnodes width: 100%; table-layout: fixed; } -col.id-col -{ - width: 3em; -} col.name-col { width: 60%; -- 2.39.2