make fake window border gray when window is inactive on OS X

This commit is contained in:
Simon Kornblith 2009-04-09 07:16:41 +00:00
parent c351486ed2
commit e8ce1d30d2
2 changed files with 20 additions and 13 deletions

View file

@ -306,8 +306,7 @@ var ZoteroPane = new function()
zoteroSplitter.setAttribute('hidden', !makeVisible); zoteroSplitter.setAttribute('hidden', !makeVisible);
// Restore fullscreen mode if necessary // Restore fullscreen mode if necessary
var fullScreenMode = document.getElementById('zotero-tb-fullscreen').getAttribute('fullscreenmode') == 'true'; if (makeVisible && isFullScreen()) {
if (makeVisible && fullScreenMode) {
this.fullScreen(true); this.fullScreen(true);
} }
@ -361,7 +360,7 @@ var ZoteroPane = new function()
document.getElementById('content').setAttribute('collapsed', false); document.getElementById('content').setAttribute('collapsed', false);
// turn off full window mode, if it was on // turn off full window mode, if it was on
_setFullWindowMode(false) _setFullWindowMode(false);
// Return focus to the browser content pane // Return focus to the browser content pane
window.content.window.focus(); window.content.window.focus();
@ -378,21 +377,21 @@ var ZoteroPane = new function()
function fullScreen(set) function fullScreen(set)
{ {
var fs = document.getElementById('zotero-tb-fullscreen'); var zPane = document.getElementById('zotero-pane');
if (set != undefined) { if (set != undefined) {
var makeFullScreen = set; var makeFullScreen = !!set;
} }
else { else {
var makeFullScreen = fs.getAttribute('fullscreenmode') != 'true'; var makeFullScreen = zPane.getAttribute('fullscreenmode') != 'true';
} }
// Turn Z-pane flex on to stretch to window in full-screen, but off otherwise so persist works // Turn Z-pane flex on to stretch to window in full-screen, but off otherwise so persist works
document.getElementById('zotero-pane').setAttribute('flex', makeFullScreen ? "1" : "0"); zPane.setAttribute('flex', makeFullScreen ? "1" : "0");
document.getElementById('content').setAttribute('collapsed', makeFullScreen); document.getElementById('content').setAttribute('collapsed', makeFullScreen);
document.getElementById('zotero-splitter').setAttribute('hidden', makeFullScreen); document.getElementById('zotero-splitter').setAttribute('hidden', makeFullScreen);
fs.setAttribute('fullscreenmode', makeFullScreen);
zPane.setAttribute('fullscreenmode', makeFullScreen);
_setFullWindowMode(makeFullScreen); _setFullWindowMode(makeFullScreen);
} }
@ -410,7 +409,6 @@ var ZoteroPane = new function()
titlebarcolorState = document.documentElement.getAttribute("activetitlebarcolor"); titlebarcolorState = document.documentElement.getAttribute("activetitlebarcolor");
document.documentElement.removeAttribute("activetitlebarcolor"); document.documentElement.removeAttribute("activetitlebarcolor");
}*/ }*/
if(Zotero.isMac) document.getElementById("zotero-pane").style.borderTop = "1px solid black";
if(document.title != "Zotero") { if(document.title != "Zotero") {
titleState = document.title; titleState = document.title;
document.title = "Zotero"; document.title = "Zotero";
@ -426,7 +424,6 @@ var ZoteroPane = new function()
/*if(Zotero.isMac) { /*if(Zotero.isMac) {
document.documentElement.setAttribute("activetitlebarcolor", titlebarcolorState); document.documentElement.setAttribute("activetitlebarcolor", titlebarcolorState);
}*/ }*/
if(Zotero.isMac) document.getElementById("zotero-pane").style.borderTop = "";
if(document.title == "Zotero") document.title = titleState; if(document.title == "Zotero") document.title = titleState;
if(toolbarCollapseState) { if(toolbarCollapseState) {
@ -439,8 +436,7 @@ var ZoteroPane = new function()
} }
function isFullScreen() { function isFullScreen() {
var fs = document.getElementById('zotero-tb-fullscreen'); return document.getElementById('zotero-pane').getAttribute('fullscreenmode') == 'true';
return fs.getAttribute('fullscreenmode') == 'true'
} }

View file

@ -24,6 +24,17 @@
overflow: hidden; overflow: hidden;
} }
/* these are hacks do display a window separator in full screen mode on OS X */
window[activetitlebarcolor] #zotero-pane[fullscreenmode="true"]
{
border-top: 1px solid #A3A3A3;
}
window[active="true"][activetitlebarcolor] #zotero-pane[fullscreenmode="true"]
{
border-top: 1px solid black;
}
#zotero-collections-pane #zotero-collections-pane
{ {
min-width: 150px; min-width: 150px;
@ -240,7 +251,7 @@
list-style-image: url('chrome://zotero/skin/toolbar-fullscreen-top.png'); list-style-image: url('chrome://zotero/skin/toolbar-fullscreen-top.png');
} }
#zotero-tb-fullscreen[fullscreenmode="true"] #zotero-pane[fullscreenmode="true"] #zotero-tb-fullscreen
{ {
background: #666666; background: #666666;
-moz-border-radius: 6px; -moz-border-radius: 6px;