apps: Convert to using Set*UIColor.
Signed-off-by: Augustin Cavalier <[email protected]> Patches 0045-0075, 0077-0087 from looncraz, unmodified.
This commit is contained in:
committed by
Augustin Cavalier
parent
f696e88a2c
commit
fa19dd4470
@@ -171,7 +171,7 @@ TeamMonitorWindow::TeamMonitorWindow()
|
|||||||
layout->SetSpacing(inset);
|
layout->SetSpacing(inset);
|
||||||
SetLayout(layout);
|
SetLayout(layout);
|
||||||
|
|
||||||
layout->View()->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
layout->View()->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fListView = new BListView("teams");
|
fListView = new BListView("teams");
|
||||||
fListView->SetSelectionMessage(new BMessage(TM_SELECTED_TEAM));
|
fListView->SetSelectionMessage(new BMessage(TM_SELECTED_TEAM));
|
||||||
@@ -606,7 +606,7 @@ TeamDescriptionView::TeamDescriptionView()
|
|||||||
BAlignment(B_ALIGN_HORIZONTAL_UNSET, B_ALIGN_VERTICAL_CENTER));
|
BAlignment(B_ALIGN_HORIZONTAL_UNSET, B_ALIGN_VERTICAL_CENTER));
|
||||||
|
|
||||||
BView* teamPropertiesView = new BView("team properties", B_WILL_DRAW);
|
BView* teamPropertiesView = new BView("team properties", B_WILL_DRAW);
|
||||||
teamPropertiesView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
teamPropertiesView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
BGroupLayout* layout = new BGroupLayout(B_HORIZONTAL);
|
BGroupLayout* layout = new BGroupLayout(B_HORIZONTAL);
|
||||||
teamPropertiesView->SetLayout(layout);
|
teamPropertiesView->SetLayout(layout);
|
||||||
BGroupLayoutBuilder(layout)
|
BGroupLayoutBuilder(layout)
|
||||||
@@ -738,7 +738,7 @@ AllShowingTextView::AllShowingTextView(const char* name)
|
|||||||
{
|
{
|
||||||
MakeEditable(false);
|
MakeEditable(false);
|
||||||
MakeSelectable(false);
|
MakeSelectable(false);
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ RuleFilterConfig::RuleFilterConfig(const BMailAddOnSettings& addOnSettings)
|
|||||||
BMailSettingsView("rulefilter_config"),
|
BMailSettingsView("rulefilter_config"),
|
||||||
fActionMenu(NULL)
|
fActionMenu(NULL)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
MatchHeaderSettings settings(addOnSettings);
|
MatchHeaderSettings settings(addOnSettings);
|
||||||
fAction = settings.Action();
|
fAction = settings.Action();
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ NotifierConfigView::NotifierConfigView()
|
|||||||
:
|
:
|
||||||
BMailSettingsView("notifier_config")
|
BMailSettingsView("notifier_config")
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BPopUpMenu *menu = new BPopUpMenu(B_EMPTY_STRING, false, false);
|
BPopUpMenu *menu = new BPopUpMenu(B_EMPTY_STRING, false, false);
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ SpamFilterConfig::SpamFilterConfig(const BMessage* settings)
|
|||||||
if (settings->FindFloat("SpamCutoffRatio", &fSpamCutoffRatio) != B_OK)
|
if (settings->FindFloat("SpamCutoffRatio", &fSpamCutoffRatio) != B_OK)
|
||||||
fSpamCutoffRatio = 0.99f;
|
fSpamCutoffRatio = 0.99f;
|
||||||
|
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fSubjectHintCheckBox = new BCheckBox("AddToSubject",
|
fSubjectHintCheckBox = new BCheckBox("AddToSubject",
|
||||||
B_TRANSLATE("Add spam rating to start of subject"), NULL);
|
B_TRANSLATE("Add spam rating to start of subject"), NULL);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ ConfigView::ConfigView()
|
|||||||
:
|
:
|
||||||
BMailSettingsView("fortune_filter")
|
BMailSettingsView("fortune_filter")
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fFileView = new MailFileConfigView(B_TRANSLATE("Fortune file:"),
|
fFileView = new MailFileConfigView(B_TRANSLATE("Fortune file:"),
|
||||||
"fortune_file", false, "", B_FILE_NODE);
|
"fortune_file", false, "", B_FILE_NODE);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ DocInfoWindow::DocInfoWindow(BMessage *docInfo)
|
|||||||
{
|
{
|
||||||
BRect bounds(Bounds());
|
BRect bounds(Bounds());
|
||||||
BView *background = new BView(bounds, "bachground", B_FOLLOW_ALL, B_WILL_DRAW);
|
BView *background = new BView(bounds, "bachground", B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
background->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
background->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(background);
|
AddChild(background);
|
||||||
|
|
||||||
bounds.InsetBy(10.0, 10.0);
|
bounds.InsetBy(10.0, 10.0);
|
||||||
@@ -238,7 +238,7 @@ DocInfoWindow::_SetupDocInfoView(BBox* panel)
|
|||||||
bounds.right -= B_V_SCROLL_BAR_WIDTH;
|
bounds.right -= B_V_SCROLL_BAR_WIDTH;
|
||||||
bounds.InsetBy(2.0, 2.0);
|
bounds.InsetBy(2.0, 2.0);
|
||||||
fTable = new BView(bounds, "table", B_FOLLOW_ALL, B_WILL_DRAW);
|
fTable = new BView(bounds, "table", B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
fTable->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fTable->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fTableScrollView = new BScrollView("scroll_table", fTable, B_FOLLOW_ALL, 0,
|
fTableScrollView = new BScrollView("scroll_table", fTable, B_FOLLOW_ALL, 0,
|
||||||
false, true);
|
false, true);
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ FontsWindow::FontsWindow(Fonts *fonts)
|
|||||||
// add a *dialog* background
|
// add a *dialog* background
|
||||||
BView* embeddingPanel = new BView("Embedding", B_WILL_DRAW
|
BView* embeddingPanel = new BView("Embedding", B_WILL_DRAW
|
||||||
| B_FRAME_EVENTS | B_NAVIGABLE_JUMP);
|
| B_FRAME_EVENTS | B_NAVIGABLE_JUMP);
|
||||||
embeddingPanel->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
embeddingPanel->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
// add font list
|
// add font list
|
||||||
#if USE_CLV
|
#if USE_CLV
|
||||||
@@ -166,7 +166,7 @@ FontsWindow::FontsWindow(Fonts *fonts)
|
|||||||
// add a *dialog* background
|
// add a *dialog* background
|
||||||
BView* cjkPanel = new BView("CJK", B_WILL_DRAW | B_FRAME_EVENTS
|
BView* cjkPanel = new BView("CJK", B_WILL_DRAW | B_FRAME_EVENTS
|
||||||
| B_NAVIGABLE_JUMP);
|
| B_NAVIGABLE_JUMP);
|
||||||
cjkPanel->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
cjkPanel->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BListView* list =
|
BListView* list =
|
||||||
new DragListView(BRect(),
|
new DragListView(BRect(),
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ SetupView::SetupView(BRect frame, BDirectory* directory)
|
|||||||
: BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW),
|
: BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW),
|
||||||
fPrinterDirectory(directory)
|
fPrinterDirectory(directory)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ private:
|
|||||||
IppSetupView::IppSetupView(BRect frame, BDirectory *d)
|
IppSetupView::IppSetupView(BRect frame, BDirectory *d)
|
||||||
: BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW), dir(d)
|
: BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW), dir(d)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IppSetupView::AttachedToWindow()
|
void IppSetupView::AttachedToWindow()
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ LprSetupView::LprSetupView(BRect frame, BDirectory *d)
|
|||||||
:
|
:
|
||||||
BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW), fDir(d)
|
BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW), fDir(d)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ GLifeConfig::GLifeConfig(BRect frame, GLifeState* pglsState)
|
|||||||
m_pglsState(pglsState)
|
m_pglsState(pglsState)
|
||||||
{
|
{
|
||||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
// Info text
|
// Info text
|
||||||
BStringView* name = new BStringView(frame, B_EMPTY_STRING,
|
BStringView* name = new BStringView(frame, B_EMPTY_STRING,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ ConfigView::ConfigView(BRect frame, Gravity* parent)
|
|||||||
B_WILL_DRAW | B_NAVIGABLE))
|
B_WILL_DRAW | B_NAVIGABLE))
|
||||||
{
|
{
|
||||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fShadeList->SetSelectionMessage(new BMessage(kMsgShade));
|
fShadeList->SetSelectionMessage(new BMessage(kMsgShade));
|
||||||
|
|
||||||
|
|||||||
@@ -604,7 +604,7 @@ SettingsView::SettingsView(BRect frame)
|
|||||||
void
|
void
|
||||||
SettingsView::AttachedToWindow()
|
SettingsView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fWidthMenu->Menu()->SetTargetForItems(this);
|
fWidthMenu->Menu()->SetTargetForItems(this);
|
||||||
fColorMenu->Menu()->SetTargetForItems(this);
|
fColorMenu->Menu()->SetTargetForItems(this);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ SlideShowConfigView::SlideShowConfigView(const BRect &frame, const char *name,
|
|||||||
{
|
{
|
||||||
fSettings = settings;
|
fSettings = settings;
|
||||||
|
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BMessage *pMsg;
|
BMessage *pMsg;
|
||||||
int32 val;
|
int32 val;
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ SpiderView::SpiderView(BRect frame, SpiderSaver* saver,
|
|||||||
: BView(frame, "spider view", B_FOLLOW_NONE, B_WILL_DRAW | B_PULSE_NEEDED),
|
: BView(frame, "spider view", B_FOLLOW_NONE, B_WILL_DRAW | B_PULSE_NEEDED),
|
||||||
fSaver(saver)
|
fSaver(saver)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
frame.OffsetTo(0.0, 0.0);
|
frame.OffsetTo(0.0, 0.0);
|
||||||
frame.InsetBy(10.0, 5.0);
|
frame.InsetBy(10.0, 5.0);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include <MessageFormat.h>
|
#include <MessageFormat.h>
|
||||||
#include <MessageRunner.h>
|
#include <MessageRunner.h>
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
|
#include <ObjectList.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <PathFinder.h>
|
#include <PathFinder.h>
|
||||||
@@ -143,11 +144,15 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class AboutView;
|
||||||
|
|
||||||
class AboutWindow : public BWindow {
|
class AboutWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
AboutWindow();
|
AboutWindow();
|
||||||
|
|
||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
|
|
||||||
|
AboutView* fAboutView;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -192,6 +197,7 @@ public:
|
|||||||
~AboutView();
|
~AboutView();
|
||||||
|
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
|
virtual void AllAttached();
|
||||||
virtual void Pulse();
|
virtual void Pulse();
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage* msg);
|
virtual void MessageReceived(BMessage* msg);
|
||||||
@@ -207,6 +213,7 @@ public:
|
|||||||
void PickRandomHaiku();
|
void PickRandomHaiku();
|
||||||
|
|
||||||
|
|
||||||
|
void _AdjustTextColors();
|
||||||
private:
|
private:
|
||||||
typedef std::map<std::string, PackageCredit*> PackageCreditMap;
|
typedef std::map<std::string, PackageCredit*> PackageCreditMap;
|
||||||
|
|
||||||
@@ -220,10 +227,13 @@ private:
|
|||||||
void _AddPackageCreditEntries();
|
void _AddPackageCreditEntries();
|
||||||
|
|
||||||
BStringView* fMemView;
|
BStringView* fMemView;
|
||||||
BTextView* fUptimeView;
|
BStringView* fUptimeView;
|
||||||
BView* fInfoView;
|
BView* fInfoView;
|
||||||
HyperTextView* fCreditsView;
|
HyperTextView* fCreditsView;
|
||||||
|
|
||||||
|
BObjectList<BView> fTextViews;
|
||||||
|
BObjectList<BView> fSubTextViews;
|
||||||
|
|
||||||
BBitmap* fLogo;
|
BBitmap* fLogo;
|
||||||
|
|
||||||
bigtime_t fLastActionTime;
|
bigtime_t fLastActionTime;
|
||||||
@@ -267,7 +277,8 @@ AboutWindow::AboutWindow()
|
|||||||
B_TITLED_WINDOW, B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_ZOOMABLE)
|
B_TITLED_WINDOW, B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_ZOOMABLE)
|
||||||
{
|
{
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
AddChild(new AboutView());
|
fAboutView = new AboutView();
|
||||||
|
AddChild(fAboutView);
|
||||||
|
|
||||||
// Make sure we take the minimal window size into account when centering
|
// Make sure we take the minimal window size into account when centering
|
||||||
BSize size = GetLayout()->MinSize();
|
BSize size = GetLayout()->MinSize();
|
||||||
@@ -411,7 +422,6 @@ AboutView::AboutView()
|
|||||||
fScrollRunner(NULL)
|
fScrollRunner(NULL)
|
||||||
{
|
{
|
||||||
// Begin Construction of System Information controls
|
// Begin Construction of System Information controls
|
||||||
|
|
||||||
system_info systemInfo;
|
system_info systemInfo;
|
||||||
get_system_info(&systemInfo);
|
get_system_info(&systemInfo);
|
||||||
|
|
||||||
@@ -449,10 +459,12 @@ AboutView::AboutView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
BStringView* versionView = new BStringView("ostext", string);
|
BStringView* versionView = new BStringView("ostext", string);
|
||||||
|
fSubTextViews.AddItem(versionView);
|
||||||
versionView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
versionView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
B_ALIGN_VERTICAL_UNSET));
|
B_ALIGN_VERTICAL_UNSET));
|
||||||
|
|
||||||
BStringView* abiView = new BStringView("abitext", B_HAIKU_ABI_NAME);
|
BStringView* abiView = new BStringView("abitext", B_HAIKU_ABI_NAME);
|
||||||
|
fSubTextViews.AddItem(abiView);
|
||||||
abiView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
abiView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
B_ALIGN_VERTICAL_UNSET));
|
B_ALIGN_VERTICAL_UNSET));
|
||||||
|
|
||||||
@@ -500,6 +512,7 @@ AboutView::AboutView()
|
|||||||
<< " " << get_cpu_model_string(platform, cpuVendor, cpuModel);
|
<< " " << get_cpu_model_string(platform, cpuVendor, cpuModel);
|
||||||
|
|
||||||
BStringView* cpuView = new BStringView("cputext", cpuType.String());
|
BStringView* cpuView = new BStringView("cputext", cpuType.String());
|
||||||
|
fSubTextViews.AddItem(cpuView);
|
||||||
cpuView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
cpuView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
B_ALIGN_VERTICAL_UNSET));
|
B_ALIGN_VERTICAL_UNSET));
|
||||||
|
|
||||||
@@ -511,16 +524,20 @@ AboutView::AboutView()
|
|||||||
clockSpeed / 1000.0f);
|
clockSpeed / 1000.0f);
|
||||||
|
|
||||||
BStringView* frequencyView = new BStringView("frequencytext", string);
|
BStringView* frequencyView = new BStringView("frequencytext", string);
|
||||||
|
fSubTextViews.AddItem(frequencyView);
|
||||||
frequencyView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
frequencyView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
B_ALIGN_VERTICAL_UNSET));
|
B_ALIGN_VERTICAL_UNSET));
|
||||||
|
|
||||||
// RAM
|
// RAM
|
||||||
BStringView *memSizeView = new BStringView("ramsizetext",
|
BStringView *memSizeView = new BStringView("ramsizetext",
|
||||||
MemSizeToString(string, sizeof(string), &systemInfo));
|
MemSizeToString(string, sizeof(string), &systemInfo));
|
||||||
|
fSubTextViews.AddItem(memSizeView);
|
||||||
memSizeView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
memSizeView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
B_ALIGN_VERTICAL_UNSET));
|
B_ALIGN_VERTICAL_UNSET));
|
||||||
|
|
||||||
fMemView = new BStringView("ramtext",
|
fMemView = new BStringView("ramtext",
|
||||||
MemUsageToString(string, sizeof(string), &systemInfo));
|
MemUsageToString(string, sizeof(string), &systemInfo));
|
||||||
|
fSubTextViews.AddItem(fMemView);
|
||||||
fMemView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
fMemView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
B_ALIGN_VERTICAL_UNSET));
|
B_ALIGN_VERTICAL_UNSET));
|
||||||
|
|
||||||
@@ -539,22 +556,19 @@ AboutView::AboutView()
|
|||||||
buildTimeDate.SetTo(kernelTimeDate);
|
buildTimeDate.SetTo(kernelTimeDate);
|
||||||
|
|
||||||
BStringView* kernelView = new BStringView("kerneltext", buildTimeDate);
|
BStringView* kernelView = new BStringView("kerneltext", buildTimeDate);
|
||||||
|
fSubTextViews.AddItem(kernelView);
|
||||||
kernelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
kernelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
B_ALIGN_VERTICAL_UNSET));
|
B_ALIGN_VERTICAL_UNSET));
|
||||||
|
|
||||||
// Uptime
|
// Uptime
|
||||||
fUptimeView = new BTextView("uptimetext");
|
fUptimeView = new BStringView("uptimetext", "...");
|
||||||
fUptimeView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fSubTextViews.AddItem(fUptimeView);
|
||||||
fUptimeView->MakeEditable(false);
|
|
||||||
fUptimeView->MakeSelectable(false);
|
|
||||||
fUptimeView->SetWordWrap(true);
|
|
||||||
|
|
||||||
fUptimeView->SetText(UptimeToString(string, sizeof(string)));
|
fUptimeView->SetText(UptimeToString(string, sizeof(string)));
|
||||||
|
|
||||||
const float offset = 5;
|
const float offset = 5;
|
||||||
|
|
||||||
SetLayout(new BGroupLayout(B_HORIZONTAL, 0));
|
SetLayout(new BGroupLayout(B_HORIZONTAL, 0));
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BLayoutBuilder::Group<>((BGroupLayout*)GetLayout())
|
BLayoutBuilder::Group<>((BGroupLayout*)GetLayout())
|
||||||
.AddGroup(B_VERTICAL, 0)
|
.AddGroup(B_VERTICAL, 0)
|
||||||
@@ -608,6 +622,14 @@ AboutView::AttachedToWindow()
|
|||||||
BView::AttachedToWindow();
|
BView::AttachedToWindow();
|
||||||
Window()->SetPulseRate(500000);
|
Window()->SetPulseRate(500000);
|
||||||
SetEventMask(B_POINTER_EVENTS);
|
SetEventMask(B_POINTER_EVENTS);
|
||||||
|
DoLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
AboutView::AllAttached()
|
||||||
|
{
|
||||||
|
_AdjustTextColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -647,6 +669,13 @@ void
|
|||||||
AboutView::MessageReceived(BMessage* msg)
|
AboutView::MessageReceived(BMessage* msg)
|
||||||
{
|
{
|
||||||
switch (msg->what) {
|
switch (msg->what) {
|
||||||
|
case B_COLORS_UPDATED:
|
||||||
|
{
|
||||||
|
if (msg->HasColor(ui_color_name(B_PANEL_TEXT_COLOR)))
|
||||||
|
_AdjustTextColors();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case SCROLL_CREDITS_VIEW:
|
case SCROLL_CREDITS_VIEW:
|
||||||
{
|
{
|
||||||
BScrollBar* scrollBar =
|
BScrollBar* scrollBar =
|
||||||
@@ -816,6 +845,28 @@ AboutView::PickRandomHaiku()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
AboutView::_AdjustTextColors()
|
||||||
|
{
|
||||||
|
rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR);
|
||||||
|
rgb_color color = mix_color(ViewColor(), textColor, 192);
|
||||||
|
|
||||||
|
BView* view = NULL;
|
||||||
|
for (int32 index = 0; index < fSubTextViews.CountItems(); ++index) {
|
||||||
|
view = fSubTextViews.ItemAt(index);
|
||||||
|
view->SetHighColor(color);
|
||||||
|
view->Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Labels
|
||||||
|
for (int32 index = 0; index < fTextViews.CountItems(); ++index) {
|
||||||
|
view = fTextViews.ItemAt(index);
|
||||||
|
view->SetHighColor(textColor);
|
||||||
|
view->Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BView*
|
BView*
|
||||||
AboutView::_CreateLabel(const char* name, const char* label)
|
AboutView::_CreateLabel(const char* name, const char* label)
|
||||||
{
|
{
|
||||||
@@ -823,6 +874,7 @@ AboutView::_CreateLabel(const char* name, const char* label)
|
|||||||
labelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
labelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
B_ALIGN_VERTICAL_UNSET));
|
B_ALIGN_VERTICAL_UNSET));
|
||||||
labelView->SetFont(be_bold_font);
|
labelView->SetFont(be_bold_font);
|
||||||
|
fTextViews.AddItem(labelView);
|
||||||
return labelView;
|
return labelView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -837,7 +889,7 @@ AboutView::_CreateCreditsView()
|
|||||||
fCreditsView->MakeEditable(false);
|
fCreditsView->MakeEditable(false);
|
||||||
fCreditsView->SetWordWrap(true);
|
fCreditsView->SetWordWrap(true);
|
||||||
fCreditsView->SetInsets(5, 5, 5, 5);
|
fCreditsView->SetInsets(5, 5, 5, 5);
|
||||||
fCreditsView->SetViewColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR));
|
fCreditsView->SetViewUIColor(B_DOCUMENT_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BScrollView* creditsScroller = new BScrollView("creditsScroller",
|
BScrollView* creditsScroller = new BScrollView("creditsScroller",
|
||||||
fCreditsView, B_WILL_DRAW | B_FRAME_EVENTS, false, true,
|
fCreditsView, B_WILL_DRAW | B_FRAME_EVENTS, false, true,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
SubDir HAIKU_TOP src apps aboutsystem ;
|
SubDir HAIKU_TOP src apps aboutsystem ;
|
||||||
|
|
||||||
UsePrivateHeaders app libroot shared ;
|
UsePrivateHeaders app interface libroot shared ;
|
||||||
|
|
||||||
Application AboutSystem :
|
Application AboutSystem :
|
||||||
AboutSystem.cpp
|
AboutSystem.cpp
|
||||||
|
|||||||
@@ -576,7 +576,7 @@ ActivityView::ActivityView(const char* name, const BMessage* settings)
|
|||||||
#endif
|
#endif
|
||||||
fSourcesLock("data sources")
|
fSourcesLock("data sources")
|
||||||
{
|
{
|
||||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetLowUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
_Init(settings);
|
_Init(settings);
|
||||||
|
|
||||||
@@ -1121,7 +1121,6 @@ ActivityView::MessageReceived(BMessage* message)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case kMsgUpdateResolution:
|
case kMsgUpdateResolution:
|
||||||
{
|
{
|
||||||
int32 resolution;
|
int32 resolution;
|
||||||
@@ -1479,7 +1478,9 @@ ActivityView::Draw(BRect updateRect)
|
|||||||
|
|
||||||
// draw legend
|
// draw legend
|
||||||
BRect legendFrame = _LegendFrame();
|
BRect legendFrame = _LegendFrame();
|
||||||
SetLowColor(fLegendBackgroundColor);
|
if (LowUIColor() == B_NO_COLOR)
|
||||||
|
SetLowColor(fLegendBackgroundColor);
|
||||||
|
|
||||||
if (drawBackground) {
|
if (drawBackground) {
|
||||||
BRect backgroundFrame(legendFrame);
|
BRect backgroundFrame(legendFrame);
|
||||||
backgroundFrame.bottom += kDraggerSize;
|
backgroundFrame.bottom += kDraggerSize;
|
||||||
@@ -1520,7 +1521,7 @@ ActivityView::Draw(BRect updateRect)
|
|||||||
TruncateString(&label, B_TRUNCATE_MIDDLE, possibleLabelWidth);
|
TruncateString(&label, B_TRUNCATE_MIDDLE, possibleLabelWidth);
|
||||||
|
|
||||||
if (drawBackground)
|
if (drawBackground)
|
||||||
SetHighColor(ui_color(B_CONTROL_TEXT_COLOR));
|
SetHighColor(ui_color(B_PANEL_TEXT_COLOR));
|
||||||
|
|
||||||
if (be_control_look == NULL) {
|
if (be_control_look == NULL) {
|
||||||
DrawString(label.String(), BPoint(6 + colorBox.right, y));
|
DrawString(label.String(), BPoint(6 + colorBox.right, y));
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ ActivityWindow::ActivityWindow()
|
|||||||
fLayout->SetSpacing(inset);
|
fLayout->SetSpacing(inset);
|
||||||
|
|
||||||
BView* top = new BView("top", 0, fLayout);
|
BView* top = new BView("top", 0, fLayout);
|
||||||
top->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
layout->AddView(top);
|
layout->AddView(top);
|
||||||
|
top->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BMessage viewState;
|
BMessage viewState;
|
||||||
int32 count = 0;
|
int32 count = 0;
|
||||||
@@ -99,7 +99,6 @@ ActivityWindow::ActivityWindow()
|
|||||||
topRect.top = menuBar->Bounds().bottom + 1;
|
topRect.top = menuBar->Bounds().bottom + 1;
|
||||||
|
|
||||||
BView* top = new BView(topRect, "top", B_FOLLOW_ALL, 0);
|
BView* top = new BView(topRect, "top", B_FOLLOW_ALL, 0);
|
||||||
top->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
layout->AddChild(top);
|
layout->AddChild(top);
|
||||||
|
|
||||||
BMessage viewState;
|
BMessage viewState;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public:
|
|||||||
SetLimitLabels(min.String(), max.String());
|
SetLimitLabels(min.String(), max.String());
|
||||||
SetHashMarks(B_HASH_MARKS_BOTTOM);
|
SetHashMarks(B_HASH_MARKS_BOTTOM);
|
||||||
SetHashMarkCount(levels);
|
SetHashMarkCount(levels);
|
||||||
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
if (message != NULL)
|
if (message != NULL)
|
||||||
SetModificationMessage(new BMessage(*message));
|
SetModificationMessage(new BMessage(*message));
|
||||||
|
|||||||
@@ -34,7 +34,13 @@ BootManagerWindow::BootManagerWindow()
|
|||||||
{
|
{
|
||||||
float minWidth, maxWidth, minHeight, maxHeight;
|
float minWidth, maxWidth, minHeight, maxHeight;
|
||||||
GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight);
|
GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight);
|
||||||
SetSizeLimits(250, maxWidth, 250, maxHeight);
|
|
||||||
|
// Use font to determine necessary size of window:
|
||||||
|
const BFont* font = be_plain_font;
|
||||||
|
minWidth = 400 * (double)font->Size() / 12.0f;
|
||||||
|
minHeight = 250 * (double)font->Size() / 12.0f;
|
||||||
|
|
||||||
|
SetSizeLimits(minWidth, maxWidth, minHeight, maxHeight);
|
||||||
|
|
||||||
fWizardView = new WizardView("wizard");
|
fWizardView = new WizardView("wizard");
|
||||||
BLayoutBuilder::Group<>(this)
|
BLayoutBuilder::Group<>(this)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ WizardPageView::WizardPageView(BMessage* settings, BRect frame,
|
|||||||
BView(frame, name, resizingMode, flags),
|
BView(frame, name, resizingMode, flags),
|
||||||
fSettings(settings)
|
fSettings(settings)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ WizardPageView::WizardPageView(BMessage* settings, const char* name)
|
|||||||
BView(name, B_WILL_DRAW),
|
BView(name, B_WILL_DRAW),
|
||||||
fSettings(settings)
|
fSettings(settings)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -54,9 +54,10 @@ WizardPageView::CreateDescription(BRect frame, const char* name,
|
|||||||
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,
|
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,
|
||||||
B_WILL_DRAW | B_PULSE_NEEDED | B_FRAME_EVENTS);
|
B_WILL_DRAW | B_PULSE_NEEDED | B_FRAME_EVENTS);
|
||||||
view->MakeEditable(false);
|
view->MakeEditable(false);
|
||||||
view->SetViewColor(ViewColor());
|
view->SetViewUIColor(ViewUIColor());
|
||||||
view->SetStylable(true);
|
view->SetStylable(true);
|
||||||
view->SetText(description);
|
view->SetText(description);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,9 +68,10 @@ WizardPageView::CreateDescription(const char* name,
|
|||||||
{
|
{
|
||||||
BTextView* view = new BTextView("text");
|
BTextView* view = new BTextView("text");
|
||||||
view->MakeEditable(false);
|
view->MakeEditable(false);
|
||||||
view->SetViewColor(ViewColor());
|
view->SetViewUIColor(ViewUIColor());
|
||||||
view->SetStylable(true);
|
view->SetStylable(true);
|
||||||
view->SetText(description);
|
view->SetText(description);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +86,15 @@ WizardPageView::MakeHeading(BTextView* view)
|
|||||||
BFont font;
|
BFont font;
|
||||||
view->GetFont(&font);
|
view->GetFont(&font);
|
||||||
font.SetFace(B_BOLD_FACE);
|
font.SetFace(B_BOLD_FACE);
|
||||||
view->SetFontAndColor(0, indexFirstLineEnd, &font);
|
font.SetSize(font.Size() + 1);
|
||||||
|
rgb_color color = ui_color(B_PANEL_TEXT_COLOR);
|
||||||
|
view->SetFontAndColor(0, indexFirstLineEnd, &font, B_FONT_ALL,
|
||||||
|
&color);
|
||||||
|
|
||||||
|
font.SetFace(B_REGULAR_FACE);
|
||||||
|
font.SetSize(font.Size() - 1);
|
||||||
|
view->SetFontAndColor(indexFirstLineEnd + 1, view->TextLength(),
|
||||||
|
&font, B_FONT_ALL, &color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,6 +237,8 @@ CharacterView::AttachedToWindow()
|
|||||||
{
|
{
|
||||||
Window()->AddShortcut('C', B_SHIFT_KEY,
|
Window()->AddShortcut('C', B_SHIFT_KEY,
|
||||||
new BMessage(kMsgCopyAsEscapedString), this);
|
new BMessage(kMsgCopyAsEscapedString), this);
|
||||||
|
SetViewColor(255, 255, 255, 255);
|
||||||
|
SetLowColor(ViewColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -402,6 +404,11 @@ CharacterView::Draw(BRect updateRect)
|
|||||||
BFont font;
|
BFont font;
|
||||||
GetFont(&font);
|
GetFont(&font);
|
||||||
|
|
||||||
|
rgb_color color = (rgb_color){0, 0, 0, 255};
|
||||||
|
rgb_color highlight = (rgb_color){220, 220, 220, 255};
|
||||||
|
rgb_color enclose = mix_color(highlight,
|
||||||
|
ui_color(B_CONTROL_HIGHLIGHT_COLOR), 128);
|
||||||
|
|
||||||
for (int32 i = _BlockAt(updateRect.LeftTop()); i < (int32)kNumUnicodeBlocks;
|
for (int32 i = _BlockAt(updateRect.LeftTop()); i < (int32)kNumUnicodeBlocks;
|
||||||
i++) {
|
i++) {
|
||||||
if (!IsShowingBlock(i))
|
if (!IsShowingBlock(i))
|
||||||
@@ -411,7 +418,7 @@ CharacterView::Draw(BRect updateRect)
|
|||||||
if (y > updateRect.bottom)
|
if (y > updateRect.bottom)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
SetHighColor(0, 0, 0);
|
SetHighColor(color);
|
||||||
DrawString(kUnicodeBlocks[i].name, BPoint(3, y + fTitleBase));
|
DrawString(kUnicodeBlocks[i].name, BPoint(3, y + fTitleBase));
|
||||||
|
|
||||||
y += fTitleHeight;
|
y += fTitleHeight;
|
||||||
@@ -424,11 +431,14 @@ CharacterView::Draw(BRect updateRect)
|
|||||||
&& y < updateRect.bottom) {
|
&& y < updateRect.bottom) {
|
||||||
// Stroke frame around the active character
|
// Stroke frame around the active character
|
||||||
if (fHasCharacter && fCurrentCharacter == c) {
|
if (fHasCharacter && fCurrentCharacter == c) {
|
||||||
SetHighColor(tint_color(ViewColor(), 1.05f));
|
SetHighColor(highlight);
|
||||||
FillRect(BRect(x, y, x + fCharacterWidth,
|
FillRect(BRect(x, y, x + fCharacterWidth,
|
||||||
y + fCharacterHeight - fGap));
|
y + fCharacterHeight - fGap));
|
||||||
|
SetHighColor(enclose);
|
||||||
|
StrokeRect(BRect(x, y, x + fCharacterWidth,
|
||||||
|
y + fCharacterHeight - fGap));
|
||||||
|
|
||||||
SetHighColor(0, 0, 0);
|
SetHighColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw character
|
// Draw character
|
||||||
|
|||||||
@@ -181,9 +181,9 @@ InspectorWindow::_Init()
|
|||||||
.End()
|
.End()
|
||||||
.End();
|
.End();
|
||||||
|
|
||||||
fHexMode->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fHexMode->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
fEndianMode->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fEndianMode->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
fTextMode->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fTextMode->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
int32 targetEndian = fTeam->GetArchitecture()->IsBigEndian()
|
int32 targetEndian = fTeam->GetArchitecture()->IsBigEndian()
|
||||||
? EndianModeBigEndian : EndianModeLittleEndian;
|
? EndianModeBigEndian : EndianModeLittleEndian;
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ void
|
|||||||
MemoryView::AttachedToWindow()
|
MemoryView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
BView::AttachedToWindow();
|
BView::AttachedToWindow();
|
||||||
SetViewColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR));
|
SetViewUIColor(B_DOCUMENT_BACKGROUND_COLOR);
|
||||||
SetFont(be_fixed_font);
|
SetFont(be_fixed_font);
|
||||||
fCharWidth = be_fixed_font->StringWidth("a");
|
fCharWidth = be_fixed_font->StringWidth("a");
|
||||||
font_height fontHeight;
|
font_height fontHeight;
|
||||||
@@ -689,7 +689,7 @@ MemoryView::MaxSize()
|
|||||||
void
|
void
|
||||||
MemoryView::_Init()
|
MemoryView::_Init()
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ ExpressionPromptWindow::_Init()
|
|||||||
BLayoutItem* inputItem = fExpressionInput->CreateTextViewLayoutItem();
|
BLayoutItem* inputItem = fExpressionInput->CreateTextViewLayoutItem();
|
||||||
inputItem->SetExplicitMinSize(BSize(200.0, B_SIZE_UNSET));
|
inputItem->SetExplicitMinSize(BSize(200.0, B_SIZE_UNSET));
|
||||||
inputItem->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
inputItem->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
||||||
labelItem->View()->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
labelItem->View()->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ WatchPromptWindow::_Init()
|
|||||||
|
|
||||||
fTypeField = new BMenuField("Type:", typeMenu);
|
fTypeField = new BMenuField("Type:", typeMenu);
|
||||||
BLayoutItem* labelItem = fTypeField->CreateLabelLayoutItem();
|
BLayoutItem* labelItem = fTypeField->CreateLabelLayoutItem();
|
||||||
labelItem->View()->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
labelItem->View()->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||||
.AddGroup(B_HORIZONTAL, 4.0f)
|
.AddGroup(B_HORIZONTAL, 4.0f)
|
||||||
|
|||||||
@@ -231,6 +231,12 @@ CalcView::AttachedToWindow()
|
|||||||
void
|
void
|
||||||
CalcView::MessageReceived(BMessage* message)
|
CalcView::MessageReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
|
if (message->what == B_COLORS_UPDATED
|
||||||
|
&& message->HasColor(ui_color_name(B_PANEL_BACKGROUND_COLOR))) {
|
||||||
|
_Colorize();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Parent() && (Parent()->Flags() & B_DRAW_ON_CHILDREN) != 0) {
|
if (Parent() && (Parent()->Flags() & B_DRAW_ON_CHILDREN) != 0) {
|
||||||
// if we are embedded in desktop we need to receive these
|
// if we are embedded in desktop we need to receive these
|
||||||
// message here since we don't have a parent BWindow
|
// message here since we don't have a parent BWindow
|
||||||
@@ -504,7 +510,7 @@ CalcView::Draw(BRect updateRect)
|
|||||||
|
|
||||||
be_control_look->DrawLabel(this, key->label, frame, updateRect,
|
be_control_look->DrawLabel(this, key->label, frame, updateRect,
|
||||||
fBaseColor, flags, BAlignment(B_ALIGN_HORIZONTAL_CENTER,
|
fBaseColor, flags, BAlignment(B_ALIGN_HORIZONTAL_CENTER,
|
||||||
B_ALIGN_VERTICAL_CENTER));
|
B_ALIGN_VERTICAL_CENTER), &fButtonTextColor);
|
||||||
|
|
||||||
key++;
|
key++;
|
||||||
}
|
}
|
||||||
@@ -1288,6 +1294,8 @@ CalcView::_AudioFeedback(bool inBackGround)
|
|||||||
void
|
void
|
||||||
CalcView::_Colorize()
|
CalcView::_Colorize()
|
||||||
{
|
{
|
||||||
|
fBaseColor = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
// calculate light and dark color from base color
|
// calculate light and dark color from base color
|
||||||
fLightColor.red = (uint8)(fBaseColor.red * 1.25);
|
fLightColor.red = (uint8)(fBaseColor.red * 1.25);
|
||||||
fLightColor.green = (uint8)(fBaseColor.green * 1.25);
|
fLightColor.green = (uint8)(fBaseColor.green * 1.25);
|
||||||
@@ -1300,16 +1308,13 @@ CalcView::_Colorize()
|
|||||||
fDarkColor.alpha = 255;
|
fDarkColor.alpha = 255;
|
||||||
|
|
||||||
// keypad text color
|
// keypad text color
|
||||||
uint8 lightness = (fBaseColor.red + fBaseColor.green + fBaseColor.blue) / 3;
|
if (fBaseColor.Brightness() > 100)
|
||||||
if (lightness > 200)
|
|
||||||
fButtonTextColor = (rgb_color){ 0, 0, 0, 255 };
|
fButtonTextColor = (rgb_color){ 0, 0, 0, 255 };
|
||||||
else
|
else
|
||||||
fButtonTextColor = (rgb_color){ 255, 255, 255, 255 };
|
fButtonTextColor = (rgb_color){ 255, 255, 255, 255 };
|
||||||
|
|
||||||
// expression text color
|
// expression text color
|
||||||
lightness = (fExpressionBGColor.red
|
if (fExpressionBGColor.Brightness() > 100)
|
||||||
+ fExpressionBGColor.green + fExpressionBGColor.blue) / 3;
|
|
||||||
if (lightness > 200)
|
|
||||||
fExpressionTextColor = (rgb_color){ 0, 0, 0, 255 };
|
fExpressionTextColor = (rgb_color){ 0, 0, 0, 255 };
|
||||||
else
|
else
|
||||||
fExpressionTextColor = (rgb_color){ 255, 255, 255, 255 };
|
fExpressionTextColor = (rgb_color){ 255, 255, 255, 255 };
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ PropertyListPlain::PropertyListPlain(const char* name)
|
|||||||
:
|
:
|
||||||
BView(name, 0, NULL)
|
BView(name, 0, NULL)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,10 +42,13 @@ PropertyListPlain::AddAttributes(const Attributes& attributes)
|
|||||||
{
|
{
|
||||||
RemoveAll();
|
RemoveAll();
|
||||||
BGroupLayoutBuilder layout(B_VERTICAL);
|
BGroupLayoutBuilder layout(B_VERTICAL);
|
||||||
BTextView* view = new BTextView(BRect(0, 0, 1000, 1000),
|
|
||||||
"", BRect(5, 5, 995, 995), B_FOLLOW_ALL_SIDES);
|
|
||||||
|
|
||||||
view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
BTextView* view = new BTextView(BRect(0, 0, 1000, 1000),
|
||||||
|
"attribs", BRect(5, 5, 995, 995), B_FOLLOW_ALL_SIDES);
|
||||||
|
|
||||||
|
rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR);
|
||||||
|
view->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
view->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor);
|
||||||
view->MakeEditable(false);
|
view->MakeEditable(false);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < attributes.size(); i++) {
|
for (unsigned int i = 0; i < attributes.size(); i++) {
|
||||||
@@ -59,6 +62,7 @@ PropertyListPlain::AddAttributes(const Attributes& attributes)
|
|||||||
}
|
}
|
||||||
layout.Add(view);
|
layout.Add(view);
|
||||||
|
|
||||||
|
fAttributeViews.AddItem(view);
|
||||||
AddChild(layout);
|
AddChild(layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,6 +82,22 @@ void
|
|||||||
PropertyListPlain::MessageReceived(BMessage* message)
|
PropertyListPlain::MessageReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
|
case B_COLORS_UPDATED:
|
||||||
|
{
|
||||||
|
rgb_color color;
|
||||||
|
if (message->FindColor(ui_color_name(B_PANEL_TEXT_COLOR), &color)
|
||||||
|
!= B_OK)
|
||||||
|
break;
|
||||||
|
|
||||||
|
BTextView* view = NULL;
|
||||||
|
int32 count = fAttributeViews.CountItems();
|
||||||
|
for (int32 index = 0; index < count; ++index) {
|
||||||
|
view = fAttributeViews.ItemAt(index);
|
||||||
|
view->SetFontAndColor(be_plain_font, 0, &color);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BView::MessageReceived(message);
|
BView::MessageReceived(message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
#define PROPERTY_LIST_PLAIN_H
|
#define PROPERTY_LIST_PLAIN_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <ObjectList.h>
|
||||||
|
#include <TextView.h>
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
|
|
||||||
#include "Device.h"
|
#include "Device.h"
|
||||||
@@ -28,6 +30,7 @@ public:
|
|||||||
virtual void DetachedFromWindow();
|
virtual void DetachedFromWindow();
|
||||||
private:
|
private:
|
||||||
BView* rootView;
|
BView* rootView;
|
||||||
|
BObjectList<BTextView> fAttributeViews;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PROPERTY_LIST_PLAIN_H */
|
#endif /* PROPERTY_LIST_PLAIN_H */
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
|||||||
|
|
||||||
// Create the TabView and Tabs
|
// Create the TabView and Tabs
|
||||||
BTabView *tabView = new BTabView(rtab,"resource_usage_tabview");
|
BTabView *tabView = new BTabView(rtab,"resource_usage_tabview");
|
||||||
tabView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
tabView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
rtab = tabView->Bounds();
|
rtab = tabView->Bounds();
|
||||||
rtab.InsetBy(5,5);
|
rtab.InsetBy(5,5);
|
||||||
|
|||||||
@@ -492,7 +492,7 @@ FindWindow::FindWindow(BRect _rect, BMessage& previous, BMessenger& target,
|
|||||||
fTarget(target)
|
fTarget(target)
|
||||||
{
|
{
|
||||||
BView* view = new BView(Bounds(), "main", B_FOLLOW_ALL, 0);
|
BView* view = new BView(Bounds(), "main", B_FOLLOW_ALL, 0);
|
||||||
view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
view->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(view);
|
AddChild(view);
|
||||||
|
|
||||||
int8 mode = kAsciiMode;
|
int8 mode = kAsciiMode;
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ IconView::AttachedToWindow()
|
|||||||
if (Parent() != NULL)
|
if (Parent() != NULL)
|
||||||
SetViewColor(Parent()->ViewColor());
|
SetViewColor(Parent()->ViewColor());
|
||||||
else
|
else
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -480,7 +480,7 @@ HeaderView::HeaderView(const entry_ref *ref, DataEditor &editor)
|
|||||||
fPosition(0),
|
fPosition(0),
|
||||||
fLastPosition(0)
|
fLastPosition(0)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
GridLayout()->SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
GridLayout()->SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING);
|
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING);
|
||||||
|
|
||||||
@@ -1102,7 +1102,7 @@ TypeView::TypeView(BRect rect, const char* name, int32 index,
|
|||||||
DataEditor& editor, int32 resizingMode)
|
DataEditor& editor, int32 resizingMode)
|
||||||
: BView(rect, name, resizingMode, B_FRAME_EVENTS)
|
: BView(rect, name, resizingMode, B_FRAME_EVENTS)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fTypeEditorView = GetTypeEditorAt(index, Frame(), editor);
|
fTypeEditorView = GetTypeEditorAt(index, Frame(), editor);
|
||||||
if (fTypeEditorView == NULL) {
|
if (fTypeEditorView == NULL) {
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ TypeEditorView::TypeMatches()
|
|||||||
StringEditor::StringEditor(DataEditor& editor)
|
StringEditor::StringEditor(DataEditor& editor)
|
||||||
: TypeEditorView(B_TRANSLATE("String editor"), 0, editor)
|
: TypeEditorView(B_TRANSLATE("String editor"), 0, editor)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
|
|
||||||
BStringView *stringView = new BStringView(B_EMPTY_STRING,
|
BStringView *stringView = new BStringView(B_EMPTY_STRING,
|
||||||
@@ -283,7 +283,7 @@ StringEditor::MessageReceived(BMessage *message)
|
|||||||
MimeTypeEditor::MimeTypeEditor(BRect rect, DataEditor& editor)
|
MimeTypeEditor::MimeTypeEditor(BRect rect, DataEditor& editor)
|
||||||
: TypeEditorView(rect, B_TRANSLATE("MIME type editor"), B_FOLLOW_LEFT_RIGHT, 0, editor)
|
: TypeEditorView(rect, B_TRANSLATE("MIME type editor"), B_FOLLOW_LEFT_RIGHT, 0, editor)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fTextControl = new BTextControl(rect.InsetByCopy(5, 5), B_EMPTY_STRING,
|
fTextControl = new BTextControl(rect.InsetByCopy(5, 5), B_EMPTY_STRING,
|
||||||
B_TRANSLATE("MIME type:"), NULL, new BMessage(kMsgValueChanged), B_FOLLOW_ALL);
|
B_TRANSLATE("MIME type:"), NULL, new BMessage(kMsgValueChanged), B_FOLLOW_ALL);
|
||||||
@@ -374,7 +374,7 @@ MimeTypeEditor::MessageReceived(BMessage *message)
|
|||||||
NumberEditor::NumberEditor(BRect rect, DataEditor &editor)
|
NumberEditor::NumberEditor(BRect rect, DataEditor &editor)
|
||||||
: TypeEditorView(rect, B_TRANSLATE("Number editor"), B_FOLLOW_LEFT_RIGHT, 0, editor)
|
: TypeEditorView(rect, B_TRANSLATE("Number editor"), B_FOLLOW_LEFT_RIGHT, 0, editor)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fTextControl = new BTextControl(rect.InsetByCopy(5, 5), B_EMPTY_STRING,
|
fTextControl = new BTextControl(rect.InsetByCopy(5, 5), B_EMPTY_STRING,
|
||||||
_TypeLabel(), NULL, new BMessage(kMsgValueChanged), B_FOLLOW_ALL);
|
_TypeLabel(), NULL, new BMessage(kMsgValueChanged), B_FOLLOW_ALL);
|
||||||
@@ -750,7 +750,7 @@ NumberEditor::MessageReceived(BMessage *message)
|
|||||||
BooleanEditor::BooleanEditor(BRect rect, DataEditor &editor)
|
BooleanEditor::BooleanEditor(BRect rect, DataEditor &editor)
|
||||||
: TypeEditorView(rect, B_TRANSLATE("Boolean editor"), B_FOLLOW_NONE, 0, editor)
|
: TypeEditorView(rect, B_TRANSLATE("Boolean editor"), B_FOLLOW_NONE, 0, editor)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BPopUpMenu *menu = new BPopUpMenu("bool");
|
BPopUpMenu *menu = new BPopUpMenu("bool");
|
||||||
BMessage *message;
|
BMessage *message;
|
||||||
@@ -906,7 +906,7 @@ ImageView::AttachedToWindow()
|
|||||||
if (Parent() != NULL)
|
if (Parent() != NULL)
|
||||||
SetViewColor(Parent()->ViewColor());
|
SetViewColor(Parent()->ViewColor());
|
||||||
else
|
else
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fEditor.StartWatching(this);
|
fEditor.StartWatching(this);
|
||||||
if (fScaleSlider != NULL)
|
if (fScaleSlider != NULL)
|
||||||
@@ -1119,7 +1119,7 @@ ImageView::_UpdateImage()
|
|||||||
MessageView::MessageView(BRect rect, DataEditor &editor)
|
MessageView::MessageView(BRect rect, DataEditor &editor)
|
||||||
: TypeEditorView(rect, B_TRANSLATE("Message View"), B_FOLLOW_ALL, 0, editor)
|
: TypeEditorView(rect, B_TRANSLATE("Message View"), B_FOLLOW_ALL, 0, editor)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
rect = Bounds().InsetByCopy(10, 10);
|
rect = Bounds().InsetByCopy(10, 10);
|
||||||
rect.right -= B_V_SCROLL_BAR_WIDTH;
|
rect.right -= B_V_SCROLL_BAR_WIDTH;
|
||||||
@@ -1128,8 +1128,8 @@ MessageView::MessageView(BRect rect, DataEditor &editor)
|
|||||||
fTextView = new BTextView(rect, B_EMPTY_STRING,
|
fTextView = new BTextView(rect, B_EMPTY_STRING,
|
||||||
rect.OffsetToCopy(B_ORIGIN).InsetByCopy(5, 5),
|
rect.OffsetToCopy(B_ORIGIN).InsetByCopy(5, 5),
|
||||||
B_FOLLOW_ALL, B_WILL_DRAW);
|
B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
fTextView->SetViewColor(ViewColor());
|
fTextView->SetViewUIColor(ViewUIColor());
|
||||||
fTextView->SetLowColor(ViewColor());
|
fTextView->SetLowUIColor(ViewUIColor());
|
||||||
|
|
||||||
BScrollView *scrollView = new BScrollView("scroller", fTextView,
|
BScrollView *scrollView = new BScrollView("scroller", fTextView,
|
||||||
B_FOLLOW_ALL, B_WILL_DRAW, true, true);
|
B_FOLLOW_ALL, B_WILL_DRAW, true, true);
|
||||||
|
|||||||
@@ -349,9 +349,8 @@ DiskView::DiskView(const BRect& frame, uint32 resizeMode,
|
|||||||
SetLayout(layout);
|
SetLayout(layout);
|
||||||
|
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewColor(B_TRANSPARENT_COLOR);
|
||||||
rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
|
SetHighUIColor(B_PANEL_BACKGROUND_COLOR, B_DARKEN_2_TINT);
|
||||||
SetHighColor(tint_color(base, B_DARKEN_2_TINT));
|
SetLowUIColor(B_PANEL_BACKGROUND_COLOR, 1.221f);
|
||||||
SetLowColor(tint_color(base, (B_DARKEN_2_TINT + B_DARKEN_1_TINT) / 2));
|
|
||||||
|
|
||||||
#ifdef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
#ifdef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
||||||
PartitionView* view;
|
PartitionView* view;
|
||||||
@@ -421,7 +420,13 @@ DiskView::Draw(BRect updateRect)
|
|||||||
(bounds.Height() - (fh.ascent + fh.descent) * 2) / 2.0);
|
(bounds.Height() - (fh.ascent + fh.descent) * 2) / 2.0);
|
||||||
|
|
||||||
FillRoundRect(messageBounds, 4, 4, B_SOLID_LOW);
|
FillRoundRect(messageBounds, 4, 4, B_SOLID_LOW);
|
||||||
SetHighColor(tint_color(HighColor(), B_DARKEN_4_TINT));
|
rgb_color color = LowColor();
|
||||||
|
if (color.Brightness() > 100)
|
||||||
|
color = tint_color(color, B_DARKEN_4_TINT);
|
||||||
|
else
|
||||||
|
color = tint_color(color, B_LIGHTEN_2_TINT);
|
||||||
|
|
||||||
|
SetHighColor(color);
|
||||||
BPoint textOffset;
|
BPoint textOffset;
|
||||||
textOffset.x = messageBounds.left + fh.ascent;
|
textOffset.x = messageBounds.left + fh.ascent;
|
||||||
textOffset.y = (messageBounds.top + messageBounds.bottom
|
textOffset.y = (messageBounds.top + messageBounds.bottom
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ PasswordAlert::PasswordAlert(const char* title, const char* text)
|
|||||||
|
|
||||||
fTextControl = new BTextControl(textControlRect, "_password_", text,
|
fTextControl = new BTextControl(textControlRect, "_password_", text,
|
||||||
NULL, new BMessage('pass'), B_FOLLOW_ALL);
|
NULL, new BMessage('pass'), B_FOLLOW_ALL);
|
||||||
fTextControl->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fTextControl->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
fTextControl->TextView()->HideTyping(true);
|
fTextControl->TextView()->HideTyping(true);
|
||||||
fTextControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
|
fTextControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
|
||||||
fTextControl->SetDivider(10 + fTextControl->StringWidth(text));
|
fTextControl->SetDivider(10 + fTextControl->StringWidth(text));
|
||||||
@@ -190,7 +190,7 @@ TAlertView::TAlertView(BRect frame)
|
|||||||
BView(frame, "TAlertView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW),
|
BView(frame, "TAlertView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW),
|
||||||
fIconBitmap(NULL)
|
fIconBitmap(NULL)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <MutableLocaleRoster.h>
|
#include <MutableLocaleRoster.h>
|
||||||
#include <ObjectList.h>
|
#include <ObjectList.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
|
#include <Screen.h>
|
||||||
#include <ScrollView.h>
|
#include <ScrollView.h>
|
||||||
#include <SeparatorView.h>
|
#include <SeparatorView.h>
|
||||||
#include <StringItem.h>
|
#include <StringItem.h>
|
||||||
@@ -155,11 +156,22 @@ BootPromptWindow::BootPromptWindow()
|
|||||||
{
|
{
|
||||||
SetSizeLimits(450, 16384, 350, 16384);
|
SetSizeLimits(450, 16384, 350, 16384);
|
||||||
|
|
||||||
|
rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR);
|
||||||
fInfoTextView = new BTextView("");
|
fInfoTextView = new BTextView("");
|
||||||
fInfoTextView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fInfoTextView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
fInfoTextView->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor);
|
||||||
fInfoTextView->MakeEditable(false);
|
fInfoTextView->MakeEditable(false);
|
||||||
fInfoTextView->MakeSelectable(false);
|
fInfoTextView->MakeSelectable(false);
|
||||||
|
|
||||||
|
// Carefully designed to not exceed the 640x480 resolution with a 12pt font.
|
||||||
|
float width = fInfoTextView->StringWidth("Thank you for trying out Haiku,"
|
||||||
|
" We hope you like it!") * 1.5;
|
||||||
|
float height = be_plain_font->Size() * 36;
|
||||||
|
|
||||||
|
BRect newFrame(0, 0, width, height);
|
||||||
|
newFrame = newFrame & BScreen().Frame();
|
||||||
|
ResizeTo(newFrame.Width(), newFrame.Height());
|
||||||
|
|
||||||
fDesktopButton = new BButton("", new BMessage(MSG_BOOT_DESKTOP));
|
fDesktopButton = new BButton("", new BMessage(MSG_BOOT_DESKTOP));
|
||||||
fDesktopButton->SetTarget(be_app);
|
fDesktopButton->SetTarget(be_app);
|
||||||
fDesktopButton->MakeDefault(true);
|
fDesktopButton->MakeDefault(true);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ ControlView::ControlView()
|
|||||||
fCycleFonts(false),
|
fCycleFonts(false),
|
||||||
fFontStyleindex(0)
|
fFontStyleindex(0)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
GroupLayout()->SetInsets(B_USE_WINDOW_SPACING);
|
GroupLayout()->SetInsets(B_USE_WINDOW_SPACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,6 +238,18 @@ CharacterStyle::SetForegroundColor(uint8 r, uint8 g, uint8 b, uint8 a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
CharacterStyle::SetForegroundColor(color_which which)
|
||||||
|
{
|
||||||
|
CharacterStyleDataRef data = fStyleData->SetForegroundColor(which);
|
||||||
|
if (data == fStyleData)
|
||||||
|
return data->WhichForegroundColor() == which;
|
||||||
|
|
||||||
|
fStyleData = data;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetForegroundColor(rgb_color color)
|
CharacterStyle::SetForegroundColor(rgb_color color)
|
||||||
{
|
{
|
||||||
@@ -257,6 +269,13 @@ CharacterStyle::ForegroundColor() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
color_which
|
||||||
|
CharacterStyle::WhichForegroundColor() const
|
||||||
|
{
|
||||||
|
return fStyleData->WhichForegroundColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetBackgroundColor(uint8 r, uint8 g, uint8 b, uint8 a)
|
CharacterStyle::SetBackgroundColor(uint8 r, uint8 g, uint8 b, uint8 a)
|
||||||
{
|
{
|
||||||
@@ -264,6 +283,18 @@ CharacterStyle::SetBackgroundColor(uint8 r, uint8 g, uint8 b, uint8 a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
CharacterStyle::SetBackgroundColor(color_which which)
|
||||||
|
{
|
||||||
|
CharacterStyleDataRef data = fStyleData->SetBackgroundColor(which);
|
||||||
|
if (data == fStyleData)
|
||||||
|
return data->WhichBackgroundColor() == which;
|
||||||
|
|
||||||
|
fStyleData = data;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetBackgroundColor(rgb_color color)
|
CharacterStyle::SetBackgroundColor(rgb_color color)
|
||||||
{
|
{
|
||||||
@@ -283,6 +314,25 @@ CharacterStyle::BackgroundColor() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
color_which
|
||||||
|
CharacterStyle::WhichBackgroundColor() const
|
||||||
|
{
|
||||||
|
return fStyleData->WhichBackgroundColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
CharacterStyle::SetStrikeOutColor(color_which which)
|
||||||
|
{
|
||||||
|
CharacterStyleDataRef data = fStyleData->SetStrikeOutColor(which);
|
||||||
|
if (data == fStyleData)
|
||||||
|
return data->WhichStrikeOutColor() == which;
|
||||||
|
|
||||||
|
fStyleData = data;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetStrikeOutColor(rgb_color color)
|
CharacterStyle::SetStrikeOutColor(rgb_color color)
|
||||||
{
|
{
|
||||||
@@ -302,6 +352,25 @@ CharacterStyle::StrikeOutColor() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
color_which
|
||||||
|
CharacterStyle::WhichStrikeOutColor() const
|
||||||
|
{
|
||||||
|
return fStyleData->WhichStrikeOutColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
CharacterStyle::SetUnderlineColor(color_which which)
|
||||||
|
{
|
||||||
|
CharacterStyleDataRef data = fStyleData->SetUnderlineColor(which);
|
||||||
|
if (data == fStyleData)
|
||||||
|
return data->WhichUnderlineColor() == which;
|
||||||
|
|
||||||
|
fStyleData = data;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetUnderlineColor(rgb_color color)
|
CharacterStyle::SetUnderlineColor(rgb_color color)
|
||||||
{
|
{
|
||||||
@@ -321,6 +390,13 @@ CharacterStyle::UnderlineColor() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
color_which
|
||||||
|
CharacterStyle::WhichUnderlineColor() const
|
||||||
|
{
|
||||||
|
return fStyleData->WhichUnderlineColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetStrikeOut(uint8 strikeOut)
|
CharacterStyle::SetStrikeOut(uint8 strikeOut)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,20 +44,28 @@ public:
|
|||||||
bool SetForegroundColor(
|
bool SetForegroundColor(
|
||||||
uint8 r, uint8 g, uint8 b,
|
uint8 r, uint8 g, uint8 b,
|
||||||
uint8 a = 255);
|
uint8 a = 255);
|
||||||
|
bool SetForegroundColor(color_which which);
|
||||||
bool SetForegroundColor(rgb_color color);
|
bool SetForegroundColor(rgb_color color);
|
||||||
rgb_color ForegroundColor() const;
|
rgb_color ForegroundColor() const;
|
||||||
|
color_which WhichForegroundColor() const;
|
||||||
|
|
||||||
bool SetBackgroundColor(
|
bool SetBackgroundColor(
|
||||||
uint8 r, uint8 g, uint8 b,
|
uint8 r, uint8 g, uint8 b,
|
||||||
uint8 a = 255);
|
uint8 a = 255);
|
||||||
|
bool SetBackgroundColor(color_which which);
|
||||||
bool SetBackgroundColor(rgb_color color);
|
bool SetBackgroundColor(rgb_color color);
|
||||||
rgb_color BackgroundColor() const;
|
rgb_color BackgroundColor() const;
|
||||||
|
color_which WhichBackgroundColor() const;
|
||||||
|
|
||||||
|
bool SetStrikeOutColor(color_which which);
|
||||||
bool SetStrikeOutColor(rgb_color color);
|
bool SetStrikeOutColor(rgb_color color);
|
||||||
rgb_color StrikeOutColor() const;
|
rgb_color StrikeOutColor() const;
|
||||||
|
color_which WhichStrikeOutColor() const;
|
||||||
|
|
||||||
|
bool SetUnderlineColor(color_which which);
|
||||||
bool SetUnderlineColor(rgb_color color);
|
bool SetUnderlineColor(rgb_color color);
|
||||||
rgb_color UnderlineColor() const;
|
rgb_color UnderlineColor() const;
|
||||||
|
color_which WhichUnderlineColor() const;
|
||||||
|
|
||||||
bool SetStrikeOut(uint8 strikeOut);
|
bool SetStrikeOut(uint8 strikeOut);
|
||||||
uint8 StrikeOut() const;
|
uint8 StrikeOut() const;
|
||||||
@@ -65,7 +73,6 @@ public:
|
|||||||
bool SetUnderline(uint8 underline);
|
bool SetUnderline(uint8 underline);
|
||||||
uint8 Underline() const;
|
uint8 Underline() const;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BFont _FindFontForFace(uint16 face) const;
|
BFont _FindFontForFace(uint16 face) const;
|
||||||
|
|
||||||
|
|||||||
@@ -18,10 +18,15 @@ CharacterStyleData::CharacterStyleData()
|
|||||||
|
|
||||||
fGlyphSpacing(0.0f),
|
fGlyphSpacing(0.0f),
|
||||||
|
|
||||||
fFgColor((rgb_color){ 0, 0, 0, 255 }),
|
fWhichFgColor(B_PANEL_TEXT_COLOR),
|
||||||
fBgColor((rgb_color){ 255, 255, 255, 255 }),
|
fWhichBgColor(B_PANEL_BACKGROUND_COLOR),
|
||||||
fStrikeOutColor((rgb_color){ 0, 0, 0, 255 }),
|
fWhichStrikeOutColor(fWhichFgColor),
|
||||||
fUnderlineColor((rgb_color){ 0, 0, 0, 255 }),
|
fWhichUnderlineColor(fWhichFgColor),
|
||||||
|
|
||||||
|
fFgColor(ui_color(fWhichFgColor)),
|
||||||
|
fBgColor(ui_color(fWhichBgColor)),
|
||||||
|
fStrikeOutColor(fFgColor),
|
||||||
|
fUnderlineColor(fFgColor),
|
||||||
|
|
||||||
fStrikeOutStyle(STRIKE_OUT_NONE),
|
fStrikeOutStyle(STRIKE_OUT_NONE),
|
||||||
fUnderlineStyle(UNDERLINE_NONE)
|
fUnderlineStyle(UNDERLINE_NONE)
|
||||||
@@ -39,6 +44,11 @@ CharacterStyleData::CharacterStyleData(const CharacterStyleData& other)
|
|||||||
|
|
||||||
fGlyphSpacing(other.fGlyphSpacing),
|
fGlyphSpacing(other.fGlyphSpacing),
|
||||||
|
|
||||||
|
fWhichFgColor(other.fWhichFgColor),
|
||||||
|
fWhichBgColor(other.fWhichBgColor),
|
||||||
|
fWhichStrikeOutColor(other.fWhichStrikeOutColor),
|
||||||
|
fWhichUnderlineColor(other.fWhichUnderlineColor),
|
||||||
|
|
||||||
fFgColor(other.fFgColor),
|
fFgColor(other.fFgColor),
|
||||||
fBgColor(other.fBgColor),
|
fBgColor(other.fBgColor),
|
||||||
fStrikeOutColor(other.fStrikeOutColor),
|
fStrikeOutColor(other.fStrikeOutColor),
|
||||||
@@ -63,6 +73,11 @@ CharacterStyleData::operator==(const CharacterStyleData& other) const
|
|||||||
|
|
||||||
&& fGlyphSpacing == other.fGlyphSpacing
|
&& fGlyphSpacing == other.fGlyphSpacing
|
||||||
|
|
||||||
|
&& fWhichFgColor == other.fWhichFgColor
|
||||||
|
&& fWhichBgColor == other.fWhichBgColor
|
||||||
|
&& fWhichStrikeOutColor == other.fWhichStrikeOutColor
|
||||||
|
&& fWhichUnderlineColor == other.fWhichUnderlineColor
|
||||||
|
|
||||||
&& fFgColor == other.fFgColor
|
&& fFgColor == other.fFgColor
|
||||||
&& fBgColor == other.fBgColor
|
&& fBgColor == other.fBgColor
|
||||||
&& fStrikeOutColor == other.fStrikeOutColor
|
&& fStrikeOutColor == other.fStrikeOutColor
|
||||||
@@ -179,6 +194,21 @@ CharacterStyleData::SetGlyphSpacing(float glyphSpacing)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CharacterStyleDataRef
|
||||||
|
CharacterStyleData::SetForegroundColor(color_which which)
|
||||||
|
{
|
||||||
|
if (fWhichFgColor == which)
|
||||||
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
|
CharacterStyleData* ret = new(std::nothrow) CharacterStyleData(*this);
|
||||||
|
if (ret == NULL)
|
||||||
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
|
ret->fWhichFgColor = which;
|
||||||
|
return CharacterStyleDataRef(ret, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CharacterStyleDataRef
|
CharacterStyleDataRef
|
||||||
CharacterStyleData::SetForegroundColor(rgb_color color)
|
CharacterStyleData::SetForegroundColor(rgb_color color)
|
||||||
{
|
{
|
||||||
@@ -190,6 +220,22 @@ CharacterStyleData::SetForegroundColor(rgb_color color)
|
|||||||
return CharacterStyleDataRef(this);
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
ret->fFgColor = color;
|
ret->fFgColor = color;
|
||||||
|
ret->fWhichFgColor = B_NO_COLOR;
|
||||||
|
return CharacterStyleDataRef(ret, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CharacterStyleDataRef
|
||||||
|
CharacterStyleData::SetBackgroundColor(color_which which)
|
||||||
|
{
|
||||||
|
if (fWhichBgColor == which)
|
||||||
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
|
CharacterStyleData* ret = new(std::nothrow) CharacterStyleData(*this);
|
||||||
|
if (ret == NULL)
|
||||||
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
|
ret->fWhichBgColor = which;
|
||||||
return CharacterStyleDataRef(ret, true);
|
return CharacterStyleDataRef(ret, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,6 +251,22 @@ CharacterStyleData::SetBackgroundColor(rgb_color color)
|
|||||||
return CharacterStyleDataRef(this);
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
ret->fBgColor = color;
|
ret->fBgColor = color;
|
||||||
|
ret->fWhichBgColor = B_NO_COLOR;
|
||||||
|
return CharacterStyleDataRef(ret, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CharacterStyleDataRef
|
||||||
|
CharacterStyleData::SetStrikeOutColor(color_which which)
|
||||||
|
{
|
||||||
|
if (fWhichStrikeOutColor == which)
|
||||||
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
|
CharacterStyleData* ret = new(std::nothrow) CharacterStyleData(*this);
|
||||||
|
if (ret == NULL)
|
||||||
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
|
ret->fWhichStrikeOutColor = which;
|
||||||
return CharacterStyleDataRef(ret, true);
|
return CharacterStyleDataRef(ret, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,6 +282,22 @@ CharacterStyleData::SetStrikeOutColor(rgb_color color)
|
|||||||
return CharacterStyleDataRef(this);
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
ret->fStrikeOutColor = color;
|
ret->fStrikeOutColor = color;
|
||||||
|
ret->fWhichStrikeOutColor = B_NO_COLOR;
|
||||||
|
return CharacterStyleDataRef(ret, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CharacterStyleDataRef
|
||||||
|
CharacterStyleData::SetUnderlineColor(color_which which)
|
||||||
|
{
|
||||||
|
if (fWhichUnderlineColor == which)
|
||||||
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
|
CharacterStyleData* ret = new(std::nothrow) CharacterStyleData(*this);
|
||||||
|
if (ret == NULL)
|
||||||
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
|
ret->fWhichUnderlineColor = which;
|
||||||
return CharacterStyleDataRef(ret, true);
|
return CharacterStyleDataRef(ret, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,6 +313,7 @@ CharacterStyleData::SetUnderlineColor(rgb_color color)
|
|||||||
return CharacterStyleDataRef(this);
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
ret->fUnderlineColor = color;
|
ret->fUnderlineColor = color;
|
||||||
|
ret->fWhichUnderlineColor = B_NO_COLOR;
|
||||||
return CharacterStyleDataRef(ret, true);
|
return CharacterStyleDataRef(ret, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,21 +68,33 @@ public:
|
|||||||
inline float GlyphSpacing() const
|
inline float GlyphSpacing() const
|
||||||
{ return fGlyphSpacing; }
|
{ return fGlyphSpacing; }
|
||||||
|
|
||||||
|
CharacterStyleDataRef SetForegroundColor(color_which which);
|
||||||
CharacterStyleDataRef SetForegroundColor(rgb_color color);
|
CharacterStyleDataRef SetForegroundColor(rgb_color color);
|
||||||
inline rgb_color ForegroundColor() const
|
inline rgb_color ForegroundColor() const
|
||||||
{ return fFgColor; }
|
{ return fFgColor; }
|
||||||
|
inline color_which WhichForegroundColor() const
|
||||||
|
{ return fWhichFgColor; }
|
||||||
|
|
||||||
|
CharacterStyleDataRef SetBackgroundColor(color_which which);
|
||||||
CharacterStyleDataRef SetBackgroundColor(rgb_color color);
|
CharacterStyleDataRef SetBackgroundColor(rgb_color color);
|
||||||
inline rgb_color BackgroundColor() const
|
inline rgb_color BackgroundColor() const
|
||||||
{ return fBgColor; }
|
{ return fBgColor; }
|
||||||
|
inline color_which WhichBackgroundColor() const
|
||||||
|
{ return fWhichBgColor; }
|
||||||
|
|
||||||
|
CharacterStyleDataRef SetStrikeOutColor(color_which which);
|
||||||
CharacterStyleDataRef SetStrikeOutColor(rgb_color color);
|
CharacterStyleDataRef SetStrikeOutColor(rgb_color color);
|
||||||
inline rgb_color StrikeOutColor() const
|
inline rgb_color StrikeOutColor() const
|
||||||
{ return fStrikeOutColor; }
|
{ return fStrikeOutColor; }
|
||||||
|
inline color_which WhichStrikeOutColor() const
|
||||||
|
{ return fWhichStrikeOutColor; }
|
||||||
|
|
||||||
|
CharacterStyleDataRef SetUnderlineColor(color_which which);
|
||||||
CharacterStyleDataRef SetUnderlineColor(rgb_color color);
|
CharacterStyleDataRef SetUnderlineColor(rgb_color color);
|
||||||
inline rgb_color UnderlineColor() const
|
inline rgb_color UnderlineColor() const
|
||||||
{ return fUnderlineColor; }
|
{ return fUnderlineColor; }
|
||||||
|
inline color_which WhichUnderlineColor() const
|
||||||
|
{ return fWhichUnderlineColor; }
|
||||||
|
|
||||||
CharacterStyleDataRef SetStrikeOut(uint8 strikeOut);
|
CharacterStyleDataRef SetStrikeOut(uint8 strikeOut);
|
||||||
inline uint8 StrikeOut() const
|
inline uint8 StrikeOut() const
|
||||||
@@ -92,6 +104,7 @@ public:
|
|||||||
inline uint8 Underline() const
|
inline uint8 Underline() const
|
||||||
{ return fUnderlineStyle; }
|
{ return fUnderlineStyle; }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CharacterStyleData& operator=(const CharacterStyleData& other);
|
CharacterStyleData& operator=(const CharacterStyleData& other);
|
||||||
|
|
||||||
@@ -112,6 +125,12 @@ private:
|
|||||||
// Additional spacing to be applied between glyphs.
|
// Additional spacing to be applied between glyphs.
|
||||||
float fGlyphSpacing;
|
float fGlyphSpacing;
|
||||||
|
|
||||||
|
color_which fWhichFgColor;
|
||||||
|
color_which fWhichBgColor;
|
||||||
|
|
||||||
|
color_which fWhichStrikeOutColor;
|
||||||
|
color_which fWhichUnderlineColor;
|
||||||
|
|
||||||
rgb_color fFgColor;
|
rgb_color fFgColor;
|
||||||
rgb_color fBgColor;
|
rgb_color fBgColor;
|
||||||
|
|
||||||
@@ -123,5 +142,4 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // CHARACTER_STYLE_DATA_H
|
#endif // CHARACTER_STYLE_DATA_H
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ ParagraphLayout::Draw(BView* view, const BPoint& offset)
|
|||||||
const Bullet& bullet = fParagraphStyle.Bullet();
|
const Bullet& bullet = fParagraphStyle.Bullet();
|
||||||
if (bullet.Spacing() > 0.0f && bullet.String().Length() > 0) {
|
if (bullet.Spacing() > 0.0f && bullet.String().Length() > 0) {
|
||||||
// Draw bullet at offset
|
// Draw bullet at offset
|
||||||
view->SetHighColor(0, 0, 0, 255);
|
view->SetHighUIColor(B_PANEL_TEXT_COLOR);
|
||||||
BPoint bulletPos(offset);
|
BPoint bulletPos(offset);
|
||||||
bulletPos.x += fParagraphStyle.FirstLineInset()
|
bulletPos.x += fParagraphStyle.FirstLineInset()
|
||||||
+ fParagraphStyle.LineInset();
|
+ fParagraphStyle.LineInset();
|
||||||
@@ -934,7 +934,11 @@ ParagraphLayout::_DrawSpan(BView* view, BPoint offset,
|
|||||||
const CharacterStyle& style = span.Style();
|
const CharacterStyle& style = span.Style();
|
||||||
|
|
||||||
view->SetFont(&style.Font());
|
view->SetFont(&style.Font());
|
||||||
view->SetHighColor(style.ForegroundColor());
|
|
||||||
|
if (style.WhichForegroundColor() != B_NO_COLOR)
|
||||||
|
view->SetHighUIColor(style.WhichForegroundColor());
|
||||||
|
else
|
||||||
|
view->SetHighColor(style.ForegroundColor());
|
||||||
|
|
||||||
// TODO: Implement other style properties
|
// TODO: Implement other style properties
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ TextDocumentView::TextDocumentView(const char* name)
|
|||||||
// Set default TextEditor
|
// Set default TextEditor
|
||||||
SetTextEditor(TextEditorRef(new(std::nothrow) TextEditor(), true));
|
SetTextEditor(TextEditorRef(new(std::nothrow) TextEditor(), true));
|
||||||
|
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
SetLowColor(255, 255, 255, 255);
|
SetLowUIColor(ViewUIColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ TextView::TextView(const char* name)
|
|||||||
:
|
:
|
||||||
BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS)
|
BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS)
|
||||||
{
|
{
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
|
||||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
|
|
||||||
BFont font;
|
BFont font;
|
||||||
GetFont(&font);
|
GetFont(&font);
|
||||||
|
|
||||||
@@ -41,9 +38,7 @@ TextView::Draw(BRect updateRect)
|
|||||||
void
|
void
|
||||||
TextView::AttachedToWindow()
|
TextView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
BView* parent = Parent();
|
AdoptParentColors();
|
||||||
if (parent != NULL)
|
|
||||||
SetLowColor(parent->ViewColor());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ public:
|
|||||||
new(std::nothrow) OnePackageMessagePackageListener(this)),
|
new(std::nothrow) OnePackageMessagePackageListener(this)),
|
||||||
fSelected(false)
|
fSelected(false)
|
||||||
{
|
{
|
||||||
SetViewColor(255, 255, 255);
|
SetViewUIColor(B_LIST_BACKGROUND_COLOR);
|
||||||
|
SetHighUIColor(B_LIST_ITEM_TEXT_COLOR);
|
||||||
SetEventMask(B_POINTER_EVENTS);
|
SetEventMask(B_POINTER_EVENTS);
|
||||||
|
|
||||||
fIconView = new BitmapView("package icon view");
|
fIconView = new BitmapView("package icon view");
|
||||||
@@ -67,25 +68,27 @@ public:
|
|||||||
font.SetSize(std::max(9.0f, floorf(font.Size() * 0.92f)));
|
font.SetSize(std::max(9.0f, floorf(font.Size() * 0.92f)));
|
||||||
font.SetFamilyAndStyle(family, "Italic");
|
font.SetFamilyAndStyle(family, "Italic");
|
||||||
fPublisherView->SetFont(&font);
|
fPublisherView->SetFont(&font);
|
||||||
fPublisherView->SetHighColor(kLightBlack);
|
|
||||||
|
|
||||||
// Summary text view
|
// Summary text view
|
||||||
fSummaryView = new MarkupTextView("package summary");
|
fSummaryView = new BTextView("package summary");
|
||||||
fSummaryView->SetSelectionEnabled(false);
|
fSummaryView->MakeSelectable(false);
|
||||||
|
fSummaryView->MakeEditable(false);
|
||||||
|
font = BFont(be_plain_font);
|
||||||
|
rgb_color color = HighColor();
|
||||||
|
fSummaryView->SetFontAndColor(&font, B_FONT_ALL, &color);
|
||||||
|
|
||||||
// Rating view
|
// Rating view
|
||||||
fRatingView = new RatingView("package rating view");
|
fRatingView = new RatingView("package rating view");
|
||||||
|
|
||||||
fAvgRating = new BStringView("package average rating", "");
|
fAvgRating = new BStringView("package average rating", "");
|
||||||
fAvgRating->SetFont(&font);
|
fAvgRating->SetFont(&font);
|
||||||
fAvgRating->SetHighColor(kLightBlack);
|
|
||||||
|
|
||||||
fVoteInfo = new BStringView("package vote info", "");
|
fVoteInfo = new BStringView("package vote info", "");
|
||||||
// small font
|
// small font
|
||||||
GetFont(&font);
|
GetFont(&font);
|
||||||
font.SetSize(std::max(9.0f, floorf(font.Size() * 0.85f)));
|
font.SetSize(std::max(9.0f, floorf(font.Size() * 0.85f)));
|
||||||
fVoteInfo->SetFont(&font);
|
fVoteInfo->SetFont(&font);
|
||||||
fVoteInfo->SetHighColor(kLightBlack);
|
fVoteInfo->SetHighUIColor(HighUIColor());
|
||||||
|
|
||||||
BLayoutBuilder::Group<>(this)
|
BLayoutBuilder::Group<>(this)
|
||||||
.Add(fIconView)
|
.Add(fIconView)
|
||||||
@@ -119,6 +122,15 @@ public:
|
|||||||
delete fPackageListener;
|
delete fPackageListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void AllAttached()
|
||||||
|
{
|
||||||
|
for (int32 index = 0; index < CountChildren(); ++index) {
|
||||||
|
ChildAt(index)->SetViewUIColor(ViewUIColor());
|
||||||
|
ChildAt(index)->SetLowUIColor(ViewUIColor());
|
||||||
|
ChildAt(index)->SetHighUIColor(HighUIColor());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage* message)
|
virtual void MessageReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
@@ -129,6 +141,13 @@ public:
|
|||||||
case MSG_UPDATE_PACKAGE:
|
case MSG_UPDATE_PACKAGE:
|
||||||
SetPackage(fPackageListener->Package());
|
SetPackage(fPackageListener->Package());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case B_COLORS_UPDATED:
|
||||||
|
{
|
||||||
|
if (message->HasColor(ui_color_name(B_LIST_ITEM_TEXT_COLOR)))
|
||||||
|
_UpdateColors();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,11 +246,18 @@ public:
|
|||||||
return;
|
return;
|
||||||
fSelected = selected;
|
fSelected = selected;
|
||||||
|
|
||||||
rgb_color bgColor;
|
_UpdateColors();
|
||||||
if (fSelected)
|
}
|
||||||
bgColor = ui_color(B_LIST_SELECTED_BACKGROUND_COLOR);
|
|
||||||
else
|
void _UpdateColors()
|
||||||
bgColor = (rgb_color){ 255, 255, 255, 255 };
|
{
|
||||||
|
color_which bgColor = B_LIST_BACKGROUND_COLOR;
|
||||||
|
color_which textColor = B_LIST_ITEM_TEXT_COLOR;
|
||||||
|
|
||||||
|
if (fSelected) {
|
||||||
|
bgColor = B_LIST_SELECTED_BACKGROUND_COLOR;
|
||||||
|
textColor = B_LIST_SELECTED_ITEM_TEXT_COLOR;
|
||||||
|
}
|
||||||
|
|
||||||
List<BView*, true> views;
|
List<BView*, true> views;
|
||||||
|
|
||||||
@@ -248,10 +274,15 @@ public:
|
|||||||
for (int32 i = 0; i < views.CountItems(); i++) {
|
for (int32 i = 0; i < views.CountItems(); i++) {
|
||||||
BView* view = views.ItemAtFast(i);
|
BView* view = views.ItemAtFast(i);
|
||||||
|
|
||||||
view->SetViewColor(bgColor);
|
view->SetViewUIColor(bgColor);
|
||||||
view->SetLowColor(bgColor);
|
view->SetLowUIColor(bgColor);
|
||||||
|
view->SetHighUIColor(textColor);
|
||||||
view->Invalidate();
|
view->Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BFont font(be_plain_font);
|
||||||
|
rgb_color color = HighColor();
|
||||||
|
fSummaryView->SetFontAndColor(&font, B_FONT_ALL, &color);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -263,7 +294,7 @@ private:
|
|||||||
BStringView* fTitleView;
|
BStringView* fTitleView;
|
||||||
BStringView* fPublisherView;
|
BStringView* fPublisherView;
|
||||||
|
|
||||||
MarkupTextView* fSummaryView;
|
BTextView* fSummaryView;
|
||||||
|
|
||||||
RatingView* fRatingView;
|
RatingView* fRatingView;
|
||||||
BStringView* fAvgRating;
|
BStringView* fAvgRating;
|
||||||
@@ -286,7 +317,7 @@ FeaturedPackagesView::FeaturedPackagesView()
|
|||||||
SetLayout(layout);
|
SetLayout(layout);
|
||||||
|
|
||||||
ScrollableGroupView* containerView = new ScrollableGroupView();
|
ScrollableGroupView* containerView = new ScrollableGroupView();
|
||||||
containerView->SetViewColor(255, 255, 255);
|
containerView->SetViewUIColor(B_LIST_BACKGROUND_COLOR);
|
||||||
fPackageListLayout = containerView->GroupLayout();
|
fPackageListLayout = containerView->GroupLayout();
|
||||||
|
|
||||||
BScrollView* scrollView = new BScrollView(
|
BScrollView* scrollView = new BScrollView(
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <CardLayout.h>
|
#include <CardLayout.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
|
#include <ColumnListView.h>
|
||||||
#include <Font.h>
|
#include <Font.h>
|
||||||
#include <GridView.h>
|
#include <GridView.h>
|
||||||
#include <LayoutBuilder.h>
|
#include <LayoutBuilder.h>
|
||||||
@@ -127,9 +128,8 @@ public:
|
|||||||
BView("diagram bar view", B_WILL_DRAW),
|
BView("diagram bar view", B_WILL_DRAW),
|
||||||
fValue(0.0f)
|
fValue(0.0f)
|
||||||
{
|
{
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR, kContentTint);
|
||||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetHighUIColor(B_CONTROL_MARK_COLOR);
|
||||||
SetHighColor(tint_color(LowColor(), B_DARKEN_2_TINT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~DiagramBarView()
|
virtual ~DiagramBarView()
|
||||||
@@ -138,11 +138,6 @@ public:
|
|||||||
|
|
||||||
virtual void AttachedToWindow()
|
virtual void AttachedToWindow()
|
||||||
{
|
{
|
||||||
BView* parent = Parent();
|
|
||||||
if (parent != NULL) {
|
|
||||||
SetLowColor(parent->ViewColor());
|
|
||||||
SetHighColor(tint_color(LowColor(), B_DARKEN_2_TINT));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Draw(BRect updateRect)
|
virtual void Draw(BRect updateRect)
|
||||||
@@ -325,7 +320,7 @@ public:
|
|||||||
fRatingLayout = new BCardLayout();
|
fRatingLayout = new BCardLayout();
|
||||||
ratingStack->SetLayout(fRatingLayout);
|
ratingStack->SetLayout(fRatingLayout);
|
||||||
ratingStack->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
ratingStack->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
||||||
ratingStack->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
ratingStack->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BGroupView* ratingGroup = new BGroupView(B_HORIZONTAL,
|
BGroupView* ratingGroup = new BGroupView(B_HORIZONTAL,
|
||||||
B_USE_SMALL_SPACING);
|
B_USE_SMALL_SPACING);
|
||||||
@@ -471,7 +466,7 @@ public:
|
|||||||
fStatusLabel(NULL),
|
fStatusLabel(NULL),
|
||||||
fStatusBar(NULL)
|
fStatusBar(NULL)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
SetLayout(fLayout);
|
SetLayout(fLayout);
|
||||||
fLayout->AddItem(BSpaceLayoutItem::CreateGlue());
|
fLayout->AddItem(BSpaceLayoutItem::CreateGlue());
|
||||||
@@ -684,11 +679,10 @@ public:
|
|||||||
fEmailIcon("text/x-email"),
|
fEmailIcon("text/x-email"),
|
||||||
fWebsiteIcon("text/html")
|
fWebsiteIcon("text/html")
|
||||||
{
|
{
|
||||||
SetViewColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR, kContentTint);
|
||||||
kContentTint));
|
|
||||||
|
|
||||||
fDescriptionView = new MarkupTextView("description view");
|
fDescriptionView = new MarkupTextView("description view");
|
||||||
fDescriptionView->SetLowColor(ViewColor());
|
fDescriptionView->SetViewUIColor(ViewUIColor(), kContentTint);
|
||||||
fDescriptionView->SetInsets(be_plain_font->Size());
|
fDescriptionView->SetInsets(be_plain_font->Size());
|
||||||
|
|
||||||
BScrollView* scrollView = new CustomScrollView(
|
BScrollView* scrollView = new CustomScrollView(
|
||||||
@@ -714,17 +708,20 @@ public:
|
|||||||
|
|
||||||
fEmailIconView = new BitmapView("email icon view");
|
fEmailIconView = new BitmapView("email icon view");
|
||||||
fEmailLinkView = new LinkView("email link view", "",
|
fEmailLinkView = new LinkView("email link view", "",
|
||||||
new BMessage(MSG_EMAIL_PUBLISHER), kLightBlack);
|
new BMessage(MSG_EMAIL_PUBLISHER));
|
||||||
fEmailLinkView->SetFont(&smallFont);
|
fEmailLinkView->SetFont(&smallFont);
|
||||||
|
|
||||||
fWebsiteIconView = new BitmapView("website icon view");
|
fWebsiteIconView = new BitmapView("website icon view");
|
||||||
fWebsiteLinkView = new LinkView("website link view", "",
|
fWebsiteLinkView = new LinkView("website link view", "",
|
||||||
new BMessage(MSG_VISIT_PUBLISHER_WEBSITE), kLightBlack);
|
new BMessage(MSG_VISIT_PUBLISHER_WEBSITE));
|
||||||
fWebsiteLinkView->SetFont(&smallFont);
|
fWebsiteLinkView->SetFont(&smallFont);
|
||||||
|
|
||||||
BGroupView* leftGroup = new BGroupView(B_VERTICAL,
|
BGroupView* leftGroup = new BGroupView(B_VERTICAL,
|
||||||
B_USE_DEFAULT_SPACING);
|
B_USE_DEFAULT_SPACING);
|
||||||
leftGroup->SetViewColor(ViewColor());
|
|
||||||
|
fScreenshotView->SetViewUIColor(ViewUIColor(), kContentTint);
|
||||||
|
fEmailLinkView->SetViewUIColor(ViewUIColor(), kContentTint);
|
||||||
|
fWebsiteLinkView->SetViewUIColor(ViewUIColor(), kContentTint);
|
||||||
|
|
||||||
BLayoutBuilder::Group<>(this, B_HORIZONTAL, 0.0f)
|
BLayoutBuilder::Group<>(this, B_HORIZONTAL, 0.0f)
|
||||||
// .Add(BSpaceLayoutItem::CreateHorizontalStrut(32.0f))
|
// .Add(BSpaceLayoutItem::CreateHorizontalStrut(32.0f))
|
||||||
@@ -760,6 +757,14 @@ public:
|
|||||||
fWebsiteLinkView->SetTarget(this);
|
fWebsiteLinkView->SetTarget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void AllAttached()
|
||||||
|
{
|
||||||
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR, kContentTint);
|
||||||
|
|
||||||
|
for (int32 index = 0; index < CountChildren(); ++index)
|
||||||
|
ChildAt(index)->AdoptParentColors();
|
||||||
|
}
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage* message)
|
virtual void MessageReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
@@ -867,8 +872,7 @@ public:
|
|||||||
:
|
:
|
||||||
BGroupView(B_HORIZONTAL, 0.0f)
|
BGroupView(B_HORIZONTAL, 0.0f)
|
||||||
{
|
{
|
||||||
SetViewColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR, kContentTint);
|
||||||
kContentTint));
|
|
||||||
|
|
||||||
fAvatarView = new BitmapView("avatar view");
|
fAvatarView = new BitmapView("avatar view");
|
||||||
if (rating.User().Avatar().Get() != NULL) {
|
if (rating.User().Avatar().Get() != NULL) {
|
||||||
@@ -878,10 +882,10 @@ public:
|
|||||||
fAvatarView->SetExplicitMinSize(BSize(16.0f, 16.0f));
|
fAvatarView->SetExplicitMinSize(BSize(16.0f, 16.0f));
|
||||||
|
|
||||||
fNameView = new BStringView("user name", rating.User().NickName());
|
fNameView = new BStringView("user name", rating.User().NickName());
|
||||||
|
|
||||||
BFont nameFont(be_bold_font);
|
BFont nameFont(be_bold_font);
|
||||||
nameFont.SetSize(std::max(9.0f, floorf(nameFont.Size() * 0.9f)));
|
nameFont.SetSize(std::max(9.0f, floorf(nameFont.Size() * 0.9f)));
|
||||||
fNameView->SetFont(&nameFont);
|
fNameView->SetFont(&nameFont);
|
||||||
fNameView->SetHighColor(kLightBlack);
|
|
||||||
fNameView->SetExplicitMaxSize(
|
fNameView->SetExplicitMaxSize(
|
||||||
BSize(nameFont.StringWidth("xxxxxxxxxxxxxxxxxxxxxx"), B_SIZE_UNSET));
|
BSize(nameFont.StringWidth("xxxxxxxxxxxxxxxxxxxxxx"), B_SIZE_UNSET));
|
||||||
|
|
||||||
@@ -900,7 +904,6 @@ public:
|
|||||||
BFont versionFont(be_plain_font);
|
BFont versionFont(be_plain_font);
|
||||||
versionFont.SetSize(std::max(9.0f, floorf(versionFont.Size() * 0.85f)));
|
versionFont.SetSize(std::max(9.0f, floorf(versionFont.Size() * 0.85f)));
|
||||||
fPackageVersionView->SetFont(&versionFont);
|
fPackageVersionView->SetFont(&versionFont);
|
||||||
fPackageVersionView->SetHighColor(kLightBlack);
|
|
||||||
|
|
||||||
// TODO: User rating IDs to identify which rating to vote up or down
|
// TODO: User rating IDs to identify which rating to vote up or down
|
||||||
// BMessage* voteUpMessage = new BMessage(MSG_VOTE_UP);
|
// BMessage* voteUpMessage = new BMessage(MSG_VOTE_UP);
|
||||||
@@ -928,7 +931,6 @@ public:
|
|||||||
// fDownVoteCountView->SetText(voteCountLabel);
|
// fDownVoteCountView->SetText(voteCountLabel);
|
||||||
|
|
||||||
fTextView = new TextView("rating text");
|
fTextView = new TextView("rating text");
|
||||||
fTextView->SetViewColor(ViewColor());
|
|
||||||
ParagraphStyle paragraphStyle(fTextView->ParagraphStyle());
|
ParagraphStyle paragraphStyle(fTextView->ParagraphStyle());
|
||||||
paragraphStyle.SetJustify(true);
|
paragraphStyle.SetJustify(true);
|
||||||
fTextView->SetParagraphStyle(paragraphStyle);
|
fTextView->SetParagraphStyle(paragraphStyle);
|
||||||
@@ -957,6 +959,21 @@ public:
|
|||||||
.End()
|
.End()
|
||||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
SetFlags(Flags() | B_WILL_DRAW);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AllAttached()
|
||||||
|
{
|
||||||
|
for (int32 index = 0; index < CountChildren(); ++index)
|
||||||
|
ChildAt(index)->AdoptParentColors();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Draw(BRect rect)
|
||||||
|
{
|
||||||
|
rgb_color color = mix_color(ViewColor(), ui_color(B_PANEL_TEXT_COLOR), 64);
|
||||||
|
SetHighColor(color);
|
||||||
|
StrokeLine(Bounds().LeftBottom(), Bounds().RightBottom());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -981,8 +998,8 @@ public:
|
|||||||
:
|
:
|
||||||
BGridView("rating summary view", B_USE_HALF_ITEM_SPACING, 0.0f)
|
BGridView("rating summary view", B_USE_HALF_ITEM_SPACING, 0.0f)
|
||||||
{
|
{
|
||||||
SetViewColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
float tint = kContentTint - 0.1;
|
||||||
kContentTint - 0.1));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR, tint);
|
||||||
|
|
||||||
BLayoutBuilder::Grid<> layoutBuilder(this);
|
BLayoutBuilder::Grid<> layoutBuilder(this);
|
||||||
|
|
||||||
@@ -995,7 +1012,7 @@ public:
|
|||||||
label.SetToFormat("%" B_PRId32, 5 - i);
|
label.SetToFormat("%" B_PRId32, 5 - i);
|
||||||
fLabelViews[i] = new BStringView("", label);
|
fLabelViews[i] = new BStringView("", label);
|
||||||
fLabelViews[i]->SetFont(&smallFont);
|
fLabelViews[i]->SetFont(&smallFont);
|
||||||
fLabelViews[i]->SetHighColor(kLightBlack);
|
fLabelViews[i]->SetViewUIColor(ViewUIColor(), tint);
|
||||||
layoutBuilder.Add(fLabelViews[i], 0, i);
|
layoutBuilder.Add(fLabelViews[i], 0, i);
|
||||||
|
|
||||||
fDiagramBarViews[i] = new DiagramBarView();
|
fDiagramBarViews[i] = new DiagramBarView();
|
||||||
@@ -1003,7 +1020,7 @@ public:
|
|||||||
|
|
||||||
fCountViews[i] = new BStringView("", "");
|
fCountViews[i] = new BStringView("", "");
|
||||||
fCountViews[i]->SetFont(&smallFont);
|
fCountViews[i]->SetFont(&smallFont);
|
||||||
fCountViews[i]->SetHighColor(kLightBlack);
|
fCountViews[i]->SetViewUIColor(ViewUIColor(), tint);
|
||||||
fCountViews[i]->SetAlignment(B_ALIGN_RIGHT);
|
fCountViews[i]->SetAlignment(B_ALIGN_RIGHT);
|
||||||
layoutBuilder.Add(fCountViews[i], 2, i);
|
layoutBuilder.Add(fCountViews[i], 2, i);
|
||||||
}
|
}
|
||||||
@@ -1049,14 +1066,13 @@ public:
|
|||||||
fThumbsUpIcon(BitmapRef(new SharedBitmap(502), true)),
|
fThumbsUpIcon(BitmapRef(new SharedBitmap(502), true)),
|
||||||
fThumbsDownIcon(BitmapRef(new SharedBitmap(503), true))
|
fThumbsDownIcon(BitmapRef(new SharedBitmap(503), true))
|
||||||
{
|
{
|
||||||
SetViewColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR, kContentTint);
|
||||||
kContentTint));
|
|
||||||
|
|
||||||
fRatingSummaryView = new RatingSummaryView();
|
fRatingSummaryView = new RatingSummaryView();
|
||||||
|
|
||||||
ScrollableGroupView* ratingsContainerView = new ScrollableGroupView();
|
ScrollableGroupView* ratingsContainerView = new ScrollableGroupView();
|
||||||
ratingsContainerView->SetViewColor(
|
ratingsContainerView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR,
|
||||||
tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), kContentTint));
|
kContentTint);
|
||||||
fRatingContainerLayout = ratingsContainerView->GroupLayout();
|
fRatingContainerLayout = ratingsContainerView->GroupLayout();
|
||||||
|
|
||||||
BScrollView* scrollView = new RatingsScrollView(
|
BScrollView* scrollView = new RatingsScrollView(
|
||||||
@@ -1093,8 +1109,10 @@ public:
|
|||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
BStringView* noRatingsView = new BStringView("no ratings",
|
BStringView* noRatingsView = new BStringView("no ratings",
|
||||||
B_TRANSLATE("No user ratings available."));
|
B_TRANSLATE("No user ratings available."));
|
||||||
|
noRatingsView->SetViewUIColor(ViewUIColor(), kContentTint);
|
||||||
noRatingsView->SetAlignment(B_ALIGN_CENTER);
|
noRatingsView->SetAlignment(B_ALIGN_CENTER);
|
||||||
noRatingsView->SetHighColor(kLightBlack);
|
noRatingsView->SetHighColor(disable_color(ui_color(B_PANEL_TEXT_COLOR),
|
||||||
|
ViewColor()));
|
||||||
noRatingsView->SetExplicitMaxSize(
|
noRatingsView->SetExplicitMaxSize(
|
||||||
BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
|
BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
|
||||||
fRatingContainerLayout->AddView(0, noRatingsView);
|
fRatingContainerLayout->AddView(0, noRatingsView);
|
||||||
@@ -1178,8 +1196,7 @@ public:
|
|||||||
:
|
:
|
||||||
BGroupView("package contents view", B_HORIZONTAL)
|
BGroupView("package contents view", B_HORIZONTAL)
|
||||||
{
|
{
|
||||||
SetViewColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR, kContentTint);
|
||||||
kContentTint));
|
|
||||||
|
|
||||||
fPackageContents = new PackageContentsView("contents_list");
|
fPackageContents = new PackageContentsView("contents_list");
|
||||||
AddChild(fPackageContents);
|
AddChild(fPackageContents);
|
||||||
@@ -1218,11 +1235,10 @@ public:
|
|||||||
:
|
:
|
||||||
BGroupView("package changelog view", B_HORIZONTAL)
|
BGroupView("package changelog view", B_HORIZONTAL)
|
||||||
{
|
{
|
||||||
SetViewColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR, kContentTint);
|
||||||
kContentTint));
|
|
||||||
|
|
||||||
fTextView = new MarkupTextView("changelog view");
|
fTextView = new MarkupTextView("changelog view");
|
||||||
fTextView->SetLowColor(ViewColor());
|
fTextView->SetLowUIColor(ViewUIColor());
|
||||||
fTextView->SetInsets(be_plain_font->Size());
|
fTextView->SetInsets(be_plain_font->Size());
|
||||||
|
|
||||||
BScrollView* scrollView = new CustomScrollView(
|
BScrollView* scrollView = new CustomScrollView(
|
||||||
|
|||||||
@@ -632,10 +632,9 @@ public:
|
|||||||
font.SetSize(9.0f);
|
font.SetSize(9.0f);
|
||||||
SetFont(&font);
|
SetFont(&font);
|
||||||
|
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetLowUIColor(ViewUIColor());
|
||||||
|
SetHighUIColor(LowUIColor(), B_DARKEN_4_TINT);
|
||||||
SetHighColor(tint_color(LowColor(), B_DARKEN_4_TINT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual BSize MinSize()
|
virtual BSize MinSize()
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ BitmapView::BitmapView(const char* name)
|
|||||||
fBitmap(NULL),
|
fBitmap(NULL),
|
||||||
fScaleBitmap(true)
|
fScaleBitmap(true)
|
||||||
{
|
{
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
|
||||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -29,15 +27,9 @@ BitmapView::~BitmapView()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BitmapView::AttachedToWindow()
|
BitmapView::AllAttached()
|
||||||
{
|
{
|
||||||
BView* parent = Parent();
|
AdoptParentColors();
|
||||||
if (parent != NULL) {
|
|
||||||
rgb_color color = parent->ViewColor();
|
|
||||||
if (color == B_TRANSPARENT_COLOR)
|
|
||||||
color = parent->LowColor();
|
|
||||||
SetLowColor(color);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public:
|
|||||||
|
|
||||||
virtual ~BitmapView();
|
virtual ~BitmapView();
|
||||||
|
|
||||||
virtual void AttachedToWindow();
|
virtual void AllAttached();
|
||||||
virtual void Draw(BRect updateRect);
|
virtual void Draw(BRect updateRect);
|
||||||
|
|
||||||
virtual BSize MinSize();
|
virtual BSize MinSize();
|
||||||
|
|||||||
@@ -10,18 +10,21 @@
|
|||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
|
|
||||||
LinkView::LinkView(const char* name, const char* string, BMessage* message,
|
LinkView::LinkView(const char* name, const char* string, BMessage* message)
|
||||||
rgb_color color)
|
|
||||||
:
|
:
|
||||||
BStringView(name, string),
|
BStringView(name, string),
|
||||||
BInvoker(message, NULL),
|
BInvoker(message, NULL),
|
||||||
fNormalColor(color),
|
|
||||||
fHoverColor(make_color(1, 141, 211)),
|
|
||||||
fEnabled(true),
|
fEnabled(true),
|
||||||
fMouseInside(false)
|
fMouseInside(false)
|
||||||
{
|
{
|
||||||
SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
||||||
SetExplicitMinSize(BSize(120, B_SIZE_UNSET));
|
SetExplicitMinSize(BSize(120, B_SIZE_UNSET));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
LinkView::AttachedToWindow()
|
||||||
|
{
|
||||||
_UpdateLinkColor();
|
_UpdateLinkColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +58,7 @@ LinkView::Draw(BRect updateRect)
|
|||||||
if (Text() == NULL)
|
if (Text() == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SetLowColor(ViewColor());
|
SetDrawingMode(B_OP_ALPHA);
|
||||||
|
|
||||||
font_height fontHeight;
|
font_height fontHeight;
|
||||||
GetFontHeight(&fontHeight);
|
GetFontHeight(&fontHeight);
|
||||||
@@ -82,18 +85,34 @@ LinkView::SetEnabled(bool enabled)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
LinkView::MessageReceived(BMessage* message)
|
||||||
|
{
|
||||||
|
if (message->what == B_COLORS_UPDATED)
|
||||||
|
_UpdateLinkColor();
|
||||||
|
|
||||||
|
BStringView::MessageReceived(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
LinkView::_UpdateLinkColor()
|
LinkView::_UpdateLinkColor()
|
||||||
{
|
{
|
||||||
if (fEnabled && fMouseInside) {
|
BCursorID cursorID = B_CURSOR_ID_SYSTEM_DEFAULT;
|
||||||
SetHighColor(fHoverColor);
|
|
||||||
BCursor cursor(B_CURSOR_ID_FOLLOW_LINK);
|
float tint = B_DARKEN_1_TINT;
|
||||||
SetViewCursor(&cursor, true);
|
ViewUIColor(&tint);
|
||||||
Invalidate();
|
|
||||||
} else {
|
if (fEnabled) {
|
||||||
SetHighColor(fNormalColor);
|
if (fMouseInside) {
|
||||||
BCursor cursor(B_CURSOR_SYSTEM_DEFAULT);
|
cursorID = B_CURSOR_ID_FOLLOW_LINK;
|
||||||
SetViewCursor(&cursor, true);
|
SetHighUIColor(B_LINK_HOVER_COLOR, tint);
|
||||||
Invalidate();
|
} else
|
||||||
}
|
SetHighUIColor(B_LINK_TEXT_COLOR, tint);
|
||||||
|
} else
|
||||||
|
SetHighColor(disable_color(ui_color(B_LINK_TEXT_COLOR), ViewColor()));
|
||||||
|
|
||||||
|
BCursor cursor(cursorID);
|
||||||
|
SetViewCursor(&cursor, true);
|
||||||
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,9 @@
|
|||||||
class LinkView : public BStringView, public BInvoker {
|
class LinkView : public BStringView, public BInvoker {
|
||||||
public:
|
public:
|
||||||
LinkView(const char* name, const char* string,
|
LinkView(const char* name, const char* string,
|
||||||
BMessage* message, rgb_color color);
|
BMessage* message);
|
||||||
|
|
||||||
|
virtual void AttachedToWindow();
|
||||||
|
|
||||||
virtual void MouseMoved(BPoint where, uint32 transit,
|
virtual void MouseMoved(BPoint where, uint32 transit,
|
||||||
const BMessage* dragMessage);
|
const BMessage* dragMessage);
|
||||||
@@ -21,14 +23,13 @@ public:
|
|||||||
|
|
||||||
virtual void Draw(BRect updateRect);
|
virtual void Draw(BRect updateRect);
|
||||||
|
|
||||||
|
virtual void MessageReceived(BMessage* message);
|
||||||
void SetEnabled(bool enabled);
|
void SetEnabled(bool enabled);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _UpdateLinkColor();
|
void _UpdateLinkColor();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
rgb_color fNormalColor;
|
|
||||||
rgb_color fHoverColor;
|
|
||||||
|
|
||||||
bool fEnabled;
|
bool fEnabled;
|
||||||
bool fMouseInside;
|
bool fMouseInside;
|
||||||
|
|||||||
@@ -19,6 +19,13 @@ LinkedBitmapView::LinkedBitmapView(const char* name, BMessage* message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
LinkedBitmapView::AllAttached()
|
||||||
|
{
|
||||||
|
// We don't want to use BitmapView's default behavior here.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
LinkedBitmapView::MouseMoved(BPoint where, uint32 transit,
|
LinkedBitmapView::MouseMoved(BPoint where, uint32 transit,
|
||||||
const BMessage* dragMessage)
|
const BMessage* dragMessage)
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public:
|
|||||||
LinkedBitmapView(const char* name,
|
LinkedBitmapView(const char* name,
|
||||||
BMessage* message);
|
BMessage* message);
|
||||||
|
|
||||||
|
virtual void AllAttached();
|
||||||
|
|
||||||
virtual void MouseMoved(BPoint where, uint32 transit,
|
virtual void MouseMoved(BPoint where, uint32 transit,
|
||||||
const BMessage* dragMessage);
|
const BMessage* dragMessage);
|
||||||
virtual void MouseDown(BPoint where);
|
virtual void MouseDown(BPoint where);
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ RatingView::RatingView(const char* name)
|
|||||||
fStarBitmap(501),
|
fStarBitmap(501),
|
||||||
fRating(-1.0f)
|
fRating(-1.0f)
|
||||||
{
|
{
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetLowUIColor(ViewUIColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -30,9 +30,7 @@ RatingView::~RatingView()
|
|||||||
void
|
void
|
||||||
RatingView::AttachedToWindow()
|
RatingView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
BView* parent = Parent();
|
AdoptParentColors();
|
||||||
if (parent != NULL)
|
|
||||||
SetLowColor(parent->ViewColor());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -967,7 +967,7 @@ MainWindow::_CreateGUI()
|
|||||||
layout->SetSpacing(0, 0);
|
layout->SetSpacing(0, 0);
|
||||||
BView* rootView = new BView("root view", 0, layout);
|
BView* rootView = new BView("root view", 0, layout);
|
||||||
AddChild(rootView);
|
AddChild(rootView);
|
||||||
rootView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
rootView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BGroupView* leftTopView = new BGroupView(B_VERTICAL, 0);
|
BGroupView* leftTopView = new BGroupView(B_VERTICAL, 0);
|
||||||
layout->AddView(leftTopView, 0, 0);
|
layout->AddView(leftTopView, 0, 0);
|
||||||
@@ -982,7 +982,7 @@ MainWindow::_CreateGUI()
|
|||||||
leftTopView->SetExplicitMinSize(BSize(splitWidth, B_SIZE_UNSET));
|
leftTopView->SetExplicitMinSize(BSize(splitWidth, B_SIZE_UNSET));
|
||||||
|
|
||||||
BGroupView* iconPreviews = new BGroupView(B_HORIZONTAL);
|
BGroupView* iconPreviews = new BGroupView(B_HORIZONTAL);
|
||||||
iconPreviews->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
iconPreviews->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
iconPreviews->GroupLayout()->SetSpacing(5);
|
iconPreviews->GroupLayout()->SetSpacing(5);
|
||||||
|
|
||||||
// icon previews
|
// icon previews
|
||||||
@@ -1003,14 +1003,14 @@ MainWindow::_CreateGUI()
|
|||||||
|
|
||||||
|
|
||||||
BGroupView* smallPreviews = new BGroupView(B_VERTICAL);
|
BGroupView* smallPreviews = new BGroupView(B_VERTICAL);
|
||||||
smallPreviews->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
smallPreviews->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
smallPreviews->GroupLayout()->SetSpacing(5);
|
smallPreviews->GroupLayout()->SetSpacing(5);
|
||||||
|
|
||||||
smallPreviews->AddChild(fIconPreview16Folder);
|
smallPreviews->AddChild(fIconPreview16Folder);
|
||||||
smallPreviews->AddChild(fIconPreview16Menu);
|
smallPreviews->AddChild(fIconPreview16Menu);
|
||||||
|
|
||||||
BGroupView* mediumPreviews = new BGroupView(B_VERTICAL);
|
BGroupView* mediumPreviews = new BGroupView(B_VERTICAL);
|
||||||
mediumPreviews->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
mediumPreviews->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
mediumPreviews->GroupLayout()->SetSpacing(5);
|
mediumPreviews->GroupLayout()->SetSpacing(5);
|
||||||
|
|
||||||
mediumPreviews->AddChild(fIconPreview32Folder);
|
mediumPreviews->AddChild(fIconPreview32Folder);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ Group::Group(BRect frame, const char* name, orientation direction)
|
|||||||
fInset(4.0),
|
fInset(4.0),
|
||||||
fSpacing(0.0)
|
fSpacing(0.0)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// destructor
|
// destructor
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ ColorPickerView::ColorPickerView(const char* name, rgb_color color,
|
|||||||
b((float)color.blue / 255.0),
|
b((float)color.blue / 255.0),
|
||||||
fRequiresUpdate(false)
|
fRequiresUpdate(false)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
RGB_to_HSV(r, g, b, h, s, v);
|
RGB_to_HSV(r, g, b, h, s, v);
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ StyleView::StyleView(BRect frame)
|
|||||||
fIgnoreControlGradientNotifications(false),
|
fIgnoreControlGradientNotifications(false),
|
||||||
fPreviousBounds(frame.OffsetToCopy(B_ORIGIN))
|
fPreviousBounds(frame.OffsetToCopy(B_ORIGIN))
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
// style type
|
// style type
|
||||||
BMenu* menu = new BPopUpMenu(B_TRANSLATE("<unavailable>"));
|
BMenu* menu = new BPopUpMenu(B_TRANSLATE("<unavailable>"));
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ SwatchGroup::SwatchGroup(BRect frame)
|
|||||||
|
|
||||||
// configure self
|
// configure self
|
||||||
ResizeTo(width, fAlphaSlider->Frame().bottom + 4);
|
ResizeTo(width, fAlphaSlider->Frame().bottom + 4);
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
// add views
|
// add views
|
||||||
AddChild(fCurrentColorSV);
|
AddChild(fCurrentColorSV);
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ UninstallView::MessageReceived(BMessage* msg)
|
|||||||
void
|
void
|
||||||
UninstallView::_InitView()
|
UninstallView::_InitView()
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fAppList = new BListView("pkg_list", B_SINGLE_SELECTION_LIST);
|
fAppList = new BListView("pkg_list", B_SINGLE_SELECTION_LIST);
|
||||||
fAppList->SetSelectionMessage(new BMessage(P_MSG_SELECT));
|
fAppList->SetSelectionMessage(new BMessage(P_MSG_SELECT));
|
||||||
@@ -284,7 +284,7 @@ UninstallView::_InitView()
|
|||||||
fDescription = new BTextView("description", B_WILL_DRAW);
|
fDescription = new BTextView("description", B_WILL_DRAW);
|
||||||
fDescription->MakeSelectable(false);
|
fDescription->MakeSelectable(false);
|
||||||
fDescription->MakeEditable(false);
|
fDescription->MakeEditable(false);
|
||||||
fDescription->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fDescription->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
fDescription->SetText(fNoPackageSelectedString);
|
fDescription->SetText(fNoPackageSelectedString);
|
||||||
|
|
||||||
fButton = new BButton("removal", B_TRANSLATE("Remove"),
|
fButton = new BButton("removal", B_TRANSLATE("Remove"),
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ InstallerWindow::InstallerWindow()
|
|||||||
|
|
||||||
fStatusView = new BTextView("statusView", be_plain_font, NULL,
|
fStatusView = new BTextView("statusView", be_plain_font, NULL,
|
||||||
B_WILL_DRAW);
|
B_WILL_DRAW);
|
||||||
|
fStatusView->SetViewColor(255, 255, 255, 255);
|
||||||
fStatusView->SetInsets(10, 0, 10, 0);
|
fStatusView->SetInsets(10, 0, 10, 0);
|
||||||
fStatusView->MakeEditable(false);
|
fStatusView->MakeEditable(false);
|
||||||
fStatusView->MakeSelectable(false);
|
fStatusView->MakeSelectable(false);
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ LoginApp::ReadyToRun()
|
|||||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||||
alert->Go(NULL);
|
alert->Go(NULL);
|
||||||
} else {
|
} else {
|
||||||
BRect frame(0, 0, 450, 150);
|
float sizeDelta = (float)be_plain_font->Size()/12.0f;
|
||||||
|
BRect frame(0, 0, 450 * sizeDelta, 150 * sizeDelta);
|
||||||
frame.OffsetBySelf(screen.Frame().Width()/2 - frame.Width()/2,
|
frame.OffsetBySelf(screen.Frame().Width()/2 - frame.Width()/2,
|
||||||
screen.Frame().Height()/2 - frame.Height()/2);
|
screen.Frame().Height()/2 - frame.Height()/2);
|
||||||
fLoginWindow = new LoginWindow(frame);
|
fLoginWindow = new LoginWindow(frame);
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ LoginView::LoginView(BRect frame)
|
|||||||
{
|
{
|
||||||
// TODO: when I don't need to test in BeOS anymore,
|
// TODO: when I don't need to test in BeOS anymore,
|
||||||
// rewrite to use layout engine.
|
// rewrite to use layout engine.
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
SetLowColor(ViewColor());
|
SetLowUIColor(ViewUIColor());
|
||||||
BRect r;
|
BRect r;
|
||||||
r.Set(CSEP, CSEP, LW, Bounds().Height() - 3 * CSEP - BH);
|
r.Set(CSEP, CSEP, LW, Bounds().Height() - 3 * CSEP - BH);
|
||||||
fUserList = new BListView(r, "users");
|
fUserList = new BListView(r, "users");
|
||||||
@@ -85,20 +85,24 @@ LoginView::LoginView(BRect frame)
|
|||||||
|
|
||||||
fHaltButton = new BButton(buttonRect, "halt", B_TRANSLATE("Halt"),
|
fHaltButton = new BButton(buttonRect, "halt", B_TRANSLATE("Halt"),
|
||||||
new BMessage(kHaltAction));
|
new BMessage(kHaltAction));
|
||||||
|
fHaltButton->ResizeToPreferred();
|
||||||
AddChild(fHaltButton);
|
AddChild(fHaltButton);
|
||||||
|
|
||||||
buttonRect.OffsetBySelf(CSEP + buttonWidth, 0);
|
buttonRect.OffsetBySelf(CSEP + fHaltButton->Frame().Width(), 0);
|
||||||
fRebootButton = new BButton(buttonRect, "reboot", B_TRANSLATE("Reboot"),
|
fRebootButton = new BButton(buttonRect, "reboot", B_TRANSLATE("Reboot"),
|
||||||
new BMessage(kRebootAction));
|
new BMessage(kRebootAction));
|
||||||
|
|
||||||
|
fRebootButton->ResizeToPreferred();
|
||||||
AddChild(fRebootButton);
|
AddChild(fRebootButton);
|
||||||
|
|
||||||
BRect infoRect(buttonRect);
|
BRect infoRect(buttonRect);
|
||||||
infoRect.OffsetBySelf(buttonWidth + CSEP, 0);
|
infoRect.OffsetBySelf(fRebootButton->Frame().Width() + CSEP, 0);
|
||||||
|
|
||||||
buttonRect.OffsetToSelf(Bounds().Width() - CSEP - buttonWidth,
|
buttonRect.OffsetToSelf(Bounds().Width() - CSEP - buttonWidth,
|
||||||
Bounds().Height() - CSEP - BH);
|
Bounds().Height() - CSEP - BH);
|
||||||
fLoginButton = new BButton(buttonRect, "ok", B_TRANSLATE("OK"),
|
fLoginButton = new BButton(buttonRect, "ok", B_TRANSLATE("OK"),
|
||||||
new BMessage(kAttemptLogin));
|
new BMessage(kAttemptLogin));
|
||||||
|
fLoginButton->ResizeToPreferred();
|
||||||
AddChild(fLoginButton);
|
AddChild(fLoginButton);
|
||||||
|
|
||||||
infoRect.right = buttonRect.left - CSEP + 5;
|
infoRect.right = buttonRect.left - CSEP + 5;
|
||||||
@@ -128,6 +132,19 @@ LoginView::AttachedToWindow()
|
|||||||
fUserList->MakeFocus();
|
fUserList->MakeFocus();
|
||||||
// populate user list
|
// populate user list
|
||||||
BMessenger(this).SendMessage(kAddNextUser);
|
BMessenger(this).SendMessage(kAddNextUser);
|
||||||
|
|
||||||
|
// size window relative to buttons
|
||||||
|
BRect bounds = Window()->Bounds();
|
||||||
|
float spacing = fHaltButton->Frame().left;
|
||||||
|
bounds.bottom = fLoginButton->Frame().bottom + spacing;
|
||||||
|
bounds.right = fLoginButton->Frame().right + spacing;
|
||||||
|
Window()->ResizeTo(bounds.Width(), bounds.Height());
|
||||||
|
|
||||||
|
// Center info view
|
||||||
|
BPoint leftTop = fInfoView->Frame().LeftTop();
|
||||||
|
leftTop.y += fHaltButton->Frame().Height() / 2;
|
||||||
|
leftTop.y -= fInfoView->Bounds().Height() / 2;
|
||||||
|
fInfoView->MoveTo(leftTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -808,7 +808,7 @@ void
|
|||||||
TInfoView::AttachedToWindow()
|
TInfoView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
BBox::AttachedToWindow();
|
BBox::AttachedToWindow();
|
||||||
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
dynamic_cast<TWindow*>(Window())->PixelCount(&fHPixelCount, &fVPixelCount);
|
dynamic_cast<TWindow*>(Window())->PixelCount(&fHPixelCount, &fVPixelCount);
|
||||||
fPixelSize = dynamic_cast<TWindow*>(Window())->PixelSize();
|
fPixelSize = dynamic_cast<TWindow*>(Window())->PixelSize();
|
||||||
|
|
||||||
@@ -1050,7 +1050,6 @@ TMagnify::TMagnify(BRect r, TWindow* parent)
|
|||||||
fParent(parent),
|
fParent(parent),
|
||||||
fStickCoordinates(false)
|
fStickCoordinates(false)
|
||||||
{
|
{
|
||||||
SetViewColor(B_TRANSPARENT_32_BIT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1073,6 +1072,7 @@ TMagnify::AttachedToWindow()
|
|||||||
|
|
||||||
resume_thread(fThread);
|
resume_thread(fThread);
|
||||||
|
|
||||||
|
SetViewColor(B_TRANSPARENT_32_BIT);
|
||||||
MakeFocus();
|
MakeFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -656,8 +656,8 @@ AddressTextControl::AddressTextControl(const char* name, BMessage* message)
|
|||||||
.Add(fPopUpButton);
|
.Add(fPopUpButton);
|
||||||
|
|
||||||
SetFlags(Flags() | B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE);
|
SetFlags(Flags() | B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE);
|
||||||
SetLowColor(ViewColor());
|
SetLowUIColor(ViewUIColor());
|
||||||
SetViewColor(fTextView->ViewColor());
|
SetViewUIColor(fTextView->ViewUIColor());
|
||||||
|
|
||||||
SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH,
|
SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH,
|
||||||
B_ALIGN_VERTICAL_CENTER));
|
B_ALIGN_VERTICAL_CENTER));
|
||||||
|
|||||||
@@ -646,7 +646,7 @@ TContentView::TContentView(bool incoming, BFont* font,
|
|||||||
fFocus(false),
|
fFocus(false),
|
||||||
fIncoming(incoming)
|
fIncoming(incoming)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BGroupLayout* layout = new BGroupLayout(B_VERTICAL, 0);
|
BGroupLayout* layout = new BGroupLayout(B_VERTICAL, 0);
|
||||||
SetLayout(layout);
|
SetLayout(layout);
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ TEnclosuresView::TEnclosuresView(BRect rect, BRect windowRect)
|
|||||||
B_WILL_DRAW),
|
B_WILL_DRAW),
|
||||||
fFocus(false)
|
fFocus(false)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BFont font(be_plain_font);
|
BFont font(be_plain_font);
|
||||||
font.SetSize(font.Size() * kPlainFontSizeScale);
|
font.SetSize(font.Size() * kPlainFontSizeScale);
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ FindPanel::~FindPanel()
|
|||||||
void FindPanel::AttachedToWindow()
|
void FindPanel::AttachedToWindow()
|
||||||
{
|
{
|
||||||
BView::AttachedToWindow();
|
BView::AttachedToWindow();
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
Window()->SetDefaultButton(fFindButton);
|
Window()->SetDefaultButton(fFindButton);
|
||||||
fFindButton->SetTarget(this);
|
fFindButton->SetTarget(this);
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ TStatusWindow::TStatusWindow(BRect rect, BMessenger target, const char* status)
|
|||||||
fTarget(target)
|
fTarget(target)
|
||||||
{
|
{
|
||||||
BView* view = new BView(Bounds(), "", B_FOLLOW_ALL, B_WILL_DRAW);
|
BView* view = new BView(Bounds(), "", B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
view->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(view);
|
AddChild(view);
|
||||||
|
|
||||||
BRect r(STATUS_FIELD_H, STATUS_FIELD_V,
|
BRect r(STATUS_FIELD_H, STATUS_FIELD_V,
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ IconView::AttachedToWindow()
|
|||||||
if (Parent() != NULL)
|
if (Parent() != NULL)
|
||||||
SetViewColor(Parent()->ViewColor());
|
SetViewColor(Parent()->ViewColor());
|
||||||
else
|
else
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ void
|
|||||||
DurationView::AttachedToWindow()
|
DurationView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
BStringView::AttachedToWindow();
|
BStringView::AttachedToWindow();
|
||||||
SetHighColor(tint_color(ViewColor(), B_DARKEN_4_TINT));
|
_UpdateTextColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -46,6 +46,17 @@ DurationView::MouseDown(BPoint where)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
DurationView::MessageReceived(BMessage* message)
|
||||||
|
{
|
||||||
|
if (message->what == B_COLORS_UPDATED
|
||||||
|
&& message->HasColor(ui_color_name(B_PANEL_TEXT_COLOR)))
|
||||||
|
_UpdateTextColor();
|
||||||
|
|
||||||
|
BStringView::MessageReceived(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BSize
|
BSize
|
||||||
DurationView::MinSize()
|
DurationView::MinSize()
|
||||||
{
|
{
|
||||||
@@ -128,6 +139,13 @@ DurationView::_Update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
DurationView::_UpdateTextColor()
|
||||||
|
{
|
||||||
|
SetHighColor(mix_color(ViewColor(), ui_color(B_PANEL_TEXT_COLOR), 128));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DurationView::_GenerateString(bigtime_t duration)
|
DurationView::_GenerateString(bigtime_t duration)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public:
|
|||||||
// BStringView interface
|
// BStringView interface
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void MouseDown(BPoint where);
|
virtual void MouseDown(BPoint where);
|
||||||
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual BSize MinSize();
|
virtual BSize MinSize();
|
||||||
virtual BSize MaxSize();
|
virtual BSize MaxSize();
|
||||||
|
|
||||||
@@ -39,6 +40,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void _Update();
|
void _Update();
|
||||||
|
void _UpdateTextColor();
|
||||||
void _GenerateString(bigtime_t duration);
|
void _GenerateString(bigtime_t duration);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -236,11 +236,14 @@ NetworkStatusView::AttachedToWindow()
|
|||||||
if ((Parent()->Flags() & B_DRAW_ON_CHILDREN) != 0)
|
if ((Parent()->Flags() & B_DRAW_ON_CHILDREN) != 0)
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewColor(B_TRANSPARENT_COLOR);
|
||||||
else
|
else
|
||||||
SetViewColor(Parent()->ViewColor());
|
AdoptParentColors();
|
||||||
} else
|
} else
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
SetLowColor(ViewColor());
|
if (ViewUIColor() != B_NO_COLOR)
|
||||||
|
SetLowUIColor(ViewUIColor());
|
||||||
|
else
|
||||||
|
SetLowColor(ViewColor());
|
||||||
|
|
||||||
start_watching_network(
|
start_watching_network(
|
||||||
B_WATCH_NETWORK_INTERFACE_CHANGES | B_WATCH_NETWORK_LINK_CHANGES, this);
|
B_WATCH_NETWORK_INTERFACE_CHANGES | B_WATCH_NETWORK_LINK_CHANGES, this);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ NetworkStatusWindow::NetworkStatusWindow()
|
|||||||
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
|
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
|
||||||
{
|
{
|
||||||
BView* topView = new BView(Bounds(), NULL, B_FOLLOW_ALL, B_WILL_DRAW);
|
BView* topView = new BView(Bounds(), NULL, B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
topView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(topView);
|
AddChild(topView);
|
||||||
|
|
||||||
SetSizeLimits(25, 265, 25, 265);
|
SetSizeLimits(25, 265, 25, 265);
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ RadioView::AttachedToWindow()
|
|||||||
if (Parent() != NULL)
|
if (Parent() != NULL)
|
||||||
SetViewColor(Parent()->ViewColor());
|
SetViewColor(Parent()->ViewColor());
|
||||||
else
|
else
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
SubDir HAIKU_TOP src apps overlayimage ;
|
SubDir HAIKU_TOP src apps overlayimage ;
|
||||||
|
|
||||||
|
UsePrivateHeaders interface ;
|
||||||
|
|
||||||
Application OverlayImage :
|
Application OverlayImage :
|
||||||
OverlayApp.cpp
|
OverlayApp.cpp
|
||||||
OverlayView.cpp
|
OverlayView.cpp
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <TextView.h>
|
#include <TextView.h>
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATION_CONTEXT
|
#undef B_TRANSLATION_CONTEXT
|
||||||
#define B_TRANSLATION_CONTEXT "Main view"
|
#define B_TRANSLATION_CONTEXT "Main view"
|
||||||
|
|
||||||
@@ -40,7 +41,9 @@ OverlayView::OverlayView(BRect frame)
|
|||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewColor(B_TRANSPARENT_COLOR);
|
||||||
|
|
||||||
fText = new BTextView(Bounds(), "bgView", Bounds(), B_FOLLOW_ALL, B_WILL_DRAW);
|
fText = new BTextView(Bounds(), "bgView", Bounds(), B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
fText->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fText->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
rgb_color color = ui_color(B_PANEL_TEXT_COLOR);
|
||||||
|
fText->SetFontAndColor(be_plain_font, B_FONT_ALL, &color);
|
||||||
AddChild(fText);
|
AddChild(fText);
|
||||||
BString text;
|
BString text;
|
||||||
text << B_TRANSLATE(
|
text << B_TRANSLATE(
|
||||||
@@ -117,7 +120,14 @@ OverlayView::MessageReceived(BMessage *msg)
|
|||||||
case B_ABOUT_REQUESTED:
|
case B_ABOUT_REQUESTED:
|
||||||
OverlayAboutRequested();
|
OverlayAboutRequested();
|
||||||
break;
|
break;
|
||||||
|
case B_COLORS_UPDATED:
|
||||||
|
{
|
||||||
|
rgb_color color;
|
||||||
|
if (msg->FindColor(ui_color_name(B_PANEL_TEXT_COLOR), &color)
|
||||||
|
== B_OK)
|
||||||
|
fText->SetFontAndColor(be_plain_font, B_FONT_ALL, &color);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
BView::MessageReceived(msg);
|
BView::MessageReceived(msg);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ OverlayWindow::OverlayWindow()
|
|||||||
AddChild(replView);
|
AddChild(replView);
|
||||||
|
|
||||||
BView *bgView = new BView(Bounds(), "bgView", B_FOLLOW_ALL, B_WILL_DRAW);
|
BView *bgView = new BView(Bounds(), "bgView", B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
bgView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
bgView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(bgView);
|
AddChild(bgView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -471,16 +471,19 @@ private:
|
|||||||
void
|
void
|
||||||
PackageView::_InitView()
|
PackageView::_InitView()
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
float fontHeight = be_plain_font->Size();
|
float fontHeight = be_plain_font->Size();
|
||||||
|
rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR);
|
||||||
|
|
||||||
BTextView* packageDescriptionView = new DescriptionTextView(
|
BTextView* packageDescriptionView = new DescriptionTextView(
|
||||||
"package description", fontHeight * 13);
|
"package description", fontHeight * 13);
|
||||||
packageDescriptionView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
packageDescriptionView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
packageDescriptionView->SetText(fInfo.GetDescription());
|
packageDescriptionView->SetText(fInfo.GetDescription());
|
||||||
packageDescriptionView->MakeEditable(false);
|
packageDescriptionView->MakeEditable(false);
|
||||||
packageDescriptionView->MakeSelectable(false);
|
packageDescriptionView->MakeSelectable(false);
|
||||||
|
packageDescriptionView->SetFontAndColor(be_plain_font, B_FONT_ALL,
|
||||||
|
&textColor);
|
||||||
|
|
||||||
BScrollView* descriptionScrollView = new BScrollView(
|
BScrollView* descriptionScrollView = new BScrollView(
|
||||||
"package description scroll view", packageDescriptionView,
|
"package description scroll view", packageDescriptionView,
|
||||||
@@ -500,11 +503,11 @@ PackageView::_InitView()
|
|||||||
// Left inset needs to match BMenuField text offset
|
// Left inset needs to match BMenuField text offset
|
||||||
fInstallTypeDescriptionView->SetText(
|
fInstallTypeDescriptionView->SetText(
|
||||||
B_TRANSLATE("No installation type selected"));
|
B_TRANSLATE("No installation type selected"));
|
||||||
fInstallTypeDescriptionView->SetViewColor(
|
fInstallTypeDescriptionView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
BFont font(be_plain_font);
|
BFont font(be_plain_font);
|
||||||
font.SetSize(ceilf(font.Size() * 0.85));
|
font.SetSize(ceilf(font.Size() * 0.85));
|
||||||
fInstallTypeDescriptionView->SetFontAndColor(&font);
|
fInstallTypeDescriptionView->SetFontAndColor(&font, B_FONT_ALL,
|
||||||
|
&textColor);
|
||||||
|
|
||||||
BScrollView* installTypeScrollView = new BScrollView(
|
BScrollView* installTypeScrollView = new BScrollView(
|
||||||
"install type description scroll view", fInstallTypeDescriptionView,
|
"install type description scroll view", fInstallTypeDescriptionView,
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ PairsView::PairsView(BRect frame, const char* name, uint8 rows, uint8 cols,
|
|||||||
fPositionX(new int32[fButtonsCount]),
|
fPositionX(new int32[fButtonsCount]),
|
||||||
fPositionY(new int32[fButtonsCount])
|
fPositionY(new int32[fButtonsCount])
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
CreateGameBoard();
|
CreateGameBoard();
|
||||||
_SetPairsBoard();
|
_SetPairsBoard();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ void
|
|||||||
PatchRow::AttachedToWindow()
|
PatchRow::AttachedToWindow()
|
||||||
{
|
{
|
||||||
Window()->SetPulseRate(200000);
|
Window()->SetPulseRate(200000);
|
||||||
SetViewColor(Parent()->ViewColor());
|
AdoptParentColors();
|
||||||
int32 numChildren = CountChildren();
|
int32 numChildren = CountChildren();
|
||||||
for (int32 i = 0; i < numChildren; i++) {
|
for (int32 i = 0; i < numChildren; i++) {
|
||||||
PatchCheckBox* box = dynamic_cast<PatchCheckBox*>(ChildAt(i));
|
PatchCheckBox* box = dynamic_cast<PatchCheckBox*>(ChildAt(i));
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ PatchView::PatchView(BRect rect)
|
|||||||
BView(rect, "PatchView", B_FOLLOW_ALL, B_WILL_DRAW),
|
BView(rect, "PatchView", B_FOLLOW_ALL, B_WILL_DRAW),
|
||||||
fUnknownDeviceIcon(NULL)
|
fUnknownDeviceIcon(NULL)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BRect iconRect(0, 0, LARGE_ICON_SIZE - 1, LARGE_ICON_SIZE - 1);
|
BRect iconRect(0, 0, LARGE_ICON_SIZE - 1, LARGE_ICON_SIZE - 1);
|
||||||
fUnknownDeviceIcon = new BBitmap(iconRect, B_RGBA32);
|
fUnknownDeviceIcon = new BBitmap(iconRect, B_RGBA32);
|
||||||
@@ -68,6 +68,7 @@ PatchView::AttachedToWindow()
|
|||||||
|
|
||||||
BMessenger msgr(this);
|
BMessenger msgr(this);
|
||||||
roster->StartWatching(&msgr);
|
roster->StartWatching(&msgr);
|
||||||
|
SetHighUIColor(B_PANEL_TEXT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ BatteryInfoView::BatteryInfoView()
|
|||||||
fPreferredSize(200, 200),
|
fPreferredSize(200, 200),
|
||||||
fMaxStringSize(0, 0)
|
fMaxStringSize(0, 0)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -346,7 +346,7 @@ ExtendedInfoWindow::ExtendedInfoWindow(PowerStatusDriverInterface* interface)
|
|||||||
fDriverInterface->AcquireReference();
|
fDriverInterface->AcquireReference();
|
||||||
|
|
||||||
BView *view = new BView(Bounds(), "view", B_FOLLOW_ALL, 0);
|
BView *view = new BView(Bounds(), "view", B_FOLLOW_ALL, 0);
|
||||||
view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
view->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(view);
|
AddChild(view);
|
||||||
|
|
||||||
BGroupLayout* mainLayout = new BGroupLayout(B_VERTICAL);
|
BGroupLayout* mainLayout = new BGroupLayout(B_VERTICAL);
|
||||||
|
|||||||
@@ -118,10 +118,12 @@ void
|
|||||||
PowerStatusView::AttachedToWindow()
|
PowerStatusView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
BView::AttachedToWindow();
|
BView::AttachedToWindow();
|
||||||
if (Parent())
|
AdoptParentColors();
|
||||||
SetLowColor(Parent()->ViewColor());
|
|
||||||
|
if (ViewUIColor() == B_NO_COLOR)
|
||||||
|
SetLowUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
else
|
else
|
||||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetLowUIColor(ViewUIColor());
|
||||||
|
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
@@ -159,7 +161,10 @@ PowerStatusView::_DrawBattery(BRect rect)
|
|||||||
float left = rect.left;
|
float left = rect.left;
|
||||||
rect.left += rect.Width() / 11;
|
rect.left += rect.Width() / 11;
|
||||||
|
|
||||||
SetHighColor(0, 0, 0);
|
if (LowColor().Brightness() > 100)
|
||||||
|
SetHighColor(0, 0, 0);
|
||||||
|
else
|
||||||
|
SetHighColor(128, 128, 128);
|
||||||
|
|
||||||
float gap = 1;
|
float gap = 1;
|
||||||
if (rect.Height() > 8) {
|
if (rect.Height() > 8) {
|
||||||
@@ -190,7 +195,10 @@ PowerStatusView::_DrawBattery(BRect rect)
|
|||||||
|
|
||||||
if (percent > 0) {
|
if (percent > 0) {
|
||||||
rect.InsetBy(gap, gap);
|
rect.InsetBy(gap, gap);
|
||||||
rgb_color base = {84, 84, 84, 255};
|
rgb_color base = (rgb_color){84, 84, 84, 255};
|
||||||
|
if (LowColor().Brightness() < 128)
|
||||||
|
base = (rgb_color){172, 172, 172, 255};
|
||||||
|
|
||||||
if (be_control_look != NULL) {
|
if (be_control_look != NULL) {
|
||||||
BRect empty = rect;
|
BRect empty = rect;
|
||||||
if (fHasBattery && percent > 0)
|
if (fHasBattery && percent > 0)
|
||||||
@@ -313,8 +321,7 @@ PowerStatusView::Draw(BRect updateRect)
|
|||||||
SetHighColor(ui_color(B_CONTROL_TEXT_COLOR));
|
SetHighColor(ui_color(B_CONTROL_TEXT_COLOR));
|
||||||
else {
|
else {
|
||||||
SetDrawingMode(B_OP_OVER);
|
SetDrawingMode(B_OP_OVER);
|
||||||
rgb_color c = Parent()->LowColor();
|
if (LowColor().Brightness() > 100)
|
||||||
if (c.red + c.green + c.blue > 128 * 3)
|
|
||||||
SetHighColor(0, 0, 0);
|
SetHighColor(0, 0, 0);
|
||||||
else
|
else
|
||||||
SetHighColor(255, 255, 255);
|
SetHighColor(255, 255, 255);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ PowerStatusWindow::PowerStatusWindow()
|
|||||||
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
|
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
|
||||||
{
|
{
|
||||||
BView* topView = new BView(Bounds(), NULL, B_FOLLOW_ALL, B_WILL_DRAW);
|
BView* topView = new BView(Bounds(), NULL, B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
topView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(topView);
|
AddChild(topView);
|
||||||
|
|
||||||
topView->AddChild(new PowerStatusReplicant(Bounds(), B_FOLLOW_ALL));
|
topView->AddChild(new PowerStatusReplicant(Bounds(), B_FOLLOW_ALL));
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ PCWindow::PCWindow()
|
|||||||
BRect rect = Bounds();
|
BRect rect = Bounds();
|
||||||
|
|
||||||
BView* topView = new BView(rect, NULL, B_FOLLOW_ALL, B_WILL_DRAW);
|
BView* topView = new BView(rect, NULL, B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
topView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(topView);
|
AddChild(topView);
|
||||||
|
|
||||||
// set up a rectangle && instantiate a new view
|
// set up a rectangle && instantiate a new view
|
||||||
|
|||||||
@@ -198,10 +198,10 @@ ConfigView::AttachedToWindow()
|
|||||||
// AttachedToWindow() gets called every time this tab is brought
|
// AttachedToWindow() gets called every time this tab is brought
|
||||||
// to the front, but we only want this initialization to happen once
|
// to the front, but we only want this initialization to happen once
|
||||||
if (fFirstTimeAttached) {
|
if (fFirstTimeAttached) {
|
||||||
if (Parent() != NULL)
|
AdoptParentColors();
|
||||||
SetViewColor(Parent()->ViewColor());
|
|
||||||
else
|
if (Parent() == NULL)
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BMessenger messenger(this);
|
BMessenger messenger(this);
|
||||||
fColorControl->SetTarget(messenger);
|
fColorControl->SetTarget(messenger);
|
||||||
|
|||||||
@@ -50,9 +50,8 @@ NormalPulseView::NormalPulseView(BRect rect)
|
|||||||
: PulseView(rect, "NormalPulseView"),
|
: PulseView(rect, "NormalPulseView"),
|
||||||
fHasBrandLogo(false)
|
fHasBrandLogo(false)
|
||||||
{
|
{
|
||||||
rgb_color color = { 168, 168, 168, 0xff };
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
SetViewColor(color);
|
SetLowUIColor(ViewUIColor());
|
||||||
SetLowColor(color);
|
|
||||||
|
|
||||||
mode1->SetLabel(B_TRANSLATE("Mini mode"));
|
mode1->SetLabel(B_TRANSLATE("Mini mode"));
|
||||||
mode1->SetMessage(new BMessage(PV_MINI_MODE));
|
mode1->SetMessage(new BMessage(PV_MINI_MODE));
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ PrefsWindow::PrefsWindow(BRect frame, const char *name,
|
|||||||
// This gives a nice look, and sets the background color correctly
|
// This gives a nice look, and sets the background color correctly
|
||||||
BRect bounds = Bounds();
|
BRect bounds = Bounds();
|
||||||
BView* topView = new BView(bounds, "ParentView", B_FOLLOW_ALL, B_WILL_DRAW);
|
BView* topView = new BView(bounds, "ParentView", B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
topView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(topView);
|
AddChild(topView);
|
||||||
|
|
||||||
bounds.top += 10;
|
bounds.top += 10;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ BitmapView::BitmapView(BRect frame, const char *name, BMessage *mod, BBitmap *bi
|
|||||||
const char *label, border_style borderstyle, int32 resize, int32 flags)
|
const char *label, border_style borderstyle, int32 resize, int32 flags)
|
||||||
: BView(frame, name, resize, flags)
|
: BView(frame, name, resize, flags)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
if (bitmap && bitmap->IsValid())
|
if (bitmap && bitmap->IsValid())
|
||||||
fBitmap = bitmap;
|
fBitmap = bitmap;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ ImageEditor::ImageEditor(const BRect &frame, ResourceData *data, BHandler *owner
|
|||||||
imgsize.Set(0, 0, 200, 200);
|
imgsize.Set(0, 0, 200, 200);
|
||||||
|
|
||||||
BView *back = new BView(Bounds(), "back", B_FOLLOW_ALL, B_WILL_DRAW);
|
BView *back = new BView(Bounds(), "back", B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
back->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
back->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(back);
|
AddChild(back);
|
||||||
|
|
||||||
BRect r;
|
BRect r;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ UsePrivateHeaders shared interface ;
|
|||||||
local columnViewSources ;
|
local columnViewSources ;
|
||||||
|
|
||||||
if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
|
if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
|
||||||
columnViewSources = ColumnListView.cpp ColumnTypes.cpp ColorTools.cpp ;
|
columnViewSources = ColumnListView.cpp ColumnTypes.cpp ;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ Editor::~Editor(void)
|
|||||||
StringEditView::StringEditView(const BRect &frame)
|
StringEditView::StringEditView(const BRect &frame)
|
||||||
: BView(frame, "edit", B_FOLLOW_ALL, B_WILL_DRAW)
|
: BView(frame, "edit", B_FOLLOW_ALL, B_WILL_DRAW)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BRect r;
|
BRect r;
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ ResView::ResView(const BRect &frame, const char *name, const int32 &resize,
|
|||||||
fOpenPanel(NULL),
|
fOpenPanel(NULL),
|
||||||
fSavePanel(NULL)
|
fSavePanel(NULL)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
if (ref) {
|
if (ref) {
|
||||||
fRef = new entry_ref;
|
fRef = new entry_ref;
|
||||||
*fRef = *ref;
|
*fRef = *ref;
|
||||||
|
|||||||
@@ -175,13 +175,13 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,
|
|||||||
|
|
||||||
BMenuField* menuLocation = new BMenuField(B_TRANSLATE("Save in:"),
|
BMenuField* menuLocation = new BMenuField(B_TRANSLATE("Save in:"),
|
||||||
fOutputPathMenu);
|
fOutputPathMenu);
|
||||||
menuLocation->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
menuLocation->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
fTranslatorMenu = new BMenu(B_TRANSLATE("Please select"));
|
fTranslatorMenu = new BMenu(B_TRANSLATE("Please select"));
|
||||||
_SetupTranslatorMenu();
|
_SetupTranslatorMenu();
|
||||||
BMenuField* menuFormat = new BMenuField(B_TRANSLATE("Save as:"),
|
BMenuField* menuFormat = new BMenuField(B_TRANSLATE("Save as:"),
|
||||||
fTranslatorMenu);
|
fTranslatorMenu);
|
||||||
menuFormat->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
menuFormat->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
|
|
||||||
BButton* showSettings = new BButton("",
|
BButton* showSettings = new BButton("",
|
||||||
B_TRANSLATE("Settings" B_UTF8_ELLIPSIS), new BMessage(kSettings));
|
B_TRANSLATE("Settings" B_UTF8_ELLIPSIS), new BMessage(kSettings));
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ ProgressWindow::ProgressWindow()
|
|||||||
BRect rect = Bounds();
|
BRect rect = Bounds();
|
||||||
|
|
||||||
BView* view = new BView(rect, NULL, B_FOLLOW_ALL, B_WILL_DRAW);
|
BView* view = new BView(rect, NULL, B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
view->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
AddChild(view);
|
AddChild(view);
|
||||||
|
|
||||||
rect = view->Bounds().InsetByCopy(5, 5);
|
rect = view->Bounds().InsetByCopy(5, 5);
|
||||||
|
|||||||
@@ -45,15 +45,8 @@ ShowImageStatusView::AttachedToWindow()
|
|||||||
|
|
||||||
BScrollBar* scrollBar = fScrollView->ScrollBar(B_HORIZONTAL);
|
BScrollBar* scrollBar = fScrollView->ScrollBar(B_HORIZONTAL);
|
||||||
MoveTo(0.0, scrollBar->Frame().top);
|
MoveTo(0.0, scrollBar->Frame().top);
|
||||||
rgb_color color = B_TRANSPARENT_COLOR;
|
|
||||||
BView* parent = Parent();
|
|
||||||
if (parent != NULL)
|
|
||||||
color = parent->ViewColor();
|
|
||||||
|
|
||||||
if (color == B_TRANSPARENT_COLOR)
|
AdoptParentColors();
|
||||||
color = ui_color(B_PANEL_BACKGROUND_COLOR);
|
|
||||||
|
|
||||||
SetViewColor(color);
|
|
||||||
|
|
||||||
ResizeToPreferred();
|
ResizeToPreferred();
|
||||||
}
|
}
|
||||||
@@ -98,7 +91,8 @@ ShowImageStatusView::Draw(BRect updateRect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BRect bounds(Bounds());
|
BRect bounds(Bounds());
|
||||||
rgb_color highColor = HighColor();
|
rgb_color highColor = ui_color(B_PANEL_TEXT_COLOR);
|
||||||
|
|
||||||
SetHighColor(tint_color(ViewColor(), B_DARKEN_2_TINT));
|
SetHighColor(tint_color(ViewColor(), B_DARKEN_2_TINT));
|
||||||
StrokeLine(bounds.LeftTop(), bounds.RightTop());
|
StrokeLine(bounds.LeftTop(), bounds.RightTop());
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ ShowImageWindow::ShowImageWindow(BRect frame, const entry_ref& ref,
|
|||||||
// visible portion without colliding with the menu bar.
|
// visible portion without colliding with the menu bar.
|
||||||
|
|
||||||
BView* contentView = new BView(BRect(), "content", B_FOLLOW_NONE, 0);
|
BView* contentView = new BView(BRect(), "content", B_FOLLOW_NONE, 0);
|
||||||
contentView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
contentView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
contentView->SetExplicitMinSize(BSize(250, 100));
|
contentView->SetExplicitMinSize(BSize(250, 100));
|
||||||
AddChild(contentView);
|
AddChild(contentView);
|
||||||
|
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ RecorderWindow::InitWindow()
|
|||||||
fSoundList = new SoundListView(r, B_TRANSLATE("Sound List"),
|
fSoundList = new SoundListView(r, B_TRANSLATE("Sound List"),
|
||||||
B_FOLLOW_ALL);
|
B_FOLLOW_ALL);
|
||||||
fSoundList->SetSelectionMessage(new BMessage(SOUND_SELECTED));
|
fSoundList->SetSelectionMessage(new BMessage(SOUND_SELECTED));
|
||||||
fSoundList->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fSoundList->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
BScrollView *scroller = new BScrollView("scroller", fSoundList,
|
BScrollView *scroller = new BScrollView("scroller", fSoundList,
|
||||||
B_FOLLOW_ALL, 0, false, true, B_FANCY_BORDER);
|
B_FOLLOW_ALL, 0, false, true, B_FANCY_BORDER);
|
||||||
fBottomBox->AddChild(scroller);
|
fBottomBox->AddChild(scroller);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user