Simon Hunt
Committed by Brian O'Connor

ONOS-4359: continued work on theming UI

- cleaning up device table view, and device details panel.
- updated xMark glyph, added xClose glyph.

Change-Id: I1f5e4496dbfaa58315ddf0a8c2e0f6e4ff163239
(cherry picked from commit a7f62e1d)
......@@ -138,8 +138,7 @@ public class UiExtensionManager
new UiView(NETWORK, "link", "Links", "nav_links"),
new UiView(NETWORK, "host", "Hosts", "nav_hosts"),
new UiView(NETWORK, "intent", "Intents", "nav_intents"),
//TODO add a new type of icon for tunnel
new UiView(NETWORK, "tunnel", "Tunnels", "nav_links")
new UiView(NETWORK, "tunnel", "Tunnels", "nav_tunnels")
);
UiMessageHandlerFactory messageHandlerFactory =
......
......@@ -529,14 +529,8 @@
checkMark: 'M8.6,3.4L4.4,7.7L1.4,4.7L2.5,3.6L4.4,5.5L7.5,2.3L8.6,3.4Z',
xMark: "M9.0,7.2C8.2,6.9,7.4,6.1,6.7,5.2c0.4-0.5," +
"0.7-0.8,0.8-1.0C7.8,3.5,9.4,1.6,8.1,1.1" +
"C6.8,0.6,6.6,1.7,6.6,1.7C6.4,2.1,6.0,2.7,5.4," +
"3.4C4.9,2.5,4.5,1.9,4.5,1.9" +
"S3.8,0.2,2.9,0.7C1.9,1.1,2.3,2.3,2.3,2.3c0.3,1.1,0.8,2.1,1.4,2.9" +
"C2.5,6.4,1.3,7.4,1.3,7.4S0.8,7.8,0.8,8.1C0.9,8.3,0.9,9.6,2.4,9.1" +
"C3.1,8.8,4.1,7.9,5.1,7.0c1.3,1.3,2.5,1.9,2.5,1.9s0.5,0.5,1.4-0.2" +
"C9.8,7.9,9.0,7.2,9.0,7.2z",
xMark: "M7.8,6.7L6.7,7.8,5,6.1,3.3,7.8,2.2,6.7,3.9,5,2.2,3.3,3.3," +
"2.2,5,3.9,6.7,2.2,7.8,3.3,6.1,5Z",
triangleUp: "M0.5,6.2c0,0,3.8-3.8,4.2-4.2C5,1.7,5.3,2,5.3,2l4.3," +
"4.3c0,0,0.4,0.4-0.1,0.4c-1.7,0-8.2,0-8.8,0C0,6.6,0.5,6.2,0.5,6.2z",
......@@ -551,7 +545,10 @@
play: "M2.5,2l5.5,3l-5.5,3z",
stop: "M2.5,2.5h5v5h-5z"
stop: "M2.5,2.5h5v5h-5z",
xClose: "M8.6,6.8L6.8,8.6,5,6.8,3.2,8.6,1.4,6.8,3.2,5,1.4,3.2," +
"3.2,1.4,5,3.2,6.8,1.4,8.6,3.2,6.8,5Z"
},
spriteData = {
......
......@@ -18,22 +18,25 @@
ONOS GUI -- Icon Service (theme) -- CSS file
*/
.light svg.embeddedIcon g.icon .glyph {
fill: white;
.light div.close-btn svg.embeddedIcon g.icon .glyph {
fill: #9fa296;
}
.dark svg.embeddedIcon g.icon .glyph {
fill: white;
.dark div.close-btn svg.embeddedIcon g.icon .glyph {
/* TODO: dark theme */
fill: #9fa296;
}
/* Sortable table headers */
.light div.tableColSort svg.embeddedIcon .icon .glyph {
fill: black;
fill: #353333;
}
.dark div.tableColSort svg.embeddedIcon .icon .glyph {
fill: #ccc;
/* TODO: dark theme */
fill: #353333;
}
/* active / inactive (check/xmark) icons */
.light svg.embeddedIcon .icon.active .glyph {
fill: #04bf34;
}
......@@ -43,25 +46,19 @@
}
.light svg.embeddedIcon .icon.inactive .glyph {
/* TODO: */
fill: darkred;
fill: #c0242b;
}
.dark svg.embeddedIcon .icon.inactive .glyph {
/* TODO: dark theme */
fill: darkred;
fill: #c0242b;
}
.light table svg.embeddedIcon {
fill: #ccc;
}
.dark table svg.embeddedIcon {
fill: #222;
}
.light table svg.embeddedIcon .glyph {
fill: #333;
.light table svg.embeddedIcon .icon .glyph {
fill: #3c3a3a;
}
.dark table svg.embeddedIcon .glyph {
fill: #ccc;
/* TODO: dark theme */
fill: #3c3a3a;
}
......
......@@ -36,6 +36,8 @@
minus: 'minus',
play: 'play',
stop: 'stop',
close: 'xClose',
topo: 'topo',
......@@ -60,15 +62,18 @@
hostIcon_router: 'router',
hostIcon_bgpSpeaker: 'bgpSpeaker',
// navigation menu icons...
nav_apps: 'bird',
nav_settings: 'chain',
nav_cluster: 'node',
nav_processors: 'allTraffic',
nav_topo: 'topo',
nav_devs: 'switch',
nav_links: 'ports',
nav_hosts: 'endstation',
nav_intents: 'relatedIntents',
nav_processors: 'allTraffic'
nav_tunnels: 'ports' // TODO: use tunnel glyph, when available
};
function ensureIconLibDefs() {
......
......@@ -72,11 +72,14 @@
/* TODO: dark theme */
/* INACTIVE */
.light .ctrl-btns div svg.embeddedIcon g.icon use {
fill: #e4eef2;
fill: #e0dfd6;
}
/* note: no change for inactive buttons when hovered */
/* ACTIVE */
.light .ctrl-btns div.active svg.embeddedIcon g.icon use {
fill: #939598;
}
......@@ -84,7 +87,15 @@
fill: #ce5b58;
}
/* Refresh button specific */
/* CURRENT-VIEW */
.light .ctrl-btns div.current-view svg.embeddedIcon g.icon rect {
fill: #518ecc;
}
.light .ctrl-btns div.current-view svg.embeddedIcon g.icon use {
fill: white;
}
/* REFRESH */
.light .ctrl-btns div.refresh svg.embeddedIcon g.icon use {
fill: #cdeff2;
}
......
......@@ -18,77 +18,39 @@
ONOS GUI -- Device View (theme) -- CSS file
*/
.light #ov-device .current-view use {
fill: white;
}
.dark #ov-device .current-view use {
fill: #304860;
}
.light #ov-device .current-view rect {
fill: deepskyblue;
}
.dark #ov-device .current-view rect {
fill: #eee;
}
.light #device-details-panel.floatpanel {
background-color: rgb(229, 234, 237);
.light .dev-icon svg.embeddedIcon .icon .glyph {
fill: #0071bd;
}
.dark #device-details-panel.floatpanel {
background-color: #3A4042;
.dark .dev-icon svg.embeddedIcon .icon .glyph {
/* TODO: dark theme */
fill: #0071bd;
}
.light .close-btn svg.embeddedIcon .icon.plus .glyph {
fill: #aaa;
}
.dark .close-btn svg.embeddedIcon .icon.plus .glyph {
fill: #ccc;
.light #device-details-panel .editable {
border-bottom: 1px dashed #ca504b;
}
.light .dev-icon svg.embeddedIcon .glyph {
fill: rgb(0, 172, 229);
}
.dark .dev-icon svg.embeddedIcon .glyph {
fill: #486D91;
}
#device-details-panel .editable {
cursor: pointer;
border-bottom: 1px dashed darkgreen;
}
#device-details-panel td.label {
/* works for both light and dark themes ... */
color: #777;
}
.light #device-details-panel hr {
opacity: .5;
border-color: #FFF;
}
.dark #device-details-panel hr {
border-color: #666;
}
.light #device-details-panel .bottom th {
background-color: #CCC;
/* default text color */
background-color: #e5e5e6;
}
.dark #device-details-panel .bottom th {
background-color: #131313;
color: #ccc;
/* TODO: dark theme */
background-color: #e5e5e6;
}
.light #device-details-panel .bottom tr:nth-child(odd) {
background-color: #f9f9f9;
background-color: #fbfbfb;
}
.light #device-details-panel .bottom tr:nth-child(even) {
background-color: #EBEDF2;
background-color: #f4f4f4;
}
.dark #device-details-panel .bottom tr:nth-child(odd) {
background-color: #333;
/* TODO: dark theme */
background-color: #fbfbfb;
}
.dark #device-details-panel .bottom tr:nth-child(even) {
background-color: #555;
/* TODO: dark theme */
background-color: #f4f4f4;
}
......
......@@ -29,8 +29,6 @@
/* More in generic panel.css */
#device-details-panel.floatpanel {
-moz-border-radius: 0;
border-radius: 0;
z-index: 0;
}
......@@ -41,8 +39,8 @@
#device-details-panel .close-btn {
position: absolute;
right: 10px;
top: 0;
right: 6px;
top: 6px;
cursor: pointer;
}
......@@ -59,7 +57,8 @@
#device-details-panel h2 input {
font-size: 1.0em;
font-size: 0.90em;
width: 106%;
}
#device-details-panel .top div.left {
......@@ -71,20 +70,20 @@
}
#device-details-panel td.label {
font-style: italic;
padding-right: 12px;
font-weight: bold;
text-align: right;
padding-right: 6px;
}
#device-details-panel .actionBtns div {
padding: 12px 6px;
}
#device-details-panel .top hr {
width: 95%;
margin: 0 auto;
#device-details-panel hr {
width: 100%;
margin: 2px auto;
}
#device-details-panel .bottom table {
border-spacing: 0;
}
......@@ -93,7 +92,6 @@
letter-spacing: 0.02em;
}
#device-details-panel .bottom th,
#device-details-panel .bottom td {
padding: 6px 12px;
......
......@@ -42,7 +42,7 @@
<td colId="type" class="table-icon"></td>
<td colId="name" sortable>Friendly Name </td>
<td colId="id" sortable>Device ID </td>
<td colId="masterid" sortable>Master Instance </td>
<td colId="masterid" col-width="100px" sortable>Master </td>
<td colId="num_ports" col-width="70px" sortable>Ports </td>
<td colId="mfr" sortable>Vendor </td>
<td colId="hw" sortable>H/W Version </td>
......
......@@ -35,7 +35,7 @@
editingName = false;
// constants
var topPdg = 13,
var topPdg = 28,
ctnrPdg = 24,
scrollSize = 17,
portsTblPdg = 50,
......@@ -71,14 +71,13 @@
}
function addCloseBtn(div) {
is.loadEmbeddedIcon(div, 'plus', 30);
div.select('g').attr('transform', 'translate(25, 0) rotate(45)');
is.loadEmbeddedIcon(div, 'close', 20);
div.on('click', closePanel);
}
function exitEditMode(nameH2, name) {
nameH2.html(name);
nameH2.classed('editable', true);
nameH2.classed('editable clickable', true);
editingName = false;
ks.enableGlobalKeys(true);
}
......@@ -112,7 +111,7 @@
tf, el;
if (!editingName) {
nameH2.classed('editable', false);
nameH2.classed('editable clickable', false);
nameH2.html('');
tf = nameH2.append('input').classed('name-input', true)
.attr('type', 'text')
......@@ -139,7 +138,7 @@
closeBtn = top.append('div').classed('close-btn', true);
addCloseBtn(closeBtn);
iconDiv = top.append('div').classed('dev-icon', true);
top.append('h2').classed('editable', true).on('click', editName);
top.append('h2').classed('editable clickable', true).on('click', editName);
tblDiv = top.append('div').classed('top-tables', true);
tblDiv.append('div').classed('left', true).append('table');
......
......@@ -23,7 +23,7 @@
describe('factory: fw/svg/glyph.js', function() {
var $log, fs, gs, d3Elem, svg;
var numBaseGlyphs = 50,
var numBaseGlyphs = 51,
vbBird = '352 224 113 112',
vbGlyph = '0 0 110 110',
vbBadge = '0 0 10 10',
......@@ -73,13 +73,14 @@ describe('factory: fw/svg/glyph.js', function() {
// badges
uiAttached: 'M2,2.5a.5,.5',
checkMark: 'M8.6,3.4L4',
xMark: 'M9.0,7.2C8.2',
xMark: 'M7.8,6.7L6.7',
triangleUp: 'M0.5,6.2c0',
triangleDown: 'M9.5,4.2c0',
plus: 'M4,2h2v2h2v2',
minus: 'M2,4h6v2',
play: 'M2.5,2l5.5,3',
stop: 'M2.5,2.5h5',
xClose: 'M8.6,6.8L6.8,8.6',
cloud: 'M37.6,79.5c-6.9,8.7-20.4,8.6',
......