shared: add ColorItem from Gravity screensaver.
* A useful utility class that will also be used by Terminal later Change-Id: I23020a401fbab7d4116df31f965ae61ecaf2a6cd
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* John Scipione, [email protected]
|
||||
*
|
||||
* Based on ColorWhichItem by DarkWyrm ([email protected])
|
||||
*/
|
||||
#ifndef _COLOR_ITEM_H
|
||||
#define _COLOR_ITEM_H
|
||||
|
||||
|
||||
#include <InterfaceDefs.h>
|
||||
#include <StringItem.h>
|
||||
|
||||
|
||||
class ColorItem : public BStringItem {
|
||||
public:
|
||||
ColorItem(const char* string, rgb_color color);
|
||||
|
||||
virtual void DrawItem(BView* owner, BRect frame, bool complete);
|
||||
void SetColor(rgb_color color) { fColor = color; }
|
||||
rgb_color Color() const { return fColor; }
|
||||
|
||||
private:
|
||||
rgb_color fColor;
|
||||
};
|
||||
|
||||
|
||||
#endif // _COLOR_ITEM_H
|
||||
Reference in New Issue
Block a user