move the statusbar color handling to the css file. for the future, whenever a background color is set, the foreground color should also be set, otherwise text might be unreadable in dark themes (or light themes, depending on what theme the user has)

This commit is contained in:
Viktor Kojouharov committed 2007-05-20 13:53:57 +00:00
1 parent c5ddcea49e
commit f07b29beac
3 files changed
+19 -3

No files matched your search

+12
View File
@@ -78,3 +78,15 @@ table.settings {
.setting { font-weight: bold; color: #106326; }
.argument { color: #6A97D4; }
.version { position:absolute; top:10px; right:2%; color:#C0C0C0; text-align:right; }
.status_insecure, .status_insecure * {
background-color: transparent;
}
.status_secure, .status_secure * {
background-color: yellow;
color: black;
}
.status_broken, .status_broken * {
background-color: #ff9900;
color: black;
}
+4
View File
@@ -656,6 +656,10 @@ function StatusLine()
color = "transparent";
statusline_widget.setAttribute("style", "background-color: " + color);
};
this.setClass = function(class)
{
statusline_widget.setAttribute("class", "status_" + class);
};
this.updateUrl = function(url)
{
+3 -3
View File
@@ -147,11 +147,11 @@ nsBrowserStatusHandler2.prototype =
{
const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
if(aState & nsIWebProgressListener.STATE_IS_INSECURE)
vimperator.statusline.setColor("transparent");
vimperator.statusline.setClass("insecure");
else if(aState & nsIWebProgressListener.STATE_IS_BROKEN)
vimperator.statusline.setColor("orange");
vimperator.statusline.setClass("broken");
else if(aState & nsIWebProgressListener.STATE_IS_SECURE)
vimperator.statusline.setColor("yellow");
vimperator.statusline.setClass("secure");
return 0;
}