Files
haiku-beta6/headers/private/shared/ColorItem.h
T
John Scipione 622853ff8e Appearance and Terminal: Move ColorPreview to shared
Move ColorListView and ColorItem to shared in BPrivate namespace.

ColorItem typedef to BPrivate::BColorItem for apps that are already
using this class.

Gravity screensaver:
* ColorItem => BColorItem.
* Use make_color() to set colors.

Make color drop message name agnostic, check for B_RGB_COLOR_TYPE.
Add be:sender and source to drag message.

Add _SetTermColors() convenience method to set colors on all tabs.

Change-Id: I5a9f55d3ab423ccaa341997cf444603373024553
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8846
Reviewed-by: John Scipione <[email protected]>
2025-01-22 19:28:58 +00:00

44 lines
917 B
C++

/*
* Copyright 2016-2024 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Based on ColorWhichItem by DarkWyrm ([email protected])
*/
#ifndef _COLOR_ITEM_H
#define _COLOR_ITEM_H
#include <InterfaceDefs.h>
#include <StringItem.h>
namespace BPrivate {
class BColorItem : public BStringItem {
public:
BColorItem(const char* text, rgb_color color);
BColorItem(const char* text, color_which which, rgb_color color);
virtual void DrawItem(BView* owner, BRect frame, bool complete);
void SetColor(rgb_color color) { fColor = color; };
rgb_color Color() { return fColor; };
color_which ColorWhich() { return fColorWhich; };
private:
rgb_color fColor;
color_which fColorWhich;
};
} // namespace BPrivate
// remove once apps have been updated to use BColorItem
typedef BPrivate::BColorItem ColorItem;
#endif // _COLOR_ITEM_H