From d661379bc4f35f9f531e1b76d493b3957ece6966 Mon Sep 17 00:00:00 2001 From: barrett Date: Tue, 29 May 2012 00:44:02 +0000 Subject: [PATCH] Fixed style and a warning, removed unuseful source file. --- application/views/ContactPopUp.cpp | 2 +- application/views/RosterListView.cpp | 7 +- .../views/SearchBarTextControl.cpp.bak | 79 ------------------- 3 files changed, 5 insertions(+), 83 deletions(-) delete mode 100644 application/views/SearchBarTextControl.cpp.bak diff --git a/application/views/ContactPopUp.cpp b/application/views/ContactPopUp.cpp index ce74cd1..4b45943 100644 --- a/application/views/ContactPopUp.cpp +++ b/application/views/ContactPopUp.cpp @@ -16,7 +16,7 @@ #include "ContactPopUp.h" #include "NotifyMessage.h" -const window_feel kMenuWindowFeel = window_feel(1025); +const window_feel kMenuWindowFeel = window_feel(B_NORMAL_WINDOW_FEEL); const int32 kNickChanged = 'NICH'; diff --git a/application/views/RosterListView.cpp b/application/views/RosterListView.cpp index d4f5c01..7bce47d 100644 --- a/application/views/RosterListView.cpp +++ b/application/views/RosterListView.cpp @@ -6,18 +6,19 @@ * Pier Luigi Fiorini, pierluigi.fiorini@gmail.com */ -#include -#include +#include "RosterListView.h" #include #include #include #include +#include +#include + #include "ContactInfoWindow.h" #include "ContactLinker.h" #include "RosterItem.h" -#include "RosterListView.h" const int32 kGetInfo = 'GINF'; const int32 kShowLogs = 'SHLG'; diff --git a/application/views/SearchBarTextControl.cpp.bak b/application/views/SearchBarTextControl.cpp.bak deleted file mode 100644 index d73baba..0000000 --- a/application/views/SearchBarTextControl.cpp.bak +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2012, Dario Casalinuovo. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Dario Casalinuovo, dario.casalinuovo@gmail.com - */ - -#include "CayaConstants.h" -#include "SearchBarTextControl.h" - -#include -#include -#include - -#include - -const char* kSearchText = "Search..."; - - -SearchBarTextControl::SearchBarTextControl(BMessage* message) - : - BTextControl("searchBox", NULL, NULL, message) -{ - //SetEventMask(B_POINTER_EVENTS); - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - rgb_color color = tint_color(ViewColor(), B_DARKEN_1_TINT); - SetText(kSearchText); - TextView()->SetName("SearchBoxTextView"); - TextView()->SetFontAndColor(NULL, B_FONT_ALL, &color); - TextView()->MakeSelectable(false); -} - - -void -SearchBarTextControl::MouseDown(BPoint position) -{ - BString text(Text()); - BPoint currentPosition; - uint32 buttons; - GetMouse(¤tPosition, &buttons); - BView* view = Window()->FindView(currentPosition); - if (view != NULL) { - if (view->Name() == TextView()->Name() - || view->Name() == Name()) { - //TextView()->Select(0,0); - if (TextView()->IsFocus()) { - SetText(""); - printf("mouse down\n"); - BTextControl::MouseDown(position); - } - } - } - if (!TextView()->IsFocus()) { - printf("is not focus\n"); - BView* buddyView = Window()->FindView("buddyView"); - if (text.Length() == 0 || text == kSearchText - || !buddyView->IsFocus()) - SetText(kSearchText); - } -} - - -void -SearchBarTextControl::KeyDown(const char* bytes, int32 numBytes) -{ - if (TextView()->IsFocus()) { - if (Text() == kSearchText) - SetText(""); - - BTextControl::KeyDown(bytes, numBytes); - BString text(Text()); - if (TextView()->IsFocus() && text.Length() > 0) { - BMessage* msg = ModificationMessage(); - msg->AddPointer("source", this); - Window()->MessageReceived(msg); - } - } -}