Skip to content

Commit

Permalink
More UI tweaks for new address preview.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.mulberrymail.com/mulberry/Mulberry/branches/v4.1d1@433 a91246af-f21b-0410-bd1c-c3c7fc455132
  • Loading branch information
cyrusdaboo authored and Martin Dietze committed Dec 3, 2011
1 parent 8aa60b5 commit c118752
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
Binary file modified MacOS/Resources/Mulberry.PPob
Binary file not shown.
16 changes: 13 additions & 3 deletions MacOS/Sources/Application/Address_Book/CAddressFieldBase.cp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#include "CAddressFieldSubContainer.h"
#include "CStaticText.h"
#include "CToolbarButton.h"

#include <LBevelButton.h>
#include <LPopupButton.h>

// C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S
Expand Down Expand Up @@ -54,8 +54,18 @@ void CAddressFieldBase::FinishCreateSelf(void)
LView::FinishCreateSelf();

// Get controls
mAdd = (LBevelButton*) FindPaneByID(paneid_AddressFieldBaseAdd);
mRemove = (LBevelButton*) FindPaneByID(paneid_AddressFieldBaseRemove);
mAdd = (CToolbarButton*) FindPaneByID(paneid_AddressFieldBaseAdd);
mAdd->AddListener(this);
mAdd->SetSmallIcon(true);
mAdd->SetShowIcon(true);
mAdd->SetShowCaption(false);
mAdd->SetShowFrame(false);
mRemove = (CToolbarButton*) FindPaneByID(paneid_AddressFieldBaseRemove);
mRemove->AddListener(this);
mRemove->SetSmallIcon(true);
mRemove->SetShowIcon(true);
mRemove->SetShowCaption(false);
mRemove->SetShowFrame(false);
mTitle = (CStaticText*) FindPaneByID(paneid_AddressFieldBaseTitle);
mType = (LPopupButton*) FindPaneByID(paneid_AddressFieldBaseType);
mDataMove = (LView*) FindPaneByID(paneid_AddressFieldBaseData);
Expand Down
6 changes: 3 additions & 3 deletions MacOS/Sources/Application/Address_Book/CAddressFieldBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ const ResIDT menu_GenericType = 9101;

// Classes
class CStaticText;
class LBevelButton;
class CToolbarButton;
class LPopupButton;

class CAddressFieldBase : public LView,
public LListener
{
protected:
LBevelButton* mAdd;
LBevelButton* mRemove;
CToolbarButton* mAdd;
CToolbarButton* mRemove;
CStaticText* mTitle;
LPopupButton* mType;
LView* mDataMove;
Expand Down
5 changes: 5 additions & 0 deletions MacOS/Sources/Support/CToolbarButton.cp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ void CToolbarButton::SetShowCaption(bool caption)
}
}

void CToolbarButton::SetShowFrame(bool frame)
{
static_cast<CToolbarButtonImp*>(mControlImp)->SetShowFrame(frame);
}

bool CToolbarButton::GetClickAndPopup() const
{
return static_cast<CToolbarButtonImp*>(mControlImp)->GetClickAndPopup();
Expand Down
1 change: 1 addition & 0 deletions MacOS/Sources/Support/CToolbarButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class CToolbarButton : public LBevelButton
void SetSmallIcon(bool small_icon);
void SetShowIcon(bool icon);
void SetShowCaption(bool caption);
void SetShowFrame(bool frame);

bool GetIconToggle() const
{ return mIconToggle; }
Expand Down
3 changes: 2 additions & 1 deletion MacOS/Sources/Support/CToolbarButtonImp.cp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ CToolbarButtonImp::CToolbarButtonImp(LStream *inStream)
mSmallIcon = false;
mShowIcon = true;
mShowText = true;
mShowFrame = true;
mMouseInside = false;
mPushed = false;
mPrevInfo.state = kThemeStateActive;
Expand Down Expand Up @@ -442,7 +443,7 @@ void CToolbarButtonImp::DrawSelf()
// Draw plain icon + text if not tracking and mouse is outside, or disabled/inactive
// Draw button frame if tracking or mouse inside

if ((mMouseInside || mControlPane->GetValue()) && IsActive() && IsEnabled())
if ((mMouseInside || mControlPane->GetValue()) && IsActive() && IsEnabled() && mShowFrame)
DrawFrame();

if (mShowIcon)
Expand Down
5 changes: 4 additions & 1 deletion MacOS/Sources/Support/CToolbarButtonImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ class CToolbarButtonImp : public LAMBevelButtonImp
void SetShowIcon(bool icon)
{ mShowIcon = icon; }
void SetShowCaption(bool caption)
{ mShowText = caption; }
{ mShowText = caption; }
void SetShowFrame(bool frame)
{ mShowFrame = frame; }

bool GetClickOnPopup() const
{ return mClickOnPopup; }
Expand Down Expand Up @@ -111,6 +113,7 @@ class CToolbarButtonImp : public LAMBevelButtonImp
bool mSmallIcon;
bool mShowIcon;
bool mShowText;
bool mShowFrame;
bool mMouseInside;
bool mPushed; // Is mouse down inside control?
ThemeButtonDrawInfo mPrevInfo;
Expand Down

0 comments on commit c118752

Please sign in to comment.