DataTranslations: use layout, standard format.

* Fix jpeg, jpeg2000.
* Partialy fixes #11999.
This commit is contained in:
Janus
2015-04-24 08:20:03 +00:00
parent a2ddc1c06e
commit d9c440a536
2 changed files with 20 additions and 28 deletions
+11 -16
View File
@@ -438,10 +438,8 @@ TranslatorReadView::TranslatorReadView(const char* name,
if (fSettings->SetGetBool(JPEG_SET_SHOWREADWARNING, NULL)) if (fSettings->SetGetBool(JPEG_SET_SHOWREADWARNING, NULL))
fShowErrorBox->SetValue(B_CONTROL_ON); fShowErrorBox->SetValue(B_CONTROL_ON);
float padding = 5.0f; BLayoutBuilder::Group<>(this, B_VERTICAL)
.SetInsets(B_USE_DEFAULT_SPACING)
BLayoutBuilder::Group<>(this, B_VERTICAL, padding)
.SetInsets(padding)
.Add(fAlwaysRGB32) .Add(fAlwaysRGB32)
.Add(fPhotoshopCMYK) .Add(fPhotoshopCMYK)
.Add(fShowErrorBox) .Add(fShowErrorBox)
@@ -559,9 +557,8 @@ TranslatorWriteView::TranslatorWriteView(const char* name,
if (fSettings->SetGetBool(JPEG_SET_GRAY1_AS_RGB24)) if (fSettings->SetGetBool(JPEG_SET_GRAY1_AS_RGB24))
fGrayAsRGB24->SetValue(B_CONTROL_ON); fGrayAsRGB24->SetValue(B_CONTROL_ON);
float padding = 5.0f; BLayoutBuilder::Group<>(this, B_VERTICAL)
BLayoutBuilder::Group<>(this, B_VERTICAL, padding) .SetInsets(B_USE_DEFAULT_SPACING)
.SetInsets(padding)
.Add(fQualitySlider) .Add(fQualitySlider)
.Add(fSmoothingSlider) .Add(fSmoothingSlider)
.Add(fProgress) .Add(fProgress)
@@ -686,22 +683,20 @@ TranslatorAboutView::TranslatorAboutView(const char* name)
infoView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); infoView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
infoView->MakeEditable(false); infoView->MakeEditable(false);
float padding = 5.0f; BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
BLayoutBuilder::Group<>(this, B_VERTICAL, padding) .SetInsets(B_USE_DEFAULT_SPACING)
.SetInsets(padding) .Add(title)
.AddGroup(B_HORIZONTAL, padding) .Add(version)
.Add(title)
.Add(version)
.AddGlue()
.End()
.Add(infoView); .Add(infoView);
} }
TranslatorView::TranslatorView(const char* name, TranslatorSettings* settings) TranslatorView::TranslatorView(const char* name, TranslatorSettings* settings)
: :
BTabView(name) BTabView(name, B_WIDTH_FROM_LABEL)
{ {
SetBorder(B_NO_BORDER);
AddTab(new TranslatorWriteView(B_TRANSLATE("Write"), settings->Acquire())); AddTab(new TranslatorWriteView(B_TRANSLATE("Write"), settings->Acquire()));
AddTab(new TranslatorReadView(B_TRANSLATE("Read"), settings->Acquire())); AddTab(new TranslatorReadView(B_TRANSLATE("Read"), settings->Acquire()));
AddTab(new TranslatorAboutView(B_TRANSLATE("About"))); AddTab(new TranslatorAboutView(B_TRANSLATE("About")));
@@ -637,9 +637,8 @@ TranslatorWriteView::TranslatorWriteView(const char* name,
if (fSettings->SetGetBool(JP2_SET_JPC)) if (fSettings->SetGetBool(JP2_SET_JPC))
fCodeStreamOnly->SetValue(B_CONTROL_ON); fCodeStreamOnly->SetValue(B_CONTROL_ON);
float padding = 10.0f; BLayoutBuilder::Group<>(this, B_VERTICAL)
BLayoutBuilder::Group<>(this, B_VERTICAL, padding) .SetInsets(B_USE_DEFAULT_SPACING)
.SetInsets(padding)
.Add(fQualitySlider) .Add(fQualitySlider)
.Add(fGrayAsRGB24) .Add(fGrayAsRGB24)
.Add(fCodeStreamOnly) .Add(fCodeStreamOnly)
@@ -728,14 +727,10 @@ TranslatorAboutView::TranslatorAboutView(const char* name)
infoView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); infoView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
infoView->MakeEditable(false); infoView->MakeEditable(false);
float padding = 10.0f; BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
BLayoutBuilder::Group<>(this, B_VERTICAL, padding) .SetInsets(B_USE_DEFAULT_SPACING)
.SetInsets(padding) .Add(title)
.AddGroup(B_HORIZONTAL, padding) .Add(version)
.Add(title)
.Add(version)
.AddGlue()
.End()
.Add(infoView); .Add(infoView);
} }
@@ -745,8 +740,10 @@ TranslatorAboutView::TranslatorAboutView(const char* name)
TranslatorView::TranslatorView(const char* name, TranslatorSettings* settings) TranslatorView::TranslatorView(const char* name, TranslatorSettings* settings)
: :
BTabView(name) BTabView(name, B_WIDTH_FROM_LABEL)
{ {
SetBorder(B_NO_BORDER);
AddTab(new TranslatorWriteView(B_TRANSLATE("Write"), AddTab(new TranslatorWriteView(B_TRANSLATE("Write"),
settings->Acquire())); settings->Acquire()));
AddTab(new TranslatorReadView(B_TRANSLATE("Read"), AddTab(new TranslatorReadView(B_TRANSLATE("Read"),