Hide the attachment bucket by default. Add some padding around attachment icons in the bucket.

Fork tools icon (patch from stephen walker)
This commit is contained in:
scott%scott-macgregor.org 2003-06-27 00:53:48 +00:00
parent c27a303c8d
commit 14840b8d34
3 changed files with 32 additions and 4 deletions

View File

@ -1284,6 +1284,13 @@ function ComposeStartup(recycled, aParams)
if (attachments)
for (i = 0; i < attachments.Count(); i ++)
AddAttachment(attachments.QueryElementAt(i, Components.interfaces.nsIMsgAttachment));
if (attachments.Count())
{
var attachmentBox = document.getElementById("attachments-box");
attachmentBox.hidden = false;
document.getElementById("attachmentbucket-sizer").hidden=false;
}
}
gMsgCompose.RegisterStateListener(stateListener);
@ -2163,6 +2170,10 @@ function AttachFile()
var attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment);
attachment.url = currentAttachment;
AddAttachment(attachment);
var attachmentBox = document.getElementById("attachments-box");
attachmentBox.hidden = false;
document.getElementById("attachmentbucket-sizer").hidden=false;
gContentChanged = true;
}
}
@ -2291,6 +2302,9 @@ function RemoveAllAttachments()
// Let's release the attachment object hold by the node else it won't go away until the window is destroyed
child.attachment = null;
}
document.getElementById("attachments-box").setAttribute("hidden", "true");
document.getElementById("attachmentbucket-sizer").setAttribute("hidden", "true");
}
function RemoveSelectedAttachment()
@ -2306,6 +2320,12 @@ function RemoveSelectedAttachment()
}
gContentChanged = true;
}
if (!MessageHasAttachments())
{
document.getElementById("attachments-box").setAttribute("hidden", "true");
document.getElementById("attachmentbucket-sizer").setAttribute("hidden", "true");
}
}
function FocusOnFirstAttachment()

View File

@ -559,8 +559,8 @@
onkeypress="subjectKeyPress(event);" />
</hbox>
</vbox>
<splitter id="attachmentbucket-sizer" collapse="after"/>
<vbox id="attachments-box">
<splitter id="attachmentbucket-sizer" hidden="true" collapse="after"/>
<vbox id="attachments-box" hidden="true">
<label id="attachmentBucketText" value="&attachments.label;" crop="right"
accesskey="&attachments.accesskey;" control="attachmentBucket"/>
<listbox seltype="multiple" id="attachmentBucket" flex="1" rows="4"

View File

@ -32,11 +32,11 @@
/* ::::: tools menu icons ::::: */
.icon-mail16 {
list-style-image: url("chrome://communicator/skin/taskbar/mail-16.gif");
list-style-image: url("chrome://messenger/skin/icons/mail-16.gif");
}
.icon-addressbook16 {
list-style-image: url("chrome://communicator/skin/taskbar/addressbook-16.gif");
list-style-image: url("chrome://messenger/skin/addressbook/icons/addressbook-16.gif");
}
/* ::::: primary toolbar buttons ::::: */
@ -147,6 +147,14 @@
border-bottom: none;
}
/* XXX I should really have a selector rule here to select just .listcell-icon objects underneath the attachmentList listbox */
.listcell-icon
{
margin-left: 2px;
margin-top: 2px;
}
#compose-toolbar-sizer {
border-top-width: 1px;
border-left: none;