From 1a8c00c14bf5a31835697c93f3f92fd860de0a10 Mon Sep 17 00:00:00 2001 From: looncraz Date: Thu, 10 Dec 2015 12:53:27 -0600 Subject: [PATCH] servers: Convert to using Set*UIColor. Signed-off-by: Augustin Cavalier Patches 0020-0022 from looncraz, unmodified. --- src/servers/bluetooth/DeskbarReplicant.cpp | 5 +---- src/servers/keystore/AppAccessRequestWindow.cpp | 4 ++-- src/servers/keystore/KeyRequestWindow.cpp | 4 ++-- src/servers/mail/DeskbarView.cpp | 10 +++++----- src/servers/notification/NotificationView.cpp | 2 +- src/servers/registrar/ShutdownProcess.cpp | 4 ++-- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/servers/bluetooth/DeskbarReplicant.cpp b/src/servers/bluetooth/DeskbarReplicant.cpp index 81bb6933db..bb10d7a8a3 100644 --- a/src/servers/bluetooth/DeskbarReplicant.cpp +++ b/src/servers/bluetooth/DeskbarReplicant.cpp @@ -117,10 +117,7 @@ void DeskbarReplicant::AttachedToWindow() { BView::AttachedToWindow(); - if (Parent()) - SetViewColor(Parent()->ViewColor()); - else - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + AdoptParentColors(); SetLowColor(ViewColor()); } diff --git a/src/servers/keystore/AppAccessRequestWindow.cpp b/src/servers/keystore/AppAccessRequestWindow.cpp index dc77e4ce0a..c25ba584c1 100644 --- a/src/servers/keystore/AppAccessRequestWindow.cpp +++ b/src/servers/keystore/AppAccessRequestWindow.cpp @@ -41,7 +41,7 @@ public: : BView("AppAccessRequestView", B_WILL_DRAW) { - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); BGroupLayout* rootLayout = new(std::nothrow) BGroupLayout(B_VERTICAL); if (rootLayout == NULL) @@ -87,7 +87,7 @@ public: } message->SetText(details); - message->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + message->SetViewUIColor(B_PANEL_BACKGROUND_COLOR); rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR); message->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor); message->MakeEditable(false); diff --git a/src/servers/keystore/KeyRequestWindow.cpp b/src/servers/keystore/KeyRequestWindow.cpp index 6d93408d58..b017bbe988 100644 --- a/src/servers/keystore/KeyRequestWindow.cpp +++ b/src/servers/keystore/KeyRequestWindow.cpp @@ -42,7 +42,7 @@ public: BView("KeyRequestView", B_WILL_DRAW), fPassword(NULL) { - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); BGroupLayout* rootLayout = new(std::nothrow) BGroupLayout(B_VERTICAL); if (rootLayout == NULL) @@ -108,7 +108,7 @@ public: "If you unlock the keyring, it stays unlocked until the system is " "shut down or the keyring is manually locked again.\n" "If you cancel this dialog the keyring will remain locked.")); - message->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + message->SetViewUIColor(B_PANEL_BACKGROUND_COLOR); rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR); message->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor); message->MakeEditable(false); diff --git a/src/servers/mail/DeskbarView.cpp b/src/servers/mail/DeskbarView.cpp index 3a7a0b3e6b..d4d9f65b32 100644 --- a/src/servers/mail/DeskbarView.cpp +++ b/src/servers/mail/DeskbarView.cpp @@ -125,12 +125,12 @@ DeskbarView::~DeskbarView() void DeskbarView::AttachedToWindow() { BView::AttachedToWindow(); - if (Parent()) - SetViewColor(Parent()->ViewColor()); - else - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + AdoptParentColors(); - SetLowColor(ViewColor()); + if (ViewUIColor() == B_NO_COLOR) + SetLowColor(ViewColor()); + else + SetLowUIColor(ViewUIColor()); if (be_roster->IsRunning(B_MAIL_DAEMON_SIGNATURE)) { _RefreshMailQuery(); diff --git a/src/servers/notification/NotificationView.cpp b/src/servers/notification/NotificationView.cpp index cd0d98693e..1e54662412 100644 --- a/src/servers/notification/NotificationView.cpp +++ b/src/servers/notification/NotificationView.cpp @@ -74,7 +74,7 @@ NotificationView::NotificationView(NotificationWindow* win, BGroupLayout* layout = new BGroupLayout(B_VERTICAL); SetLayout(layout); - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetViewUIColor(B_PANEL_BACKGROUND_COLOR); SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); switch (fNotification->Type()) { diff --git a/src/servers/registrar/ShutdownProcess.cpp b/src/servers/registrar/ShutdownProcess.cpp index 493189c901..c6ae176303 100644 --- a/src/servers/registrar/ShutdownProcess.cpp +++ b/src/servers/registrar/ShutdownProcess.cpp @@ -261,7 +261,7 @@ public: B_FOLLOW_NONE, 0); if (!fRootView) return B_NO_MEMORY; - fRootView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + fRootView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR); AddChild(fRootView); // text view @@ -269,7 +269,7 @@ public: BRect(0, 0, 10, 10), B_FOLLOW_NONE); if (!fTextView) return B_NO_MEMORY; - fTextView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + fTextView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR); rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR); fTextView->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor); fTextView->MakeEditable(false);