DataTranslation: Style fixes
This commit is contained in:
@@ -52,9 +52,10 @@ const uint32 kMsgSelectedTranslator = 'trsl';
|
||||
|
||||
DataTranslationsWindow::DataTranslationsWindow()
|
||||
:
|
||||
BWindow(BRect(0, 0, 550, 350), B_TRANSLATE_SYSTEM_NAME("DataTranslations"),
|
||||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
|
||||
| B_NOT_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS),
|
||||
BWindow(BRect(0.0f, 0.0f, 550.0f, 350.0f),
|
||||
B_TRANSLATE_SYSTEM_NAME("DataTranslations"),
|
||||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE
|
||||
| B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
|
||||
fRelease(NULL)
|
||||
{
|
||||
MoveTo(DataTranslationsSettings::Instance()->WindowCorner());
|
||||
@@ -149,7 +150,7 @@ DataTranslationsWindow::_ShowConfigView(int32 id)
|
||||
|
||||
BTranslatorRoster* roster = BTranslatorRoster::Default();
|
||||
|
||||
if (fConfigView) {
|
||||
if (fConfigView != NULL) {
|
||||
fRightBox->RemoveChild(fConfigView);
|
||||
delete fConfigView;
|
||||
fConfigView = NULL;
|
||||
@@ -159,13 +160,13 @@ DataTranslationsWindow::_ShowConfigView(int32 id)
|
||||
}
|
||||
}
|
||||
|
||||
BMessage emptyMsg;
|
||||
BRect rect(0, 0, 200, 233);
|
||||
status_t ret = roster->MakeConfigurationView(id, &emptyMsg,
|
||||
BMessage emptyMessage;
|
||||
BRect rect(0.0f, 0.0f, 200.0f, 233.0f);
|
||||
status_t result = roster->MakeConfigurationView(id, &emptyMessage,
|
||||
&fConfigView, &rect);
|
||||
|
||||
if (ret != B_OK)
|
||||
return ret;
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
fConfigView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||
// force config views to all have the same color
|
||||
@@ -182,7 +183,7 @@ DataTranslationsWindow::_ShowConfigView(int32 id)
|
||||
void
|
||||
DataTranslationsWindow::_ShowInfoView()
|
||||
{
|
||||
if (fConfigView) {
|
||||
if (fConfigView != NULL) {
|
||||
fRightBox->RemoveChild(fConfigView);
|
||||
delete fConfigView;
|
||||
fConfigView = NULL;
|
||||
@@ -190,7 +191,6 @@ DataTranslationsWindow::_ShowInfoView()
|
||||
fRelease->Release();
|
||||
fRelease = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fInfoText = new BTextView("info text");
|
||||
@@ -232,7 +232,7 @@ DataTranslationsWindow::_SetupViews()
|
||||
// Box around the config and info panels
|
||||
fRightBox = new BBox("Right_Side");
|
||||
fRightBox->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH,
|
||||
B_ALIGN_USE_FULL_HEIGHT));
|
||||
B_ALIGN_USE_FULL_HEIGHT));
|
||||
|
||||
// Add the translator icon view
|
||||
fIconView = new IconView();
|
||||
@@ -361,19 +361,21 @@ DataTranslationsWindow::MessageReceived(BMessage* message)
|
||||
|
||||
case B_COLORS_UPDATED:
|
||||
{
|
||||
if (fInfoText == NULL
|
||||
|| fInfoText->Parent() == NULL)
|
||||
if (fInfoText == NULL || fInfoText->Parent() == NULL)
|
||||
break;
|
||||
|
||||
rgb_color color;
|
||||
if (message->FindColor(ui_color_name(B_PANEL_TEXT_COLOR), &color) == B_OK)
|
||||
if (message->FindColor(ui_color_name(B_PANEL_TEXT_COLOR), &color)
|
||||
== B_OK) {
|
||||
fInfoText->SetFontAndColor(be_plain_font, B_FONT_ALL, &color);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case B_TRANSLATOR_ADDED:
|
||||
{
|
||||
int32 index = 0, id;
|
||||
int32 index = 0;
|
||||
int32 id;
|
||||
while (message->FindInt32("translator_id", index++, &id) == B_OK) {
|
||||
const char* name;
|
||||
const char* info;
|
||||
@@ -389,7 +391,8 @@ DataTranslationsWindow::MessageReceived(BMessage* message)
|
||||
|
||||
case B_TRANSLATOR_REMOVED:
|
||||
{
|
||||
int32 index = 0, id;
|
||||
int32 index = 0;
|
||||
int32 id;
|
||||
while (message->FindInt32("translator_id", index++, &id) == B_OK) {
|
||||
for (int32 i = 0; i < fTranslatorListView->CountItems(); i++) {
|
||||
TranslatorItem* item = fTranslatorListView->TranslatorAt(i);
|
||||
|
||||
Reference in New Issue
Block a user