Skip to content

Commit 282ed4e

Browse files
committed
Add Qt logos to the UI header
Fixes: QTBI-1555 Change-Id: I415474bec72275bd98139005fb9fdaa82cafb242 Reviewed-by: Kari Oikarinen <[email protected]>
1 parent b6c336c commit 282ed4e

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

qt-gerrit-ui-plugin/qt-gerrit-ui-plugin.html

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright (C) 2018 The Qt Company
2+
// Copyright (C) 2019 The Qt Company
33
//
44
// This plugin provides UI customization for codereview.qt-project.org
55
//
@@ -28,6 +28,35 @@
2828
return template.content.firstChild;
2929
}
3030

31+
// Customize header
32+
plugin.hook('header-title', {replace: true} ).onAttached(element => {
33+
const css_str = '<style> \
34+
#qt-header ul { \
35+
width: 100%; \
36+
margin: 0; \
37+
text-align: left; \
38+
padding: 0.5em 0 .1em 0; \
39+
} \
40+
#qt-header li { \
41+
display: inline; \
42+
padding: 0.3em; \
43+
} \
44+
#qt-header img { \
45+
vertical-align: top; \
46+
} \
47+
</style>';
48+
const html_str = '<div id="qt-header"> \
49+
<ul> \
50+
<li><img src="/static/logo_qt.png"/></li> \
51+
<li><img src="/static/logo_open_gov.png"/></li> \
52+
</ul> \
53+
</div>';
54+
var elem = htmlToElement(css_str);
55+
element.appendChild(elem);
56+
elem = htmlToElement(html_str);
57+
element.appendChild(elem);
58+
});
59+
3160
// Customize header changes dropdown menu
3261
plugin.hook('header-dropdown-Changes').onAttached(element => {
3362
// this is ugly, but there is no API for this

0 commit comments

Comments
 (0)