# HG changeset patch # User Paul Boddie # Date 1274632710 -7200 # Node ID 6a06297b36ca0d5e2ad0d87e270929367308c7f9 # Parent fa7f79b9a6e42040f7ba12fe2a1847469b1d4e8d Improved the behaviour of the controls by introducing a special section for both the navibar plus search form and the edit bar. Switched controls layout to using right-aligned inline blocks instead of floats. Introduced usage of the strip method on generated HTML to avoid leaving spaces between blocks of controls. Added a proper margin below the controls for the pageline. Simplified parts of the CSS, eliminating redundant rules. diff -r fa7f79b9a6e4 -r 6a06297b36ca themes/mercurialwiki/css/screen.css --- a/themes/mercurialwiki/css/screen.css Sun May 23 17:26:54 2010 +0200 +++ b/themes/mercurialwiki/css/screen.css Sun May 23 18:38:30 2010 +0200 @@ -62,20 +62,15 @@ /* Navigational and editing controls. */ -#navibar, .editbar { +.controls { float: right; - margin: 17px 0 0 0; - padding: 0; - background: #999; - white-space: nowrap; + text-align: right; } -#navibar { - - /* NOTE: Using a fairly arbitrary size to allow the truncation of the menu. */ - - max-width: 50%; - overflow: hidden; +#navibar, .editbar { + display: inline-block; + margin: 17px 0 2px 0; + padding: 0; } #navibar li, .editbar li { @@ -84,9 +79,19 @@ padding: 0; } -.editbar form, .editbar form div { - display: inline; +.editbar form, .editbar span { + + /* Need a block to redefine the height. */ + + display: inline-block; + height: 42px; + line-height: 42px; + + /* Margin and padding correspond to the navibar settings. */ + margin: 0; + padding: 0 16px; + background: #999; } #navibar a, .editbar a { @@ -100,6 +105,7 @@ color: #fff; margin: 0; padding: 0 16px; + background: #999; text-decoration: none; } @@ -109,10 +115,6 @@ text-decoration: none; } -.editbar span { - padding: 0 16px; -} - /* Other elements. */ #logo { @@ -136,11 +138,11 @@ } #searchform { - float: right; + display: inline-block; /* Margin and padding correspond to the navibar settings. */ - margin: 17px 0 0 0; + margin: 17px 0 2px 0; padding: 0 16px; background: #999; @@ -154,14 +156,6 @@ vertical-align: middle; } -.actionsmenu div { - - /* Margin and padding correspond to the navibar settings. */ - /* Set on the div to avoid accidental vertical expansion. */ - - padding-right: 16px; -} - #pageline, .pageline { /* Prevent mixing of header and content elements. */ @@ -172,10 +166,6 @@ border-bottom: 1px solid #ccc; } -#footer .pageline { - padding-top: 2px; -} - #message { clear: both; margin: 0; diff -r fa7f79b9a6e4 -r 6a06297b36ca themes/mercurialwiki/mercurialwiki.py --- a/themes/mercurialwiki/mercurialwiki.py Sun May 23 17:26:54 2010 +0200 +++ b/themes/mercurialwiki/mercurialwiki.py Sun May 23 18:38:30 2010 +0200 @@ -108,8 +108,11 @@ html.append(fmt.div(on=1, attr={"id" : "header"})) html.append(self.logo()) - html.append(self.searchform(d)) - html.append(self.navibar(d)) + + html.append(fmt.div(on=1, attr={"class" : "controls"})) + html.append(self.navibar(d).strip()) + html.append(self.searchform(d).strip()) + html.append(fmt.div(on=0)) html.append(fmt.div(on=0)) @@ -164,7 +167,9 @@ html.append(fmt.div(on=1, attr={"id" : "footer"})) if self.shouldShowEditbar(page): + html.append(fmt.div(on=1, attr={"class" : "controls"})) html.append(self.editbar(d)) + html.append(fmt.div(on=0)) # A separator. @@ -184,6 +189,19 @@ return u''.join(html) + def actionsMenu(self, page): + + """ An overridden version of the actions menu + + This method strips the adjacent white-space from the generated menu. + + @param page: current page, Page object + @rtype: unicode + @return: actions menu html fragment + """ + + return ThemeBase.actionsMenu(self, page).strip() + # Theme instantiation. def execute(request):