* Added some of the rgb_color methods from Dano/Zeta.

* The private general_info structure is now setup - that fixes a part of bug #502;
  NetPositive's bar remains black, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17160 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-04-18 12:14:59 +00:00
parent 50f6c62f4b
commit cd0ea6ff0f
2 changed files with 29 additions and 7 deletions
+19
View File
@@ -80,6 +80,16 @@ typedef struct rgb_color {
#if defined(__cplusplus)
// some convenient additions
inline rgb_color&
set_to(uint8 r, uint8 g, uint8 b, uint8 a = 255)
{
red = r;
green = g;
blue = b;
alpha = a;
return *this;
}
inline bool
operator==(const rgb_color& other) const
{
@@ -94,6 +104,15 @@ typedef struct rgb_color {
#endif
} rgb_color;
#if defined(__cplusplus)
inline rgb_color
make_color(uint8 red, uint8 green, uint8 blue, uint8 alpha = 255)
{
rgb_color color = {red, green, blue, alpha};
return color;
}
#endif
//------------------------------------------------------------------------------
extern _IMPEXP_BE const rgb_color B_TRANSPARENT_COLOR;
+10 -7
View File
@@ -29,7 +29,6 @@
#include <input_globals.h>
#include <ServerProtocol.h>
#include <WidthBuffer.h>
#include <ColorTools.h>
#include "moreUTF8.h"
#include "truncate_string.h"
@@ -687,20 +686,19 @@ mouse_mode()
_IMPEXP_BE rgb_color
ui_color(color_which which)
{
if(be_app) {
if (be_app) {
rgb_color color;
BPrivate::AppServerLink link;
link.StartMessage(AS_GET_UI_COLOR);
link.Attach<color_which>(which);
int32 code;
if (link.FlushWithReply(code) == B_OK && code == B_OK) {
link.Read<rgb_color>(&color);
return color;
}
}
switch (which) {
case B_PANEL_BACKGROUND_COLOR:
return make_color(216,216,216);
@@ -783,8 +781,7 @@ rgb_color shift_color(rgb_color color, float shift);
rgb_color
shift_color(rgb_color color, float shift)
{
// TODO: dunno what this is supposed to do, but BeIDE expects it to be there...
return color;
return tint_color(color, shift);
}
@@ -823,6 +820,12 @@ _init_interface_kit_()
_menu_info_ptr_ = &BMenu::sMenuInfo;
status_t status = load_menu_settings(BMenu::sMenuInfo);
general_info.background_color = ui_color(B_PANEL_BACKGROUND_COLOR);
general_info.mark_color.set_to(0, 0, 0);
general_info.highlight_color = ui_color(B_CONTROL_HIGHLIGHT_COLOR);
general_info.window_frame_color = ui_color(B_WINDOW_TAB_COLOR);
general_info.color_frame = true;
// TODO: fill the other static members
return status;