Changeset 571


Ignore:
Timestamp:
12/29/09 14:10:12 (2 years ago)
Author:
octorian
Message:

Added subtle mailbox message icon modifier to indicate when a message is not loaded or cached

Location:
trunk/LogicMail/src/org/logicprobe/LogicMail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LogicMail/src/org/logicprobe/LogicMail/model/MessageNode.java

    r562 r571  
    128128        /** True if the message is up-to-date in the cache */ 
    129129        private boolean cached; 
     130        /** True if the message has cached content available for loading */ 
     131        private boolean hasCachedContent; 
    130132        /** Bit-field set of message flags. */ 
    131133        private int flags; 
     
    656658                        return (messageStructure != null) && (!messageContent.isEmpty()); 
    657659                } 
     660        } 
     661         
     662        /** 
     663         * Sets whether this message has cached content available. 
     664         * This method should only be called by code which is creating 
     665         * a message note instance from local cache data. 
     666         *  
     667         * @param hasCachedContent True if cached content is available for loading 
     668         */ 
     669        public void setCachedContent(boolean hasCachedContent) { 
     670            this.hasCachedContent = hasCachedContent; 
     671        } 
     672         
     673        /** 
     674         * Gets whether this message has cached content available. 
     675         * This is intended to be used as a quick check to determine whether 
     676         * message content can be loaded from local cache, without actually 
     677         * having to load that content first.  It checks a variable that should 
     678         * be set when message headers are loaded from cache. 
     679         *  
     680         * @return True if cached content is available for loading 
     681         */ 
     682        public boolean hasCachedContent() { 
     683            return hasCachedContent; 
    658684        } 
    659685         
  • trunk/LogicMail/src/org/logicprobe/LogicMail/model/MessageNodeReader.java

    r529 r571  
    231231                messageNode.setMessageStructure(messageStructure); 
    232232                 
     233                if(contentCount > 0) { 
     234                    messageNode.setCachedContent(true); 
     235                } 
     236                 
    233237                return messageNode; 
    234238        } 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/ui/MailboxMessageField.java

    r465 r571  
    155155        // Draw the message icon 
    156156        Bitmap messageIcon = NodeIcons.getIcon(messageNode); 
    157         graphics.drawBitmap(1, (lineHeight / 2) - (messageIcon.getHeight() / 2), 20, lineHeight*2, messageIcon, 0, 0); 
     157        int messageIconY = (lineHeight / 2) - (messageIcon.getHeight() / 2); 
     158        int messageIconW = messageIcon.getWidth(); 
     159        int messageIconH = messageIcon.getHeight(); 
     160        graphics.drawBitmap(1, messageIconY, messageIconW, messageIconH, messageIcon, 0, 0); 
     161         
     162        if(!messageNode.hasCachedContent() && !messageNode.hasMessageContent()) { 
     163            graphics.setColor(graphics.getBackgroundColor()); 
     164            graphics.drawFilledPath( 
     165                    new int[] { 7, 1 + messageIconW, 1 + messageIconW }, 
     166                    new int[] { messageIconY + messageIconH, messageIconY - 6, messageIconY + messageIconH }, 
     167                    null, 
     168                    null); 
     169            graphics.setColor(originalColor); 
     170        } 
     171         
    158172        if(attachmentIcon != null) { 
    159173            graphics.drawBitmap(1, lineHeight, 20, lineHeight*2, attachmentIcon, 0, 0); 
Note: See TracChangeset for help on using the changeset viewer.