From f696e88a2ccab23dedcbf03dc8e7560f1770338b Mon Sep 17 00:00:00 2001 From: looncraz Date: Thu, 10 Dec 2015 12:54:10 -0600 Subject: [PATCH] Convert various more things to using Set*UIColor. Signed-off-by: Augustin Cavalier Patches 0038, 0040, 0042-0044 from looncraz, unmodified. --- src/bin/WindowShade.cpp | 4 ++ src/bin/network/ppp_up/ConnectionView.cpp | 2 +- src/bin/network/ppp_up/PPPStatusView.cpp | 2 +- src/bin/screen_blanker/PasswordWindow.cpp | 2 +- src/kits/bluetooth/UI/ConnectionIncoming.cpp | 41 ++++++++------------ src/kits/mail/FileConfigView.cpp | 2 +- src/kits/mail/ProtocolConfigView.cpp | 2 +- src/kits/shared/CalendarView.cpp | 2 +- src/kits/shared/IconButton.cpp | 13 ++----- src/kits/shared/IconView.cpp | 2 +- src/libs/alm/ALMLayoutBuilder.cpp | 4 +- src/libs/print/libprint/AboutBox.cpp | 2 +- src/libs/print/libprint/HalftoneView.cpp | 2 +- src/libs/print/libprint/JobSetupDlg.cpp | 2 +- src/libs/print/libprint/PageSetupDlg.cpp | 2 +- src/libs/print/libprint/Preview.cpp | 2 +- 16 files changed, 38 insertions(+), 48 deletions(-) diff --git a/src/bin/WindowShade.cpp b/src/bin/WindowShade.cpp index 1d2beface0..df98488132 100644 --- a/src/bin/WindowShade.cpp +++ b/src/bin/WindowShade.cpp @@ -48,6 +48,10 @@ static struct option const kLongOptions[] = { I(navigation_pulse_color, B_NAVIGATION_PULSE_COLOR), I(shine_color, B_SHINE_COLOR), I(shadow_color, B_SHADOW_COLOR), + I(link_text_color, B_LINK_TEXT_COLOR), + I(link_hover_color, B_LINK_HOVER_COLOR), + I(link_visited_color, B_LINK_VISITED_COLOR), + I(link_active_color, B_LINK_ACTIVE_COLOR), I(menu_background_color, B_MENU_BACKGROUND_COLOR), I(menu_selected_background_color, B_MENU_SELECTED_BACKGROUND_COLOR), I(menu_item_text_color, B_MENU_ITEM_TEXT_COLOR), diff --git a/src/bin/network/ppp_up/ConnectionView.cpp b/src/bin/network/ppp_up/ConnectionView.cpp index edf0747923..14291bf4a5 100644 --- a/src/bin/network/ppp_up/ConnectionView.cpp +++ b/src/bin/network/ppp_up/ConnectionView.cpp @@ -57,7 +57,7 @@ ConnectionView::ConnectionView(BRect rect, const BString& interfaceName) fInterfaceName(interfaceName), fKeepLabel(false) { - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); rect = Bounds(); rect.InsetBy(5, 5); diff --git a/src/bin/network/ppp_up/PPPStatusView.cpp b/src/bin/network/ppp_up/PPPStatusView.cpp index 965af9222f..658d35340d 100644 --- a/src/bin/network/ppp_up/PPPStatusView.cpp +++ b/src/bin/network/ppp_up/PPPStatusView.cpp @@ -34,7 +34,7 @@ PPPStatusView::PPPStatusView(BRect rect, ppp_interface_id id) : BView(rect, "PPPStatusView", B_FOLLOW_NONE, B_PULSE_NEEDED), fInterface(id) { - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); rect = Bounds(); rect.InsetBy(5, 5); diff --git a/src/bin/screen_blanker/PasswordWindow.cpp b/src/bin/screen_blanker/PasswordWindow.cpp index 156a9f758e..b69cb39b1b 100644 --- a/src/bin/screen_blanker/PasswordWindow.cpp +++ b/src/bin/screen_blanker/PasswordWindow.cpp @@ -33,7 +33,7 @@ PasswordWindow::PasswordWindow() | B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS, B_ALL_WORKSPACES) { BView* topView = new BView(Bounds(), "topView", B_FOLLOW_ALL, B_WILL_DRAW); - topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + topView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR); AddChild(topView); BRect bounds(Bounds()); diff --git a/src/kits/bluetooth/UI/ConnectionIncoming.cpp b/src/kits/bluetooth/UI/ConnectionIncoming.cpp index 1aced3a228..c955726edf 100644 --- a/src/kits/bluetooth/UI/ConnectionIncoming.cpp +++ b/src/kits/bluetooth/UI/ConnectionIncoming.cpp @@ -7,39 +7,34 @@ #include + #define B_PULSES_BY_SECOND(x) (2*x) + namespace Bluetooth { -ConnectionView::ConnectionView(BRect frame, const char *name): BView(BRect(0, 0, 400, 400), "MyViewName", - B_FOLLOW_LEFT | B_FOLLOW_TOP, - B_WILL_DRAW | B_PULSE_NEEDED) + +ConnectionView::ConnectionView(BRect frame, const char *name) + : + BView(BRect(0, 0, 400, 400), "MyViewName", B_FOLLOW_LEFT | B_FOLLOW_TOP, + B_WILL_DRAW | B_PULSE_NEEDED) { - - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); } + ConnectionView::~ConnectionView() { - } void ConnectionView::MessageReceived(BMessage *message) { - switch(message->what) - { - default: - - break; - } } void ConnectionView::Draw(BRect update) { - } @@ -55,12 +50,14 @@ void ConnectionView::Pulse() } +//#pragma mark - + -//--------------------------------------------------------------- ConnectionIncoming::ConnectionIncoming(RemoteDevice* rDevice) - : BWindow(BRect(700, 100, 900, 150), "Connection completed", - B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, - B_NOT_ZOOMABLE | B_NOT_RESIZABLE) + : + BWindow(BRect(700, 100, 900, 150), "Connection completed", + B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, + B_NOT_ZOOMABLE | B_NOT_RESIZABLE) { _ConnectionView = new ConnectionView(BRect(0, 0, 400, 400),"mViewName"); @@ -70,18 +67,11 @@ ConnectionIncoming::ConnectionIncoming(RemoteDevice* rDevice) ConnectionIncoming::~ConnectionIncoming() { - } void ConnectionIncoming::MessageReceived(BMessage *message) { - switch(message->what) - { - default: - - break; - } } @@ -90,4 +80,5 @@ bool ConnectionIncoming::QuitRequested() return BWindow::QuitRequested(); } + } diff --git a/src/kits/mail/FileConfigView.cpp b/src/kits/mail/FileConfigView.cpp index 432a889cb7..f43801be6c 100644 --- a/src/kits/mail/FileConfigView.cpp +++ b/src/kits/mail/FileConfigView.cpp @@ -38,7 +38,7 @@ FileControl::FileControl(const char* name, const char* label, : BView(name, 0) { - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); SetLayout(new BGroupLayout(B_HORIZONTAL)); fText = new BTextControl("file_path", label, pathOfFile, NULL); diff --git a/src/kits/mail/ProtocolConfigView.cpp b/src/kits/mail/ProtocolConfigView.cpp index 6b0d0fc182..c8a7f7eac0 100644 --- a/src/kits/mail/ProtocolConfigView.cpp +++ b/src/kits/mail/ProtocolConfigView.cpp @@ -125,7 +125,7 @@ MailProtocolConfigView::MailProtocolConfigView(uint32 optionsMask) fRemoveFromServerCheckBox(NULL), fBodyDownloadConfig(NULL) { - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); BGridLayout* layout = new BGridLayout(0.f); SetLayout(layout); diff --git a/src/kits/shared/CalendarView.cpp b/src/kits/shared/CalendarView.cpp index c3d09d8460..58c7fe2c65 100644 --- a/src/kits/shared/CalendarView.cpp +++ b/src/kits/shared/CalendarView.cpp @@ -158,7 +158,7 @@ BCalendarView::AttachedToWindow() if (!Messenger().IsValid()) SetTarget(Window(), NULL); - SetViewColor(ui_color(B_LIST_BACKGROUND_COLOR)); + SetViewUIColor(B_LIST_BACKGROUND_COLOR); } diff --git a/src/kits/shared/IconButton.cpp b/src/kits/shared/IconButton.cpp index 2bf8ea58b5..0000f1d757 100644 --- a/src/kits/shared/IconButton.cpp +++ b/src/kits/shared/IconButton.cpp @@ -79,15 +79,10 @@ BIconButton::MessageReceived(BMessage* message) void BIconButton::AttachedToWindow() { - rgb_color background = B_TRANSPARENT_COLOR; - if (BView* parent = Parent()) { - background = parent->ViewColor(); - if (background == B_TRANSPARENT_COLOR) - background = parent->LowColor(); - } - if (background == B_TRANSPARENT_COLOR) - background = ui_color(B_PANEL_BACKGROUND_COLOR); - SetLowColor(background); + AdoptParentColors(); + + if (ViewUIColor() != B_NO_COLOR) + SetLowUIColor(ViewUIColor()); SetTarget(fTargetCache); if (!Target()) diff --git a/src/kits/shared/IconView.cpp b/src/kits/shared/IconView.cpp index 923f7b1fc2..5fdb0edf11 100644 --- a/src/kits/shared/IconView.cpp +++ b/src/kits/shared/IconView.cpp @@ -23,7 +23,7 @@ IconView::IconView(icon_size iconSize) fIconBitmap(new BBitmap(BRect(iconSize), B_RGBA32)), fDrawIcon(false) { - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); } diff --git a/src/libs/alm/ALMLayoutBuilder.cpp b/src/libs/alm/ALMLayoutBuilder.cpp index 79cad6235c..9906ef5b39 100644 --- a/src/libs/alm/ALMLayoutBuilder.cpp +++ b/src/libs/alm/ALMLayoutBuilder.cpp @@ -36,7 +36,7 @@ BALMLayoutBuilder::BALMLayoutBuilder(BWindow* window, float hSpacing, fLayout = new BALMLayout(hSpacing, vSpacing, friendLayout); window->SetLayout(fLayout); - fLayout->Owner()->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + fLayout->Owner()->SetViewUIColor(B_PANEL_BACKGROUND_COLOR); // TODO: we get a white background if we don't do this } @@ -46,7 +46,7 @@ BALMLayoutBuilder::BALMLayoutBuilder(BWindow* window, BALMLayout* layout) fLayout = layout; window->SetLayout(fLayout); - fLayout->Owner()->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + fLayout->Owner()->SetViewUIColor(B_PANEL_BACKGROUND_COLOR); // TODO: we get a white background if we don't do this } diff --git a/src/libs/print/libprint/AboutBox.cpp b/src/libs/print/libprint/AboutBox.cpp index 928b8e4d45..8c5f895029 100644 --- a/src/libs/print/libprint/AboutBox.cpp +++ b/src/libs/print/libprint/AboutBox.cpp @@ -39,7 +39,7 @@ AboutBoxView::AboutBoxView(BRect rect, const char *driver_name, const char *vers fDriverName = driver_name; fVersion = version; fCopyright = copyright; - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); SetDrawingMode(B_OP_SELECT); } diff --git a/src/libs/print/libprint/HalftoneView.cpp b/src/libs/print/libprint/HalftoneView.cpp index 638f327e43..946bb09dd8 100644 --- a/src/libs/print/libprint/HalftoneView.cpp +++ b/src/libs/print/libprint/HalftoneView.cpp @@ -131,7 +131,7 @@ HalftoneView::HalftoneView(BRect frame, const char* name, uint32 resizeMask, : BView(frame, name, resizeMask, flags) { - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); BRect r(frame); float size, max; diff --git a/src/libs/print/libprint/JobSetupDlg.cpp b/src/libs/print/libprint/JobSetupDlg.cpp index 93d101285c..9aa4a34301 100644 --- a/src/libs/print/libprint/JobSetupDlg.cpp +++ b/src/libs/print/libprint/JobSetupDlg.cpp @@ -160,7 +160,7 @@ JobSetupView::JobSetupView(JobData* jobData, PrinterData* printerData, fOddNumberedPages(NULL), fEvenNumberedPages(NULL) { - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); } diff --git a/src/libs/print/libprint/PageSetupDlg.cpp b/src/libs/print/libprint/PageSetupDlg.cpp index a23f6599ac..b3fb08ae12 100644 --- a/src/libs/print/libprint/PageSetupDlg.cpp +++ b/src/libs/print/libprint/PageSetupDlg.cpp @@ -61,7 +61,7 @@ PageSetupView::PageSetupView(JobData *job_data, PrinterData *printer_data, , fPrinterData(printer_data) , fPrinterCap(printer_cap) { - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); } PageSetupView::~PageSetupView() diff --git a/src/libs/print/libprint/Preview.cpp b/src/libs/print/libprint/Preview.cpp index db4d9d55d7..5c7bcade02 100644 --- a/src/libs/print/libprint/Preview.cpp +++ b/src/libs/print/libprint/Preview.cpp @@ -882,7 +882,7 @@ PreviewWindow::PreviewWindow(BFile* jobFile, bool showOkAndCancelButtons) fPreview = new PreviewView(jobFile, bounds); fPreviewScroller = new BScrollView("PreviewScroller", fPreview, B_FOLLOW_ALL, B_FRAME_EVENTS, true, true, B_FANCY_BORDER); - fPreviewScroller->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + fPreviewScroller->SetViewUIColor(B_PANEL_BACKGROUND_COLOR); panel->AddChild(fPreviewScroller); if (fPreview->InitCheck() == B_OK) {