The copyright line is now as large as the rest.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19135 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -37,12 +37,13 @@ GIFView::GIFView(BRect rect, const char *name)
|
|||||||
|
|
||||||
font_height fh;
|
font_height fh;
|
||||||
be_bold_font->GetHeight(&fh);
|
be_bold_font->GetHeight(&fh);
|
||||||
BRect r(10, 15, 10 + be_bold_font->StringWidth(translatorName), 15 + fh.ascent + fh.descent);
|
BRect r(10, 15, 10 + be_bold_font->StringWidth(translatorName),
|
||||||
|
15 + fh.ascent + fh.descent);
|
||||||
|
|
||||||
BStringView *title = new BStringView(r, "Title", translatorName);
|
BStringView *title = new BStringView(r, "Title", translatorName);
|
||||||
title->SetFont(be_bold_font);
|
title->SetFont(be_bold_font);
|
||||||
AddChild(title);
|
AddChild(title);
|
||||||
|
|
||||||
char version_string[100];
|
char version_string[100];
|
||||||
sprintf(version_string, "v%d.%d.%d %s", (int)(translatorVersion >> 8), (int)((translatorVersion >> 4) & 0xf),
|
sprintf(version_string, "v%d.%d.%d %s", (int)(translatorVersion >> 8), (int)((translatorVersion >> 4) & 0xf),
|
||||||
(int)(translatorVersion & 0xf), __DATE__);
|
(int)(translatorVersion & 0xf), __DATE__);
|
||||||
@@ -50,24 +51,22 @@ GIFView::GIFView(BRect rect, const char *name)
|
|||||||
r.bottom = r.top + fh.ascent + fh.descent;
|
r.bottom = r.top + fh.ascent + fh.descent;
|
||||||
r.left = r.right + 2.0 * r.Height();
|
r.left = r.right + 2.0 * r.Height();
|
||||||
r.right = r.left + be_plain_font->StringWidth(version_string);
|
r.right = r.left + be_plain_font->StringWidth(version_string);
|
||||||
|
|
||||||
BStringView *version = new BStringView(r, "Version", version_string);
|
BStringView *version = new BStringView(r, "Version", version_string);
|
||||||
version->SetFont(be_plain_font);
|
version->SetFont(be_plain_font);
|
||||||
AddChild(version);
|
AddChild(version);
|
||||||
|
|
||||||
BFont small(be_plain_font);
|
const char *copyrightString = "©2003 Daniel Switkin, [email protected]";
|
||||||
small.SetSize(max_c(7.0, small.Size() * 0.7));
|
|
||||||
const char *copyright_string = "© 2003 Daniel Switkin, [email protected]";
|
|
||||||
r.top = r.bottom + 5;
|
r.top = r.bottom + 5;
|
||||||
r.left = 10;
|
r.left = 10;
|
||||||
r.bottom = r.top + fh.ascent + fh.descent;
|
r.bottom = r.top + fh.ascent + fh.descent;
|
||||||
r.right = rect.right - 10;
|
r.right = rect.right - 10;
|
||||||
|
|
||||||
BStringView *copyright = new BStringView(r, "Copyright", copyright_string);
|
BStringView *copyright = new BStringView(r, "Copyright", copyrightString);
|
||||||
copyright->SetFont(&small);
|
copyright->ResizeToPreferred();
|
||||||
AddChild(copyright);
|
AddChild(copyright);
|
||||||
|
|
||||||
//menu fields (Palette & Colors)
|
// menu fields (Palette & Colors)
|
||||||
fWebSafeMI = new BMenuItem("Websafe", new BMessage(GV_WEB_SAFE), 0, 0);
|
fWebSafeMI = new BMenuItem("Websafe", new BMessage(GV_WEB_SAFE), 0, 0);
|
||||||
fBeOSSystemMI = new BMenuItem("BeOS System", new BMessage(GV_BEOS_SYSTEM), 0, 0);
|
fBeOSSystemMI = new BMenuItem("BeOS System", new BMessage(GV_BEOS_SYSTEM), 0, 0);
|
||||||
fGreyScaleMI = new BMenuItem("Greyscale", new BMessage(GV_GREYSCALE), 0, 0);
|
fGreyScaleMI = new BMenuItem("Greyscale", new BMessage(GV_GREYSCALE), 0, 0);
|
||||||
@@ -91,7 +90,7 @@ GIFView::GIFView(BRect rect, const char *name)
|
|||||||
}
|
}
|
||||||
fColorCount256MI = fColorCountMI[7];
|
fColorCount256MI = fColorCountMI[7];
|
||||||
|
|
||||||
r.top = r.bottom + 5;
|
r.top = r.bottom + 14;
|
||||||
r.bottom = r.top + 24;
|
r.bottom = r.top + 24;
|
||||||
fPaletteMF = new BMenuField(r, "PaletteMenuField", "Palette",
|
fPaletteMF = new BMenuField(r, "PaletteMenuField", "Palette",
|
||||||
fPaletteM, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
|
fPaletteM, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
|
||||||
@@ -102,7 +101,7 @@ GIFView::GIFView(BRect rect, const char *name)
|
|||||||
fColorCountMF = new BMenuField(r, "ColorCountMenuField", "Colors",
|
fColorCountMF = new BMenuField(r, "ColorCountMenuField", "Colors",
|
||||||
fColorCountM, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
|
fColorCountM, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
|
||||||
AddChild(fColorCountMF);
|
AddChild(fColorCountMF);
|
||||||
|
|
||||||
// align menu fields
|
// align menu fields
|
||||||
float maxLabelWidth = ceilf(max_c(be_plain_font->StringWidth("Colors"),
|
float maxLabelWidth = ceilf(max_c(be_plain_font->StringWidth("Colors"),
|
||||||
be_plain_font->StringWidth("Palette")));
|
be_plain_font->StringWidth("Palette")));
|
||||||
@@ -168,7 +167,7 @@ GIFView::GIFView(BRect rect, const char *name)
|
|||||||
BTextView *tr = fTransparentRedTC->TextView();
|
BTextView *tr = fTransparentRedTC->TextView();
|
||||||
BTextView *tg = fTransparentGreenTC->TextView();
|
BTextView *tg = fTransparentGreenTC->TextView();
|
||||||
BTextView *tb = fTransparentBlueTC->TextView();
|
BTextView *tb = fTransparentBlueTC->TextView();
|
||||||
|
|
||||||
for (uint32 x = 0; x < 256; x++) {
|
for (uint32 x = 0; x < 256; x++) {
|
||||||
if (x < '0' || x > '9') {
|
if (x < '0' || x > '9') {
|
||||||
tr->DisallowChar(x);
|
tr->DisallowChar(x);
|
||||||
@@ -176,17 +175,20 @@ GIFView::GIFView(BRect rect, const char *name)
|
|||||||
tb->DisallowChar(x);
|
tb->DisallowChar(x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RestorePrefs();
|
RestorePrefs();
|
||||||
|
|
||||||
|
if (copyright->Frame().right + 10 > Bounds().Width())
|
||||||
|
ResizeTo(copyright->Frame().right + 10, Bounds().Height());
|
||||||
}
|
}
|
||||||
|
|
||||||
// destructor
|
|
||||||
GIFView::~GIFView()
|
GIFView::~GIFView()
|
||||||
{
|
{
|
||||||
delete fPrefs;
|
delete fPrefs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RestorePrefs
|
|
||||||
void
|
void
|
||||||
GIFView::RestorePrefs()
|
GIFView::RestorePrefs()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user