Pick the CSS system colours from ui_color() and BScreen::DesktopColor(). Update those when they are updated in ZETA. Also update the toolbar and statusbar background.
svn path=/trunk/netsurf/; revision=11535
This commit is contained in:
parent
cf993628eb
commit
e1c11a1d54
|
@ -485,6 +485,9 @@ void gui_init(int argc, char** argv)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ui_color() gives hardcoded values before BApplication is created.
|
||||||
|
nsbeos_update_system_ui_colors();
|
||||||
|
|
||||||
fetch_rsrc_register();
|
fetch_rsrc_register();
|
||||||
|
|
||||||
check_homedir();
|
check_homedir();
|
||||||
|
|
|
@ -21,6 +21,11 @@
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <FilePanel.h>
|
#include <FilePanel.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
#include <BeBuild.h>
|
||||||
|
|
||||||
|
#ifndef B_BEOS_VERSION_DANO
|
||||||
|
#define B_UI_SETTINGS_CHANGED '_UIC'
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CALLED() fprintf(stderr, "%s()\n", __FUNCTION__);
|
#define CALLED() fprintf(stderr, "%s()\n", __FUNCTION__);
|
||||||
|
|
||||||
|
@ -64,3 +69,4 @@ void nsbeos_pipe_message_top(BMessage *message, BWindow *_this, struct beos_scaf
|
||||||
void nsbeos_gui_view_source(struct hlcache_handle *content, struct selection *selection);
|
void nsbeos_gui_view_source(struct hlcache_handle *content, struct selection *selection);
|
||||||
image_id nsbeos_find_app_path(char *path);
|
image_id nsbeos_find_app_path(char *path);
|
||||||
|
|
||||||
|
void nsbeos_update_system_ui_colors(void);
|
||||||
|
|
|
@ -87,6 +87,8 @@ struct beos_scaffolding {
|
||||||
|
|
||||||
BDragger *dragger;
|
BDragger *dragger;
|
||||||
|
|
||||||
|
BView *tool_bar;
|
||||||
|
|
||||||
BControl *back_button;
|
BControl *back_button;
|
||||||
BControl *forward_button;
|
BControl *forward_button;
|
||||||
BControl *stop_button;
|
BControl *stop_button;
|
||||||
|
@ -360,6 +362,7 @@ NSBaseView::MessageReceived(BMessage *message)
|
||||||
case B_PASTE:
|
case B_PASTE:
|
||||||
case B_SELECT_ALL:
|
case B_SELECT_ALL:
|
||||||
//case B_MOUSE_WHEEL_CHANGED:
|
//case B_MOUSE_WHEEL_CHANGED:
|
||||||
|
case B_UI_SETTINGS_CHANGED:
|
||||||
// NetPositive messages
|
// NetPositive messages
|
||||||
case B_NETPOSITIVE_OPEN_URL:
|
case B_NETPOSITIVE_OPEN_URL:
|
||||||
case B_NETPOSITIVE_BACK:
|
case B_NETPOSITIVE_BACK:
|
||||||
|
@ -551,6 +554,7 @@ NSBaseView::AllAttached()
|
||||||
|
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
|
g->tool_bar->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
g->dragger->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
g->dragger->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
g->status_bar->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
g->status_bar->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
@ -576,12 +580,27 @@ NSBrowserWindow::~NSBrowserWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
NSBrowserWindow::DispatchMessage(BMessage *message, BHandler *handler)
|
||||||
|
{
|
||||||
|
BMessage *msg;
|
||||||
|
switch (message->what) {
|
||||||
|
case B_UI_SETTINGS_CHANGED:
|
||||||
|
msg = new BMessage(*message);
|
||||||
|
nsbeos_pipe_message_top(msg, this, fScaffolding);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
BWindow::DispatchMessage(message, handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
NSBrowserWindow::MessageReceived(BMessage *message)
|
NSBrowserWindow::MessageReceived(BMessage *message)
|
||||||
{
|
{
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case B_ARGV_RECEIVED:
|
case B_ARGV_RECEIVED:
|
||||||
case B_REFS_RECEIVED:
|
case B_REFS_RECEIVED:
|
||||||
|
case B_UI_SETTINGS_CHANGED:
|
||||||
DetachCurrentMessage();
|
DetachCurrentMessage();
|
||||||
nsbeos_pipe_message_top(message, this, fScaffolding);
|
nsbeos_pipe_message_top(message, this, fScaffolding);
|
||||||
break;
|
break;
|
||||||
|
@ -640,6 +659,34 @@ static void nsbeos_window_destroy_event(NSBrowserWindow *window, nsbeos_scaffold
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void nsbeos_scaffolding_update_colors(nsbeos_scaffolding *g)
|
||||||
|
{
|
||||||
|
if (!g->top_view->LockLooper())
|
||||||
|
return;
|
||||||
|
rgb_color c = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
g->top_view->SetViewColor(c);
|
||||||
|
|
||||||
|
g->tool_bar->SetViewColor(c);
|
||||||
|
g->back_button->SetViewColor(c);
|
||||||
|
g->forward_button->SetViewColor(c);
|
||||||
|
g->stop_button->SetViewColor(c);
|
||||||
|
g->reload_button->SetViewColor(c);
|
||||||
|
g->home_button->SetViewColor(c);
|
||||||
|
g->url_bar->SetViewColor(c);
|
||||||
|
g->throbber->SetViewColor(c);
|
||||||
|
g->scroll_view->SetViewColor(c);
|
||||||
|
|
||||||
|
g->dragger->SetViewColor(c);
|
||||||
|
|
||||||
|
g->status_bar->SetViewColor(c);
|
||||||
|
g->status_bar->SetLowColor(c);
|
||||||
|
#if defined(__HAIKU__) || defined(B_DANO_VERSION)
|
||||||
|
g->status_bar->SetHighColor(ui_color(B_PANEL_TEXT_COLOR));
|
||||||
|
#endif
|
||||||
|
g->top_view->UnlockLooper();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *message)
|
void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *message)
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
|
@ -715,6 +762,10 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case B_UI_SETTINGS_CHANGED:
|
||||||
|
nsbeos_update_system_ui_colors();
|
||||||
|
nsbeos_scaffolding_update_colors(scaffold);
|
||||||
|
break;
|
||||||
case B_NETPOSITIVE_OPEN_URL:
|
case B_NETPOSITIVE_OPEN_URL:
|
||||||
{
|
{
|
||||||
int32 i;
|
int32 i;
|
||||||
|
@ -1976,22 +2027,22 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
|
||||||
g->dragger->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
g->dragger->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
g->dragger->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)) ;
|
g->dragger->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)) ;
|
||||||
|
|
||||||
// toolbar
|
// tool_bar
|
||||||
// the toolbar is also the dragger for now
|
// the toolbar is also the dragger for now
|
||||||
// XXX: try to stuff it in the status bar at the bottom
|
// XXX: try to stuff it in the status bar at the bottom
|
||||||
// (BDragger *must* be a parent, sibiling or direct child of NSBaseView!)
|
// (BDragger *must* be a parent, sibiling or direct child of NSBaseView!)
|
||||||
rect = g->top_view->Bounds();
|
rect = g->top_view->Bounds();
|
||||||
rect.bottom = rect.top + TOOLBAR_HEIGHT - 1;
|
rect.bottom = rect.top + TOOLBAR_HEIGHT - 1;
|
||||||
rect.right = rect.right - DRAGGER_WIDTH;
|
rect.right = rect.right - DRAGGER_WIDTH;
|
||||||
BView *toolbar = new BView(rect, "Toolbar",
|
g->tool_bar = new BView(rect, "Toolbar",
|
||||||
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, B_WILL_DRAW);
|
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, B_WILL_DRAW);
|
||||||
g->top_view->AddChild(toolbar);
|
g->top_view->AddChild(g->tool_bar);
|
||||||
toolbar->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
g->tool_bar->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
toolbar->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)) ;
|
g->tool_bar->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)) ;
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
#warning use BPictureButton
|
#warning use BPictureButton
|
||||||
rect = toolbar->Bounds();
|
rect = g->tool_bar->Bounds();
|
||||||
rect.right = TOOLBAR_HEIGHT;
|
rect.right = TOOLBAR_HEIGHT;
|
||||||
rect.InsetBySelf(5, 5);
|
rect.InsetBySelf(5, 5);
|
||||||
rect.OffsetBySelf(0, -1);
|
rect.OffsetBySelf(0, -1);
|
||||||
|
@ -2000,40 +2051,40 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
|
||||||
message = new BMessage('back');
|
message = new BMessage('back');
|
||||||
message->AddPointer("scaffolding", g);
|
message->AddPointer("scaffolding", g);
|
||||||
g->back_button = new BButton(rect, "back_button", "<", message);
|
g->back_button = new BButton(rect, "back_button", "<", message);
|
||||||
toolbar->AddChild(g->back_button);
|
g->tool_bar->AddChild(g->back_button);
|
||||||
nButtons++;
|
nButtons++;
|
||||||
|
|
||||||
rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
|
rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
|
||||||
message = new BMessage('forw');
|
message = new BMessage('forw');
|
||||||
message->AddPointer("scaffolding", g);
|
message->AddPointer("scaffolding", g);
|
||||||
g->forward_button = new BButton(rect, "forward_button", ">", message);
|
g->forward_button = new BButton(rect, "forward_button", ">", message);
|
||||||
toolbar->AddChild(g->forward_button);
|
g->tool_bar->AddChild(g->forward_button);
|
||||||
nButtons++;
|
nButtons++;
|
||||||
|
|
||||||
rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
|
rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
|
||||||
message = new BMessage('stop');
|
message = new BMessage('stop');
|
||||||
message->AddPointer("scaffolding", g);
|
message->AddPointer("scaffolding", g);
|
||||||
g->stop_button = new BButton(rect, "stop_button", "S", message);
|
g->stop_button = new BButton(rect, "stop_button", "S", message);
|
||||||
toolbar->AddChild(g->stop_button);
|
g->tool_bar->AddChild(g->stop_button);
|
||||||
nButtons++;
|
nButtons++;
|
||||||
|
|
||||||
rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
|
rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
|
||||||
message = new BMessage('relo');
|
message = new BMessage('relo');
|
||||||
message->AddPointer("scaffolding", g);
|
message->AddPointer("scaffolding", g);
|
||||||
g->reload_button = new BButton(rect, "reload_button", "R", message);
|
g->reload_button = new BButton(rect, "reload_button", "R", message);
|
||||||
toolbar->AddChild(g->reload_button);
|
g->tool_bar->AddChild(g->reload_button);
|
||||||
nButtons++;
|
nButtons++;
|
||||||
|
|
||||||
rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
|
rect.OffsetBySelf(TOOLBAR_HEIGHT, 0);
|
||||||
message = new BMessage('home');
|
message = new BMessage('home');
|
||||||
message->AddPointer("scaffolding", g);
|
message->AddPointer("scaffolding", g);
|
||||||
g->home_button = new BButton(rect, "home_button", "H", message);
|
g->home_button = new BButton(rect, "home_button", "H", message);
|
||||||
toolbar->AddChild(g->home_button);
|
g->tool_bar->AddChild(g->home_button);
|
||||||
nButtons++;
|
nButtons++;
|
||||||
|
|
||||||
|
|
||||||
// url bar
|
// url bar
|
||||||
rect = toolbar->Bounds();
|
rect = g->tool_bar->Bounds();
|
||||||
rect.left += TOOLBAR_HEIGHT * nButtons;
|
rect.left += TOOLBAR_HEIGHT * nButtons;
|
||||||
rect.right -= TOOLBAR_HEIGHT * 1;
|
rect.right -= TOOLBAR_HEIGHT * 1;
|
||||||
rect.InsetBySelf(5, 5);
|
rect.InsetBySelf(5, 5);
|
||||||
|
@ -2042,17 +2093,17 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
|
||||||
g->url_bar = new BTextControl(rect, "url_bar", "url", "", message,
|
g->url_bar = new BTextControl(rect, "url_bar", "url", "", message,
|
||||||
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
|
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
|
||||||
g->url_bar->SetDivider(g->url_bar->StringWidth("url "));
|
g->url_bar->SetDivider(g->url_bar->StringWidth("url "));
|
||||||
toolbar->AddChild(g->url_bar);
|
g->tool_bar->AddChild(g->url_bar);
|
||||||
|
|
||||||
|
|
||||||
// throbber
|
// throbber
|
||||||
rect.Set(0, 0, 24, 24);
|
rect.Set(0, 0, 24, 24);
|
||||||
rect.OffsetTo(toolbar->Bounds().right - 24 - (TOOLBAR_HEIGHT - 24) / 2,
|
rect.OffsetTo(g->tool_bar->Bounds().right - 24 - (TOOLBAR_HEIGHT - 24) / 2,
|
||||||
(TOOLBAR_HEIGHT - 24) / 2);
|
(TOOLBAR_HEIGHT - 24) / 2);
|
||||||
g->throbber = new NSThrobber(rect);
|
g->throbber = new NSThrobber(rect);
|
||||||
toolbar->AddChild(g->throbber);
|
g->tool_bar->AddChild(g->throbber);
|
||||||
g->throbber->SetViewColor(toolbar->ViewColor());
|
g->throbber->SetViewColor(g->tool_bar->ViewColor());
|
||||||
g->throbber->SetLowColor(toolbar->ViewColor());
|
g->throbber->SetLowColor(g->tool_bar->ViewColor());
|
||||||
g->throbber->SetDrawingMode(B_OP_ALPHA);
|
g->throbber->SetDrawingMode(B_OP_ALPHA);
|
||||||
g->throbber->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
g->throbber->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
||||||
/* set up the throbber. */
|
/* set up the throbber. */
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
NSBrowserWindow(BRect frame, struct beos_scaffolding *scaf);
|
NSBrowserWindow(BRect frame, struct beos_scaffolding *scaf);
|
||||||
virtual ~NSBrowserWindow();
|
virtual ~NSBrowserWindow();
|
||||||
|
|
||||||
|
virtual void DispatchMessage(BMessage *message, BHandler *handler);
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
virtual bool QuitRequested(void);
|
virtual bool QuitRequested(void);
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,7 @@ NSBrowserFrameView::MessageReceived(BMessage *message)
|
||||||
case B_PASTE:
|
case B_PASTE:
|
||||||
case B_SELECT_ALL:
|
case B_SELECT_ALL:
|
||||||
//case B_MOUSE_WHEEL_CHANGED:
|
//case B_MOUSE_WHEEL_CHANGED:
|
||||||
|
case B_UI_SETTINGS_CHANGED:
|
||||||
// NetPositive messages
|
// NetPositive messages
|
||||||
case B_NETPOSITIVE_OPEN_URL:
|
case B_NETPOSITIVE_OPEN_URL:
|
||||||
case B_NETPOSITIVE_BACK:
|
case B_NETPOSITIVE_BACK:
|
||||||
|
@ -887,6 +888,9 @@ void nsbeos_dispatch_event(BMessage *message)
|
||||||
break;
|
break;
|
||||||
case B_MOUSE_WHEEL_CHANGED:
|
case B_MOUSE_WHEEL_CHANGED:
|
||||||
break;
|
break;
|
||||||
|
case B_UI_SETTINGS_CHANGED:
|
||||||
|
nsbeos_update_system_ui_colors();
|
||||||
|
break;
|
||||||
case 'nsLO': // login
|
case 'nsLO': // login
|
||||||
{
|
{
|
||||||
BString url;
|
BString url;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
|
#include <Screen.h>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
@ -38,12 +39,45 @@ extern "C" {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "beos/beos_gui.h"
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(__HAIKU__) && !defined(B_BEOS_VERSION_DANO)
|
||||||
|
/* more ui_colors, R5 only had a few defined... */
|
||||||
|
#define B_PANEL_TEXT_COLOR ((color_which)10)
|
||||||
|
#define B_DOCUMENT_BACKGROUND_COLOR ((color_which)11)
|
||||||
|
#define B_DOCUMENT_TEXT_COLOR ((color_which)12)
|
||||||
|
#define B_CONTROL_BACKGROUND_COLOR ((color_which)13)
|
||||||
|
#define B_CONTROL_TEXT_COLOR ((color_which)14)
|
||||||
|
#define B_CONTROL_BORDER_COLOR ((color_which)15)
|
||||||
|
#define B_CONTROL_HIGHLIGHT_COLOR ((color_which)16)
|
||||||
|
#define B_NAVIGATION_BASE_COLOR ((color_which)4)
|
||||||
|
#define B_NAVIGATION_PULSE_COLOR ((color_which)17)
|
||||||
|
#define B_SHINE_COLOR ((color_which)18)
|
||||||
|
#define B_SHADOW_COLOR ((color_which)19)
|
||||||
|
#define B_MENU_SELECTED_BORDER_COLOR ((color_which)9)
|
||||||
|
#define B_TOOLTIP_BACKGROUND_COLOR ((color_which)20)
|
||||||
|
#define B_TOOLTIP_TEXT_COLOR ((color_which)21)
|
||||||
|
#define B_SUCCESS_COLOR ((color_which)100)
|
||||||
|
#define B_FAILURE_COLOR ((color_which)101)
|
||||||
|
#define B_MENU_SELECTED_BACKGROUND_COLOR B_MENU_SELECTION_BACKGROUND_COLOR
|
||||||
|
#define B_RANDOM_COLOR ((color_which)0x80000000)
|
||||||
|
#define B_MICHELANGELO_FAVORITE_COLOR ((color_which)0x80000001)
|
||||||
|
#define B_DSANDLER_FAVORITE_SKY_COLOR ((color_which)0x80000002)
|
||||||
|
#define B_DSANDLER_FAVORITE_INK_COLOR ((color_which)0x80000003)
|
||||||
|
#define B_DSANDLER_FAVORITE_SHOES_COLOR ((color_which)0x80000004)
|
||||||
|
#define B_DAVE_BROWN_FAVORITE_COLOR ((color_which)0x80000005)
|
||||||
|
#endif
|
||||||
|
#define NOCOL ((color_which)0)
|
||||||
|
|
||||||
|
|
||||||
struct gui_system_colour_ctx {
|
struct gui_system_colour_ctx {
|
||||||
const char *name;
|
const char *name;
|
||||||
int length;
|
int length;
|
||||||
css_color css_colour;
|
css_color css_colour;
|
||||||
colour *option_colour;
|
colour *option_colour;
|
||||||
lwc_string *lwcstr;
|
lwc_string *lwcstr;
|
||||||
|
color_which ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct gui_system_colour_ctx colour_list[] = {
|
static struct gui_system_colour_ctx colour_list[] = {
|
||||||
|
@ -52,170 +86,198 @@ static struct gui_system_colour_ctx colour_list[] = {
|
||||||
SLEN("ActiveBorder"),
|
SLEN("ActiveBorder"),
|
||||||
0xff000000,
|
0xff000000,
|
||||||
&option_sys_colour_ActiveBorder,
|
&option_sys_colour_ActiveBorder,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"ActiveCaption",
|
"ActiveCaption",
|
||||||
SLEN("ActiveCaption"),
|
SLEN("ActiveCaption"),
|
||||||
0xffdddddd,
|
0xffdddddd,
|
||||||
&option_sys_colour_ActiveCaption,
|
&option_sys_colour_ActiveCaption,
|
||||||
NULL
|
NULL,
|
||||||
|
B_WINDOW_TAB_COLOR
|
||||||
}, {
|
}, {
|
||||||
"AppWorkspace",
|
"AppWorkspace",
|
||||||
SLEN("AppWorkspace"),
|
SLEN("AppWorkspace"),
|
||||||
0xffeeeeee,
|
0xffeeeeee,
|
||||||
&option_sys_colour_AppWorkspace,
|
&option_sys_colour_AppWorkspace,
|
||||||
NULL
|
NULL,
|
||||||
|
B_PANEL_BACKGROUND_COLOR
|
||||||
}, {
|
}, {
|
||||||
"Background",
|
"Background",
|
||||||
SLEN("Background"),
|
SLEN("Background"),
|
||||||
0xff0000aa,
|
0xff0000aa,
|
||||||
&option_sys_colour_Background,
|
&option_sys_colour_Background,
|
||||||
NULL
|
NULL,
|
||||||
|
B_DESKTOP_COLOR
|
||||||
}, {
|
}, {
|
||||||
"ButtonFace",
|
"ButtonFace",
|
||||||
SLEN("ButtonFace"),
|
SLEN("ButtonFace"),
|
||||||
0xffaaaaaa,
|
0xffaaaaaa,
|
||||||
&option_sys_colour_ButtonFace,
|
&option_sys_colour_ButtonFace,
|
||||||
NULL
|
NULL,
|
||||||
|
B_CONTROL_BACKGROUND_COLOR
|
||||||
}, {
|
}, {
|
||||||
"ButtonHighlight",
|
"ButtonHighlight",
|
||||||
SLEN("ButtonHighlight"),
|
SLEN("ButtonHighlight"),
|
||||||
0xffdddddd,
|
0xffdddddd,
|
||||||
&option_sys_colour_ButtonHighlight,
|
&option_sys_colour_ButtonHighlight,
|
||||||
NULL
|
NULL,
|
||||||
|
B_CONTROL_HIGHLIGHT_COLOR
|
||||||
}, {
|
}, {
|
||||||
"ButtonShadow",
|
"ButtonShadow",
|
||||||
SLEN("ButtonShadow"),
|
SLEN("ButtonShadow"),
|
||||||
0xffbbbbbb,
|
0xffbbbbbb,
|
||||||
&option_sys_colour_ButtonShadow,
|
&option_sys_colour_ButtonShadow,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"ButtonText",
|
"ButtonText",
|
||||||
SLEN("ButtonText"),
|
SLEN("ButtonText"),
|
||||||
0xff000000,
|
0xff000000,
|
||||||
&option_sys_colour_ButtonText,
|
&option_sys_colour_ButtonText,
|
||||||
NULL
|
NULL,
|
||||||
|
B_CONTROL_TEXT_COLOR
|
||||||
}, {
|
}, {
|
||||||
"CaptionText",
|
"CaptionText",
|
||||||
SLEN("CaptionText"),
|
SLEN("CaptionText"),
|
||||||
0xff000000,
|
0xff000000,
|
||||||
&option_sys_colour_CaptionText,
|
&option_sys_colour_CaptionText,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"GrayText",
|
"GrayText",
|
||||||
SLEN("GrayText"),
|
SLEN("GrayText"),
|
||||||
0xffcccccc,
|
0xffcccccc,
|
||||||
&option_sys_colour_GrayText,
|
&option_sys_colour_GrayText,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"Highlight",
|
"Highlight",
|
||||||
SLEN("Highlight"),
|
SLEN("Highlight"),
|
||||||
0xff0000ee,
|
0xff0000ee,
|
||||||
&option_sys_colour_Highlight,
|
&option_sys_colour_Highlight,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"HighlightText",
|
"HighlightText",
|
||||||
SLEN("HighlightText"),
|
SLEN("HighlightText"),
|
||||||
0xff000000,
|
0xff000000,
|
||||||
&option_sys_colour_HighlightText,
|
&option_sys_colour_HighlightText,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"InactiveBorder",
|
"InactiveBorder",
|
||||||
SLEN("InactiveBorder"),
|
SLEN("InactiveBorder"),
|
||||||
0xffffffff,
|
0xffffffff,
|
||||||
&option_sys_colour_InactiveBorder,
|
&option_sys_colour_InactiveBorder,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"InactiveCaption",
|
"InactiveCaption",
|
||||||
SLEN("InactiveCaption"),
|
SLEN("InactiveCaption"),
|
||||||
0xffffffff,
|
0xffffffff,
|
||||||
&option_sys_colour_InactiveCaption,
|
&option_sys_colour_InactiveCaption,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"InactiveCaptionText",
|
"InactiveCaptionText",
|
||||||
SLEN("InactiveCaptionText"),
|
SLEN("InactiveCaptionText"),
|
||||||
0xffcccccc,
|
0xffcccccc,
|
||||||
&option_sys_colour_InactiveCaptionText,
|
&option_sys_colour_InactiveCaptionText,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"InfoBackground",
|
"InfoBackground",
|
||||||
SLEN("InfoBackground"),
|
SLEN("InfoBackground"),
|
||||||
0xffaaaaaa,
|
0xffaaaaaa,
|
||||||
&option_sys_colour_InfoBackground,
|
&option_sys_colour_InfoBackground,
|
||||||
NULL
|
NULL,
|
||||||
|
B_TOOLTIP_BACKGROUND_COLOR
|
||||||
}, {
|
}, {
|
||||||
"InfoText",
|
"InfoText",
|
||||||
SLEN("InfoText"),
|
SLEN("InfoText"),
|
||||||
0xff000000,
|
0xff000000,
|
||||||
&option_sys_colour_InfoText,
|
&option_sys_colour_InfoText,
|
||||||
NULL
|
NULL,
|
||||||
|
B_TOOLTIP_TEXT_COLOR
|
||||||
}, {
|
}, {
|
||||||
"Menu",
|
"Menu",
|
||||||
SLEN("Menu"),
|
SLEN("Menu"),
|
||||||
0xffaaaaaa,
|
0xffaaaaaa,
|
||||||
&option_sys_colour_Menu,
|
&option_sys_colour_Menu,
|
||||||
NULL
|
NULL,
|
||||||
|
B_MENU_BACKGROUND_COLOR
|
||||||
}, {
|
}, {
|
||||||
"MenuText",
|
"MenuText",
|
||||||
SLEN("MenuText"),
|
SLEN("MenuText"),
|
||||||
0xff000000,
|
0xff000000,
|
||||||
&option_sys_colour_MenuText,
|
&option_sys_colour_MenuText,
|
||||||
NULL
|
NULL,
|
||||||
|
B_MENU_ITEM_TEXT_COLOR
|
||||||
}, {
|
}, {
|
||||||
"Scrollbar",
|
"Scrollbar",
|
||||||
SLEN("Scrollbar"),
|
SLEN("Scrollbar"),
|
||||||
0xffaaaaaa,
|
0xffaaaaaa,
|
||||||
&option_sys_colour_Scrollbar,
|
&option_sys_colour_Scrollbar,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"ThreeDDarkShadow",
|
"ThreeDDarkShadow",
|
||||||
SLEN("ThreeDDarkShadow"),
|
SLEN("ThreeDDarkShadow"),
|
||||||
0xff555555,
|
0xff555555,
|
||||||
&option_sys_colour_ThreeDDarkShadow,
|
&option_sys_colour_ThreeDDarkShadow,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"ThreeDFace",
|
"ThreeDFace",
|
||||||
SLEN("ThreeDFace"),
|
SLEN("ThreeDFace"),
|
||||||
0xffdddddd,
|
0xffdddddd,
|
||||||
&option_sys_colour_ThreeDFace,
|
&option_sys_colour_ThreeDFace,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"ThreeDHighlight",
|
"ThreeDHighlight",
|
||||||
SLEN("ThreeDHighlight"),
|
SLEN("ThreeDHighlight"),
|
||||||
0xffaaaaaa,
|
0xffaaaaaa,
|
||||||
&option_sys_colour_ThreeDHighlight,
|
&option_sys_colour_ThreeDHighlight,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"ThreeDLightShadow",
|
"ThreeDLightShadow",
|
||||||
SLEN("ThreeDLightShadow"),
|
SLEN("ThreeDLightShadow"),
|
||||||
0xff999999,
|
0xff999999,
|
||||||
&option_sys_colour_ThreeDLightShadow,
|
&option_sys_colour_ThreeDLightShadow,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"ThreeDShadow",
|
"ThreeDShadow",
|
||||||
SLEN("ThreeDShadow"),
|
SLEN("ThreeDShadow"),
|
||||||
0xff777777,
|
0xff777777,
|
||||||
&option_sys_colour_ThreeDShadow,
|
&option_sys_colour_ThreeDShadow,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
"Window",
|
"Window",
|
||||||
SLEN("Window"),
|
SLEN("Window"),
|
||||||
0xffaaaaaa,
|
0xffaaaaaa,
|
||||||
&option_sys_colour_Window,
|
&option_sys_colour_Window,
|
||||||
NULL
|
NULL,
|
||||||
|
B_DOCUMENT_BACKGROUND_COLOR
|
||||||
}, {
|
}, {
|
||||||
"WindowFrame",
|
"WindowFrame",
|
||||||
SLEN("WindowFrame"),
|
SLEN("WindowFrame"),
|
||||||
0xff000000,
|
0xff000000,
|
||||||
&option_sys_colour_WindowFrame,
|
&option_sys_colour_WindowFrame,
|
||||||
NULL
|
NULL,
|
||||||
|
NOCOL
|
||||||
}, {
|
}, {
|
||||||
|
|
||||||
"WindowText",
|
"WindowText",
|
||||||
SLEN("WindowText"),
|
SLEN("WindowText"),
|
||||||
0xff000000,
|
0xff000000,
|
||||||
&option_sys_colour_WindowText,
|
&option_sys_colour_WindowText,
|
||||||
NULL
|
NULL,
|
||||||
|
B_DOCUMENT_TEXT_COLOR
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -248,6 +310,8 @@ bool gui_system_colour_init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsbeos_update_system_ui_colors();
|
||||||
|
|
||||||
gui_system_colour_pw = colour_list;
|
gui_system_colour_pw = colour_list;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -294,3 +358,27 @@ css_error gui_system_colour(void *pw, lwc_string *name, css_color *css_colour)
|
||||||
|
|
||||||
return CSS_INVALID;
|
return CSS_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void nsbeos_update_system_ui_colors(void)
|
||||||
|
{
|
||||||
|
unsigned int ccount;
|
||||||
|
|
||||||
|
for (ccount = 0; ccount < colour_list_len; ccount++) {
|
||||||
|
if (colour_list[ccount].ui == NOCOL)
|
||||||
|
continue;
|
||||||
|
rgb_color c = ui_color(colour_list[ccount].ui);
|
||||||
|
if (colour_list[ccount].ui == B_DESKTOP_COLOR) {
|
||||||
|
BScreen s;
|
||||||
|
c = s.DesktopColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
//printf("uic[%d] = ui_color(%d) %02x %02x %02x %02x\n", ccount,
|
||||||
|
// colour_list[ccount].ui, c.red, c.green, c.blue, c.alpha);
|
||||||
|
|
||||||
|
colour_list[ccount].css_colour = 0xff000000
|
||||||
|
| ((((uint32_t)c.red << 16) & 0xff0000)
|
||||||
|
| ((c.green << 8) & 0x00ff00)
|
||||||
|
| ((c.blue) & 0x0000ff));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue