2016-12-09 02:22:39 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2007-2016 Haiku, Inc.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Ryan Leavengood <leavengood@gmail.com>
|
|
|
|
* John Scipione <jscipione@gmail.com>
|
|
|
|
* Joseph Groover <looncraz@looncraz.net>
|
2017-03-18 15:36:04 +03:00
|
|
|
* Brian Hill <supernova@warpmail.net>
|
2016-12-09 02:22:39 +03:00
|
|
|
*/
|
|
|
|
#ifndef _STRIPE_VIEW_H
|
|
|
|
#define _STRIPE_VIEW_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <Bitmap.h>
|
|
|
|
#include <View.h>
|
|
|
|
|
|
|
|
|
|
|
|
class StripeView : public BView {
|
|
|
|
public:
|
2017-03-20 00:23:01 +03:00
|
|
|
StripeView(BBitmap& icon);
|
2016-12-09 02:22:39 +03:00
|
|
|
|
|
|
|
virtual void Draw(BRect updateRect);
|
2017-03-18 15:36:04 +03:00
|
|
|
virtual BSize PreferredSize();
|
|
|
|
virtual void GetPreferredSize(float* _width, float* _height);
|
|
|
|
virtual BSize MaxSize();
|
2016-12-09 02:22:39 +03:00
|
|
|
|
|
|
|
private:
|
2017-03-20 00:23:01 +03:00
|
|
|
BBitmap fIcon;
|
|
|
|
float fIconSize;
|
2017-04-01 19:40:39 +03:00
|
|
|
float fPreferredWidth;
|
|
|
|
float fPreferredHeight;
|
2016-12-09 02:22:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-04-01 19:40:39 +03:00
|
|
|
static inline int32
|
|
|
|
icon_layout_scale()
|
|
|
|
{
|
|
|
|
return max_c(1, ((int32)be_plain_font->Size() + 15) / 16);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-12-09 02:22:39 +03:00
|
|
|
#endif /* _STRIPE_VIEW_H */
|