1 /* 2 * Copyright 2007-2016 Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ryan Leavengood <leavengood@gmail.com> 7 * John Scipione <jscipione@gmail.com> 8 * Joseph Groover <looncraz@looncraz.net> 9 * Brian Hill <supernova@tycho.email> 10 */ 11 #ifndef _STRIPE_VIEW_H 12 #define _STRIPE_VIEW_H 13 14 15 #include <Bitmap.h> 16 #include <View.h> 17 18 19 namespace BPrivate { 20 21 22 class BStripeView : public BView { 23 public: 24 BStripeView(BBitmap& icon); 25 26 virtual void Draw(BRect updateRect); 27 virtual BSize PreferredSize(); 28 virtual void GetPreferredSize(float* _width, float* _height); 29 virtual BSize MaxSize(); 30 31 private: 32 BBitmap fIcon; 33 float fIconSize; 34 float fPreferredWidth; 35 float fPreferredHeight; 36 }; 37 38 39 static inline int32 40 icon_layout_scale() 41 { 42 return max_c(1, ((int32)be_plain_font->Size() + 15) / 16); 43 } 44 45 46 }; 47 48 49 using namespace BPrivate; 50 51 52 #endif /* _STRIPE_VIEW_H */ 53