Move StripeView to libshared

Change-Id: Ib8ff2f731f9d34e04854f1c2ec288a3db1036793
Reviewed-on: https://review.haiku-os.org/c/1458
Reviewed-by: Rene Gollent <[email protected]>
This commit is contained in:
Adrien Destugues
2019-05-21 06:55:45 +00:00
committed by Adrien Destugues
parent 33fc4f4063
commit 66cb2efaa8
11 changed files with 24 additions and 145 deletions
+52
View File
@@ -0,0 +1,52 @@
/*
* Copyright 2007-2016 Haiku, Inc.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ryan Leavengood <[email protected]>
* John Scipione <[email protected]>
* Joseph Groover <[email protected]>
* Brian Hill <[email protected]>
*/
#ifndef _STRIPE_VIEW_H
#define _STRIPE_VIEW_H
#include <Bitmap.h>
#include <View.h>
namespace BPrivate {
class BStripeView : public BView {
public:
BStripeView(BBitmap& icon);
virtual void Draw(BRect updateRect);
virtual BSize PreferredSize();
virtual void GetPreferredSize(float* _width, float* _height);
virtual BSize MaxSize();
private:
BBitmap fIcon;
float fIconSize;
float fPreferredWidth;
float fPreferredHeight;
};
static inline int32
icon_layout_scale()
{
return max_c(1, ((int32)be_plain_font->Size() + 15) / 16);
}
};
using namespace BPrivate;
#endif /* _STRIPE_VIEW_H */