DataTranslations: use layout, standard format.
* Fix icns, ico. * Small fix. * Partialy fixes #11999.
This commit is contained in:
@@ -7,8 +7,8 @@
|
|||||||
#include "ICNSTranslator.h"
|
#include "ICNSTranslator.h"
|
||||||
|
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
|
#include <LayoutBuilder.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
#include <SpaceLayoutItem.h>
|
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -21,15 +21,9 @@ ConfigView::ConfigView(TranslatorSettings *settings)
|
|||||||
: BGroupView("ICNSTranslator Settings", B_VERTICAL, 0)
|
: BGroupView("ICNSTranslator Settings", B_VERTICAL, 0)
|
||||||
{
|
{
|
||||||
fSettings = settings;
|
fSettings = settings;
|
||||||
BAlignment leftAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET);
|
|
||||||
|
|
||||||
BStringView *stringView = new BStringView("title", B_TRANSLATE("Apple icon translator"));
|
BStringView *titleView = new BStringView("title", B_TRANSLATE("Apple icon translator"));
|
||||||
stringView->SetFont(be_bold_font);
|
titleView->SetFont(be_bold_font);
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
float spacing = be_control_look->DefaultItemSpacing();
|
|
||||||
AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
|
|
||||||
|
|
||||||
char version[256];
|
char version[256];
|
||||||
sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
|
sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
|
||||||
@@ -37,57 +31,40 @@ ConfigView::ConfigView(TranslatorSettings *settings)
|
|||||||
int(B_TRANSLATION_MINOR_VERSION(ICNS_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_MINOR_VERSION(ICNS_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_REVISION_VERSION(ICNS_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_REVISION_VERSION(ICNS_TRANSLATOR_VERSION)),
|
||||||
__DATE__);
|
__DATE__);
|
||||||
stringView = new BStringView("version", version);
|
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
stringView = new BStringView("copyright",
|
BStringView *versionView = new BStringView("version", version);
|
||||||
|
|
||||||
|
|
||||||
|
BStringView *copyrightView = new BStringView("copyright",
|
||||||
B_UTF8_COPYRIGHT "2005-2006 Haiku Inc.");
|
B_UTF8_COPYRIGHT "2005-2006 Haiku Inc.");
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
stringView = new BStringView("my_copyright",
|
BStringView *copyright2View = new BStringView("my_copyright",
|
||||||
B_UTF8_COPYRIGHT "2012 Gerasim Troeglazov <[email protected]>.");
|
B_UTF8_COPYRIGHT "2012 Gerasim Troeglazov <[email protected]>.");
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
|
BStringView *infoView = new BStringView("support_sizes",
|
||||||
|
|
||||||
stringView = new BStringView("support_sizes",
|
|
||||||
"Valid sizes: 16, 32, 48, 128, 256, 512, 1024");
|
"Valid sizes: 16, 32, 48, 128, 256, 512, 1024");
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
stringView = new BStringView("support_colors",
|
BStringView *info2View = new BStringView("support_colors",
|
||||||
"Valid colors: RGB32, RGBA32");
|
"Valid colors: RGB32, RGBA32");
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
|
|
||||||
|
|
||||||
BString copyrightText;
|
|
||||||
copyrightText << "libicns v0.8.1\n"
|
|
||||||
<< B_UTF8_COPYRIGHT "2001-2012 Mathew Eis <[email protected]>";
|
|
||||||
|
|
||||||
fCopyrightView = new BTextView("CopyrightLibs");
|
BStringView *copyright3View = new BStringView("copyright3",
|
||||||
fCopyrightView->SetExplicitAlignment(leftAlignment);
|
"libicns v0.8.1\n");
|
||||||
fCopyrightView->MakeEditable(false);
|
|
||||||
fCopyrightView->MakeResizable(true);
|
|
||||||
fCopyrightView->SetWordWrap(true);
|
|
||||||
fCopyrightView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
fCopyrightView->SetText(copyrightText.String());
|
|
||||||
fCopyrightView->SetExplicitMinSize(BSize(300,200));
|
|
||||||
|
|
||||||
BFont font;
|
BStringView *copyright4View = new BStringView("copyright4",
|
||||||
font.SetSize(font.Size() * 0.9);
|
"2001-2012 Mathew Eis <[email protected]>");
|
||||||
fCopyrightView->SetFontAndColor(&font, B_FONT_SIZE, NULL);
|
|
||||||
AddChild(fCopyrightView);
|
|
||||||
|
|
||||||
fCopyrightView->SetExplicitAlignment(leftAlignment);
|
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||||
|
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||||
AddChild(BSpaceLayoutItem::CreateGlue());
|
.Add(titleView)
|
||||||
GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
.Add(versionView)
|
||||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
|
.Add(copyrightView)
|
||||||
|
.Add(copyright2View)
|
||||||
|
.AddGlue()
|
||||||
|
.Add(infoView)
|
||||||
|
.Add(info2View)
|
||||||
|
.AddGlue()
|
||||||
|
.Add(copyright3View)
|
||||||
|
.Add(copyright4View);
|
||||||
|
|
||||||
SetExplicitPreferredSize(GroupLayout()->MinSize());
|
SetExplicitPreferredSize(GroupLayout()->MinSize());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <CheckBox.h>
|
#include <CheckBox.h>
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
#include <SpaceLayoutItem.h>
|
#include <LayoutBuilder.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -24,16 +24,9 @@ ConfigView::ConfigView()
|
|||||||
:
|
:
|
||||||
BGroupView(B_TRANSLATE("ICOTranslator Settings"), B_VERTICAL, 0)
|
BGroupView(B_TRANSLATE("ICOTranslator Settings"), B_VERTICAL, 0)
|
||||||
{
|
{
|
||||||
BAlignment leftAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET);
|
BStringView* titleView = new BStringView("title",
|
||||||
|
|
||||||
BStringView* stringView = new BStringView("title",
|
|
||||||
B_TRANSLATE("Windows icon translator"));
|
B_TRANSLATE("Windows icon translator"));
|
||||||
stringView->SetFont(be_bold_font);
|
titleView->SetFont(be_bold_font);
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
float spacing = be_control_look->DefaultItemSpacing();
|
|
||||||
AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
|
|
||||||
|
|
||||||
char version[256];
|
char version[256];
|
||||||
sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
|
sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
|
||||||
@@ -41,43 +34,37 @@ ConfigView::ConfigView()
|
|||||||
int(B_TRANSLATION_MINOR_VERSION(ICO_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_MINOR_VERSION(ICO_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_REVISION_VERSION(ICO_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_REVISION_VERSION(ICO_TRANSLATOR_VERSION)),
|
||||||
__DATE__);
|
__DATE__);
|
||||||
stringView = new BStringView("version", version);
|
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
stringView = new BStringView("copyright",
|
BStringView* versionView = new BStringView("version", version);
|
||||||
|
|
||||||
|
BStringView *copyrightView = new BStringView("copyright",
|
||||||
B_UTF8_COPYRIGHT "2005-2006 Haiku Inc.");
|
B_UTF8_COPYRIGHT "2005-2006 Haiku Inc.");
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
|
BCheckBox *colorCheckBox = new BCheckBox("color",
|
||||||
|
|
||||||
BCheckBox *checkBox = new BCheckBox("color",
|
|
||||||
B_TRANSLATE("Write 32 bit images on true color input"), NULL);
|
B_TRANSLATE("Write 32 bit images on true color input"), NULL);
|
||||||
checkBox->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(checkBox);
|
|
||||||
|
|
||||||
checkBox = new BCheckBox("size", B_TRANSLATE("Enforce valid icon sizes"),
|
BCheckBox *sizeCheckBox = new BCheckBox("size",
|
||||||
NULL);
|
B_TRANSLATE("Enforce valid icon sizes"), NULL);
|
||||||
checkBox->SetValue(1);
|
sizeCheckBox->SetValue(1);
|
||||||
checkBox->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(checkBox);
|
|
||||||
|
|
||||||
AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
|
BStringView* infoView = new BStringView("valid1",
|
||||||
|
|
||||||
stringView = new BStringView("valid1",
|
|
||||||
B_TRANSLATE("Valid icon sizes are 16, 32, or 48"));
|
B_TRANSLATE("Valid icon sizes are 16, 32, or 48"));
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
stringView = new BStringView("valid2",
|
BStringView* info2View = new BStringView("valid2",
|
||||||
B_TRANSLATE("pixels in either direction."));
|
B_TRANSLATE("pixels in either direction."));
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
AddChild(BSpaceLayoutItem::CreateGlue());
|
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||||
GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
|
.Add(titleView)
|
||||||
|
.AddStrut(B_USE_SMALL_SPACING)
|
||||||
|
.Add(versionView)
|
||||||
|
.Add(copyrightView)
|
||||||
|
.AddGlue()
|
||||||
|
.Add(colorCheckBox)
|
||||||
|
.Add(sizeCheckBox)
|
||||||
|
.Add(infoView)
|
||||||
|
.Add(info2View)
|
||||||
|
.AddGlue();
|
||||||
|
|
||||||
SetExplicitPreferredSize(GroupLayout()->MinSize());
|
SetExplicitPreferredSize(GroupLayout()->MinSize());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ ConfigView::ConfigView(TranslatorSettings* settings)
|
|||||||
|
|
||||||
BFont font;
|
BFont font;
|
||||||
GetFont(&font);
|
GetFont(&font);
|
||||||
SetExplicitPreferredSize(BSize((font.Size() * 433)/12, (font.Size() * 200)/12));
|
SetExplicitPreferredSize(BSize((font.Size() * 250)/12, (font.Size() * 350)/12));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user