diff options
author | munjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-13 01:46:20 +0000 |
---|---|---|
committer | munjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-13 01:46:20 +0000 |
commit | d185b2fd15adfee5cad70656545d66440c6b2113 (patch) | |
tree | 51bfde5ee14df3dac48076f2dbbd686d1a3fcc54 /chrome/views/label.h | |
parent | b15226c12d04b2fb6ceee6f5ec2a5b2dd4aaff3b (diff) | |
download | chromium_src-d185b2fd15adfee5cad70656545d66440c6b2113.zip chromium_src-d185b2fd15adfee5cad70656545d66440c6b2113.tar.gz chromium_src-d185b2fd15adfee5cad70656545d66440c6b2113.tar.bz2 |
Add ability to set a flag in the Label view class that tells it to
return a preferred size of 0, 0 when the label is not visible.
Review URL: http://codereview.chromium.org/21313
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9725 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/label.h')
-rw-r--r-- | chrome/views/label.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/views/label.h b/chrome/views/label.h index 385518d..84e685c 100644 --- a/chrome/views/label.h +++ b/chrome/views/label.h @@ -143,6 +143,12 @@ class Label : public View { virtual bool GetAccessibleState(VARIANT* state); #endif // defined(OS_WIN) + // Gets/sets the flag to determine whether the label should be collapsed when + // it's hidden (not visible). If this flag is true, the label will return a + // preferred size of (0, 0) when it's not visible. + void set_collapse_when_hidden(bool value) { collapse_when_hidden_ = value; } + bool collapse_when_hidden() const { return collapse_when_hidden_; } + private: // These tests call CalculateDrawStringParams in order to verify the // calculations done for drawing text. @@ -184,6 +190,10 @@ class Label : public View { // Whether the mouse is over this label. bool contains_mouse_; scoped_ptr<Background> mouse_over_background_; + // Whether to collapse the label when it's not visible. + bool collapse_when_hidden_; + + DISALLOW_COPY_AND_ASSIGN(Label); }; } // namespace views |