Some style updates and fixed the layout code -- things look a *lot* better @ 12 point (and probably higher)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19538 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -342,66 +342,67 @@ class FolderConfig : public BView {
|
|||||||
"Partially download messages larger than",
|
"Partially download messages larger than",
|
||||||
"部分ダウンロードする");
|
"部分ダウンロードする");
|
||||||
|
|
||||||
view = new BMailFileConfigView(
|
fPathView = new BMailFileConfigView(MDR_DIALECT_CHOICE ("Location:","受信箱:"),
|
||||||
MDR_DIALECT_CHOICE ("Destination Folder:","受信箱:"),
|
"path",true,"/boot/home/mail/in");
|
||||||
"path",true,"/boot/home/mail/in");
|
fPathView->SetTo(settings,meta_data);
|
||||||
view->SetTo(settings,meta_data);
|
fPathView->ResizeToPreferred();
|
||||||
view->ResizeToPreferred();
|
|
||||||
|
BRect r(fPathView->Frame());
|
||||||
partial_box = new BCheckBox(BRect(view->Frame().left, view->Frame().bottom + 5,
|
r.OffsetBy(0,r.Height() + 5);
|
||||||
view->Frame().left + 18 + be_plain_font->StringWidth(partial_text),
|
fPartialBox = new BCheckBox(r, "size_if", partial_text, new BMessage('SIZF'));
|
||||||
view->Frame().bottom + 25), "size_if", partial_text, new BMessage('SIZF'));
|
fPartialBox->ResizeToPreferred();
|
||||||
size = new BTextControl(BRect(
|
|
||||||
view->Frame().left + 20 + be_plain_font->StringWidth(partial_text),
|
r = fPartialBox->Frame();
|
||||||
view->Frame().bottom + 5,
|
r.OffsetBy(17,r.Height() + 1);
|
||||||
view->Frame().left + 42 + be_plain_font->StringWidth(partial_text),
|
r.right = r.left + be_plain_font->StringWidth("0000") + 10;
|
||||||
view->Frame().bottom + 25), "size", "", "", NULL);
|
fSizeBox = new BTextControl(r, "size", "", "", NULL);
|
||||||
bytes_label = new BStringView(BRect(
|
|
||||||
view->Frame().left + 42 + be_plain_font->StringWidth(partial_text),
|
r.OffsetBy(r.Width() + 5,0);
|
||||||
view->Frame().bottom + 5, view->Frame().right,view->Frame().bottom+21),
|
fBytesLabel = new BStringView(r,"kb", "KB");
|
||||||
"kb", "KB");
|
AddChild(fBytesLabel);
|
||||||
AddChild(bytes_label);
|
fSizeBox->SetDivider(0);
|
||||||
size->SetDivider(0);
|
|
||||||
if (settings->HasInt32("size_limit")) {
|
if (settings->HasInt32("size_limit")) {
|
||||||
BString kb;
|
BString kb;
|
||||||
kb << int32(settings->FindInt32("size_limit")/1024);
|
kb << int32(settings->FindInt32("size_limit")/1024);
|
||||||
size->SetText(kb.String());
|
fSizeBox->SetText(kb.String());
|
||||||
partial_box->SetValue(B_CONTROL_ON);
|
fPartialBox->SetValue(B_CONTROL_ON);
|
||||||
} else
|
} else
|
||||||
size->SetEnabled(false);
|
fSizeBox->SetEnabled(false);
|
||||||
AddChild(view);
|
AddChild(fPathView);
|
||||||
SetViewColor(216,216,216);
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
AddChild(partial_box);
|
AddChild(fPartialBox);
|
||||||
AddChild(size);
|
AddChild(fSizeBox);
|
||||||
ResizeToPreferred();
|
ResizeToPreferred();
|
||||||
}
|
}
|
||||||
void MessageReceived(BMessage *msg) {
|
void MessageReceived(BMessage *msg) {
|
||||||
if (msg->what != 'SIZF')
|
if (msg->what != 'SIZF')
|
||||||
return BView::MessageReceived(msg);
|
return BView::MessageReceived(msg);
|
||||||
size->SetEnabled(partial_box->Value());
|
fSizeBox->SetEnabled(fPartialBox->Value());
|
||||||
}
|
}
|
||||||
void AttachedToWindow() {
|
void AttachedToWindow() {
|
||||||
partial_box->SetTarget(this);
|
fPartialBox->SetTarget(this);
|
||||||
|
fPartialBox->ResizeToPreferred();
|
||||||
}
|
}
|
||||||
void GetPreferredSize(float *width, float *height) {
|
void GetPreferredSize(float *width, float *height) {
|
||||||
view->GetPreferredSize(width,height);
|
fPathView->GetPreferredSize(width,height);
|
||||||
*height = partial_box->Frame().bottom + 5;
|
// *height = fPartialBox->Frame().bottom + 5;
|
||||||
*width = MAX(bytes_label->Frame().right + 5, *width) + 5;
|
*height = fBytesLabel->Frame().bottom + 5;
|
||||||
|
*width = MAX(fBytesLabel->Frame().right + 5, *width);
|
||||||
}
|
}
|
||||||
status_t Archive(BMessage *into, bool) const {
|
status_t Archive(BMessage *into, bool) const {
|
||||||
into->MakeEmpty();
|
into->MakeEmpty();
|
||||||
view->Archive(into);
|
fPathView->Archive(into);
|
||||||
if (partial_box->Value())
|
if (fPartialBox->Value())
|
||||||
into->AddInt32("size_limit",atoi(size->Text()) * 1024);
|
into->AddInt32("size_limit",atoi(fSizeBox->Text()) * 1024);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BMailFileConfigView *view;
|
BMailFileConfigView *fPathView;
|
||||||
BTextControl *size;
|
BTextControl *fSizeBox;
|
||||||
BCheckBox *partial_box;
|
BCheckBox *fPartialBox;
|
||||||
BStringView *bytes_label;
|
BStringView *fBytesLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
BView* instantiate_config_panel(BMessage *settings, BMessage *meta_data)
|
BView* instantiate_config_panel(BMessage *settings, BMessage *meta_data)
|
||||||
|
|||||||
Reference in New Issue
Block a user