* The spacing was hard coded to 3 since r36405 which made the whole thing look
poorly with the default font size, I wonder why no one noticed that before applying. * This also hid some bugs in the layouting code causing the doubled spacing to be used. * Fixed some weird layout in FileTypeWindow. * Changed some code to BLayoutBuilder in a few cases. * Made sure the list views have a better default size, and resize with the window. * Removed superfluous checks if be_control_look is NULL. * Enlarged the icon size in the main window to 48 pixels. * I've worked around some strange resizing in the ApplicationTypesWindow by setting a max size for the list view. Also, setting a max limit for the BStringView on the right side had no effect on layouting (only the text was cut). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36882 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Axel Dörfler, [email protected]. All rights reserved.
|
3 * Copyright 2006-2010, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -245,13 +245,8 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
|
|||||||
B_FRAME_EVENTS | B_AUTO_UPDATE_SIZE_LIMITS),
|
B_FRAME_EVENTS | B_AUTO_UPDATE_SIZE_LIMITS),
|
||||||
fChangedProperties(0)
|
fChangedProperties(0)
|
||||||
{
|
{
|
||||||
float padding = 3.0f;
|
float padding = be_control_look->DefaultItemSpacing();
|
||||||
BAlignment labelAlignment = BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP);
|
BAlignment labelAlignment = be_control_look->DefaultLabelAlignment();
|
||||||
if (be_control_look){
|
|
||||||
// padding = be_control_look->DefaultItemSpacing();
|
|
||||||
// seems too big
|
|
||||||
labelAlignment = be_control_look->DefaultLabelAlignment();
|
|
||||||
}
|
|
||||||
|
|
||||||
BMenuBar* menuBar = new BMenuBar((char*)NULL);
|
BMenuBar* menuBar = new BMenuBar((char*)NULL);
|
||||||
menuBar->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP));
|
menuBar->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP));
|
||||||
@@ -271,7 +266,6 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
|
|||||||
new BMessage(B_QUIT_REQUESTED), 'W', B_COMMAND_KEY));
|
new BMessage(B_QUIT_REQUESTED), 'W', B_COMMAND_KEY));
|
||||||
menuBar->AddItem(menu);
|
menuBar->AddItem(menu);
|
||||||
|
|
||||||
|
|
||||||
// Signature
|
// Signature
|
||||||
|
|
||||||
fSignatureControl = new BTextControl(B_TRANSLATE("Signature:"), NULL,
|
fSignatureControl = new BTextControl(B_TRANSLATE("Signature:"), NULL,
|
||||||
@@ -310,7 +304,7 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
|
|||||||
fBackgroundAppCheckBox = new BCheckBox("background",
|
fBackgroundAppCheckBox = new BCheckBox("background",
|
||||||
B_TRANSLATE("Background app"), new BMessage(kMsgAppFlagsChanged));
|
B_TRANSLATE("Background app"), new BMessage(kMsgAppFlagsChanged));
|
||||||
|
|
||||||
flagsBox->AddChild(BGridLayoutBuilder(padding, padding)
|
flagsBox->AddChild(BGridLayoutBuilder()
|
||||||
.Add(fSingleLaunchButton, 0, 0).Add(fArgsOnlyCheckBox, 1, 0)
|
.Add(fSingleLaunchButton, 0, 0).Add(fArgsOnlyCheckBox, 1, 0)
|
||||||
.Add(fMultipleLaunchButton, 0, 1).Add(fBackgroundAppCheckBox, 1, 1)
|
.Add(fMultipleLaunchButton, 0, 1).Add(fBackgroundAppCheckBox, 1, 1)
|
||||||
.Add(fExclusiveLaunchButton, 0, 2)
|
.Add(fExclusiveLaunchButton, 0, 2)
|
||||||
@@ -323,11 +317,9 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
|
|||||||
iconBox->SetLabel(B_TRANSLATE("Icon"));
|
iconBox->SetLabel(B_TRANSLATE("Icon"));
|
||||||
fIconView = new IconView("icon");
|
fIconView = new IconView("icon");
|
||||||
fIconView->SetModificationMessage(new BMessage(kMsgIconChanged));
|
fIconView->SetModificationMessage(new BMessage(kMsgIconChanged));
|
||||||
iconBox->AddChild(
|
iconBox->AddChild(BGroupLayoutBuilder(B_HORIZONTAL)
|
||||||
BGroupLayoutBuilder(B_HORIZONTAL)
|
|
||||||
.Add(fIconView)
|
.Add(fIconView)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
);
|
|
||||||
|
|
||||||
// "Supported Types" group
|
// "Supported Types" group
|
||||||
|
|
||||||
@@ -359,9 +351,9 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
|
|||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding)
|
||||||
.SetColumnWeight(0, 3)
|
.SetColumnWeight(0, 3)
|
||||||
.SetColumnWeight(1, 2)
|
.SetColumnWeight(1, 2)
|
||||||
.SetColumnWeight(2, 1)
|
.SetColumnWeight(2, 1));
|
||||||
);
|
iconHolder->SetExplicitAlignment(
|
||||||
iconHolder->SetExplicitAlignment(BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));
|
BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));
|
||||||
|
|
||||||
// "Version Info" group
|
// "Version Info" group
|
||||||
|
|
||||||
@@ -409,10 +401,10 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
|
|||||||
|
|
||||||
// TODO: remove workaround (bug #5678)
|
// TODO: remove workaround (bug #5678)
|
||||||
BSize minScrollSize = scrollView->ScrollBar(B_VERTICAL)->MinSize();
|
BSize minScrollSize = scrollView->ScrollBar(B_VERTICAL)->MinSize();
|
||||||
minScrollSize.width+=fLongDescriptionView->MinSize().width;
|
minScrollSize.width += fLongDescriptionView->MinSize().width;
|
||||||
scrollView->SetExplicitMinSize(minScrollSize);
|
scrollView->SetExplicitMinSize(minScrollSize);
|
||||||
|
|
||||||
versionBox->AddChild(BGridLayoutBuilder(padding, padding)
|
versionBox->AddChild(BGridLayoutBuilder(padding / 2, padding)
|
||||||
.Add(fMajorVersionControl->CreateLabelLayoutItem(), 0, 0)
|
.Add(fMajorVersionControl->CreateLabelLayoutItem(), 0, 0)
|
||||||
.Add(fMajorVersionControl->CreateTextViewLayoutItem(), 1, 0)
|
.Add(fMajorVersionControl->CreateTextViewLayoutItem(), 1, 0)
|
||||||
.Add(fMiddleVersionControl, 2, 0, 2)
|
.Add(fMiddleVersionControl, 2, 0, 2)
|
||||||
@@ -424,8 +416,7 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
|
|||||||
.Add(longLabel, 0, 2)
|
.Add(longLabel, 0, 2)
|
||||||
.Add(scrollView, 1, 2, 10, 3)
|
.Add(scrollView, 1, 2, 10, 3)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding)
|
||||||
.SetRowWeight(3, 3)
|
.SetRowWeight(3, 3));
|
||||||
);
|
|
||||||
|
|
||||||
// put it all together
|
// put it all together
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
@@ -434,12 +425,10 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
|
|||||||
.Add(fSignatureControl)
|
.Add(fSignatureControl)
|
||||||
.Add(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
.Add(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
||||||
.Add(flagsBox, 3)
|
.Add(flagsBox, 3)
|
||||||
.Add(iconBox, 1)
|
.Add(iconBox, 1))
|
||||||
)
|
|
||||||
.Add(typeBox)
|
.Add(typeBox)
|
||||||
.Add(versionBox)
|
.Add(versionBox)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
);
|
|
||||||
|
|
||||||
SetKeyMenuBar(menuBar);
|
SetKeyMenuBar(menuBar);
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2006-2010, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO: think about adopting Tracker's info window style here (pressable path)
|
|
||||||
|
|
||||||
#include "ApplicationTypesWindow.h"
|
#include "ApplicationTypesWindow.h"
|
||||||
#include "FileTypes.h"
|
#include "FileTypes.h"
|
||||||
@@ -20,6 +19,7 @@
|
|||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
#include <GridLayoutBuilder.h>
|
#include <GridLayoutBuilder.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
|
#include <LayoutBuilder.h>
|
||||||
#include <Locale.h>
|
#include <Locale.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
@@ -40,13 +40,17 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: think about adopting Tracker's info window style here (pressable path)
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
#undef B_TRANSLATE_CONTEXT
|
||||||
#define B_TRANSLATE_CONTEXT "Application Types Window"
|
#define B_TRANSLATE_CONTEXT "Application Types Window"
|
||||||
|
|
||||||
|
|
||||||
class ProgressWindow : public BWindow {
|
class ProgressWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
ProgressWindow(const char* message, int32 max, volatile bool* signalQuit);
|
ProgressWindow(const char* message, int32 max,
|
||||||
|
volatile bool* signalQuit);
|
||||||
virtual ~ProgressWindow();
|
virtual ~ProgressWindow();
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
@@ -166,23 +170,19 @@ ApplicationTypesWindow::ApplicationTypesWindow(const BMessage& settings)
|
|||||||
B_TITLED_WINDOW,
|
B_TITLED_WINDOW,
|
||||||
B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS)
|
B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS)
|
||||||
{
|
{
|
||||||
|
float padding = be_control_look->DefaultItemSpacing();
|
||||||
float padding = 3.0f;
|
BAlignment labelAlignment = be_control_look->DefaultLabelAlignment();
|
||||||
BAlignment labelAlignment = BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP);
|
BAlignment fullWidthTopAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_TOP);
|
||||||
BAlignment fullWidthTopAlignment =
|
|
||||||
BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_TOP);
|
|
||||||
if (be_control_look) {
|
|
||||||
// padding = be_control_look->DefaultItemSpacing();
|
|
||||||
// seems too big
|
|
||||||
labelAlignment = be_control_look->DefaultLabelAlignment();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Application list
|
// Application list
|
||||||
BView* currentView = new BGroupView(B_VERTICAL, padding);
|
|
||||||
|
|
||||||
fTypeListView = new MimeTypeListView("listview", "application", true, true);
|
fTypeListView = new MimeTypeListView("listview", "application", true, true);
|
||||||
fTypeListView->SetSelectionMessage(new BMessage(kMsgTypeSelected));
|
fTypeListView->SetSelectionMessage(new BMessage(kMsgTypeSelected));
|
||||||
fTypeListView->SetInvocationMessage(new BMessage(kMsgTypeInvoked));
|
fTypeListView->SetInvocationMessage(new BMessage(kMsgTypeInvoked));
|
||||||
|
// TODO: this isn't the perfect solution, but otherwise the window contents
|
||||||
|
// will jump chaotically
|
||||||
|
fTypeListView->SetExplicitMinSize(BSize(200, B_SIZE_UNSET));
|
||||||
|
fTypeListView->SetExplicitMaxSize(BSize(250, B_SIZE_UNSET));
|
||||||
|
|
||||||
BScrollView* scrollView = new BScrollView("scrollview", fTypeListView,
|
BScrollView* scrollView = new BScrollView("scrollview", fTypeListView,
|
||||||
B_FRAME_EVENTS | B_WILL_DRAW, false, true);
|
B_FRAME_EVENTS | B_WILL_DRAW, false, true);
|
||||||
@@ -208,16 +208,14 @@ ApplicationTypesWindow::ApplicationTypesWindow(const BMessage& settings)
|
|||||||
fPathView->TextView()->SetExplicitAlignment(labelAlignment);
|
fPathView->TextView()->SetExplicitAlignment(labelAlignment);
|
||||||
fPathView->LabelView()->SetExplicitAlignment(labelAlignment);
|
fPathView->LabelView()->SetExplicitAlignment(labelAlignment);
|
||||||
|
|
||||||
infoBox->AddChild(
|
infoBox->AddChild(BGridLayoutBuilder(padding, padding)
|
||||||
BGridLayoutBuilder(padding, padding)
|
.Add(fNameView->LabelView(), 0, 0)
|
||||||
.Add(fNameView->LabelView(), 0, 0)
|
.Add(fNameView->TextView(), 1, 0, 2)
|
||||||
.Add(fNameView->TextView(), 1, 0, 2)
|
.Add(fSignatureView->LabelView(), 0, 1)
|
||||||
.Add(fSignatureView->LabelView(), 0, 1)
|
.Add(fSignatureView->TextView(), 1, 1, 2)
|
||||||
.Add(fSignatureView->TextView(), 1, 1, 2)
|
.Add(fPathView->LabelView(), 0, 2)
|
||||||
.Add(fPathView->LabelView(), 0, 2)
|
.Add(fPathView->TextView(), 1, 2, 2)
|
||||||
.Add(fPathView->TextView(), 1, 2, 2)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
.SetInsets(padding, padding, padding, padding)
|
|
||||||
);
|
|
||||||
|
|
||||||
// "Version" group
|
// "Version" group
|
||||||
|
|
||||||
@@ -235,15 +233,12 @@ ApplicationTypesWindow::ApplicationTypesWindow(const BMessage& settings)
|
|||||||
fDescriptionView->SetLowColor(fDescriptionView->ViewColor());
|
fDescriptionView->SetLowColor(fDescriptionView->ViewColor());
|
||||||
fDescriptionView->MakeEditable(false);
|
fDescriptionView->MakeEditable(false);
|
||||||
|
|
||||||
versionBox->AddChild(currentView =
|
versionBox->AddChild(BGridLayoutBuilder(padding, padding)
|
||||||
BGridLayoutBuilder(padding, padding)
|
.Add(fVersionView->LabelView(), 0, 0)
|
||||||
.Add(fVersionView->LabelView(), 0, 0)
|
.Add(fVersionView->TextView(), 1, 0)
|
||||||
.Add(fVersionView->TextView(), 1, 0)
|
.Add(fDescriptionLabel->LabelView(), 0, 1)
|
||||||
.Add(fDescriptionLabel->LabelView(), 0, 1)
|
.Add(fDescriptionView, 1, 1, 2, 2)
|
||||||
.Add(fDescriptionView, 1, 1, 2, 2)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
.SetInsets(padding, padding, padding, padding)
|
|
||||||
);
|
|
||||||
currentView->SetExplicitAlignment(fullWidthTopAlignment);
|
|
||||||
|
|
||||||
// Launch and Tracker buttons
|
// Launch and Tracker buttons
|
||||||
|
|
||||||
@@ -254,25 +249,27 @@ ApplicationTypesWindow::ApplicationTypesWindow(const BMessage& settings)
|
|||||||
fTrackerButton = new BButton(
|
fTrackerButton = new BButton(
|
||||||
B_TRANSLATE("Show in Tracker" B_UTF8_ELLIPSIS));
|
B_TRANSLATE("Show in Tracker" B_UTF8_ELLIPSIS));
|
||||||
|
|
||||||
AddChild(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, padding)
|
||||||
.Add(BGroupLayoutBuilder(B_VERTICAL, padding)
|
.AddGroup(B_VERTICAL, padding, 3)
|
||||||
.Add(scrollView)
|
.Add(scrollView)
|
||||||
.Add(button)
|
.AddGroup(B_HORIZONTAL)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.Add(button)
|
||||||
, 3)
|
.AddGlue()
|
||||||
.Add(BGroupLayoutBuilder(B_VERTICAL, padding)
|
.End()
|
||||||
|
.End()
|
||||||
|
// .AddGlue())//, 3)
|
||||||
|
.AddGroup(B_VERTICAL, padding)
|
||||||
.Add(infoBox)
|
.Add(infoBox)
|
||||||
.Add(versionBox)
|
.Add(versionBox)
|
||||||
.Add(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
.AddGroup(B_HORIZONTAL, padding)
|
||||||
|
.AddGlue()
|
||||||
.Add(fEditButton)
|
.Add(fEditButton)
|
||||||
.Add(fLaunchButton)
|
.Add(fLaunchButton)
|
||||||
.Add(fTrackerButton)
|
.Add(fTrackerButton)
|
||||||
)
|
.End()
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.End()
|
||||||
)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
.SetInsets(padding, padding, padding, padding)
|
|
||||||
);
|
|
||||||
|
|
||||||
BMimeType::StartWatching(this);
|
BMimeType::StartWatching(this);
|
||||||
_SetType(NULL);
|
_SetType(NULL);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2007, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2006-2010, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -102,9 +102,7 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
|
|||||||
fTarget(target),
|
fTarget(target),
|
||||||
fMimeType(mimeType.Type())
|
fMimeType(mimeType.Type())
|
||||||
{
|
{
|
||||||
float padding = 3.0f;
|
float padding = be_control_look->DefaultItemSpacing();
|
||||||
//if (be_control_look)
|
|
||||||
//padding = be_control_look->DefaultItemSpacing();
|
|
||||||
|
|
||||||
if (attributeItem != NULL)
|
if (attributeItem != NULL)
|
||||||
fAttribute = *attributeItem;
|
fAttribute = *attributeItem;
|
||||||
@@ -162,7 +160,8 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
|
|||||||
item = new BMenuItem(kDisplayAsMap[i].name, message);
|
item = new BMenuItem(kDisplayAsMap[i].name, message);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
if (compare_display_as(kDisplayAsMap[i].identifier, fAttribute.DisplayAs()))
|
if (compare_display_as(kDisplayAsMap[i].identifier,
|
||||||
|
fAttribute.DisplayAs()))
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,8 +229,8 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
|
|||||||
B_TRANSLATE("Alignment:"), menu);
|
B_TRANSLATE("Alignment:"), menu);
|
||||||
fAlignmentMenuField->SetAlignment(B_ALIGN_RIGHT);
|
fAlignmentMenuField->SetAlignment(B_ALIGN_RIGHT);
|
||||||
|
|
||||||
fAcceptButton = new BButton("add", item
|
fAcceptButton = new BButton("add",
|
||||||
? B_TRANSLATE("Done") : B_TRANSLATE("Add"),
|
item ? B_TRANSLATE("Done") : B_TRANSLATE("Add"),
|
||||||
new BMessage(kMsgAccept));
|
new BMessage(kMsgAccept));
|
||||||
fAcceptButton->SetEnabled(false);
|
fAcceptButton->SetEnabled(false);
|
||||||
|
|
||||||
@@ -242,16 +241,15 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
|
|||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, padding)
|
AddChild(BGroupLayoutBuilder(B_VERTICAL, padding)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding)
|
||||||
.Add(BGridLayoutBuilder(padding, padding)
|
.Add(BGridLayoutBuilder(padding, padding / 2)
|
||||||
.Add(fPublicNameControl->CreateLabelLayoutItem(), 0, 0)
|
.Add(fPublicNameControl->CreateLabelLayoutItem(), 0, 0)
|
||||||
.Add(fPublicNameControl->CreateTextViewLayoutItem(), 1, 0)
|
.Add(fPublicNameControl->CreateTextViewLayoutItem(), 1, 0)
|
||||||
.Add(fAttributeControl->CreateLabelLayoutItem(), 0, 1)
|
.Add(fAttributeControl->CreateLabelLayoutItem(), 0, 1)
|
||||||
.Add(fAttributeControl->CreateTextViewLayoutItem(), 1, 1)
|
.Add(fAttributeControl->CreateTextViewLayoutItem(), 1, 1)
|
||||||
.Add(typeMenuField->CreateLabelLayoutItem(), 0, 2)
|
.Add(typeMenuField->CreateLabelLayoutItem(), 0, 2)
|
||||||
.Add(typeMenuField->CreateMenuBarLayoutItem(), 1, 2)
|
.Add(typeMenuField->CreateMenuBarLayoutItem(), 1, 2))
|
||||||
)
|
|
||||||
.Add(visibleBox = new BBox(B_FANCY_BORDER,
|
.Add(visibleBox = new BBox(B_FANCY_BORDER,
|
||||||
BGridLayoutBuilder(padding, padding)
|
BGridLayoutBuilder(padding, padding / 2)
|
||||||
.Add(fDisplayAsMenuField->CreateLabelLayoutItem(), 0, 0)
|
.Add(fDisplayAsMenuField->CreateLabelLayoutItem(), 0, 0)
|
||||||
.Add(fDisplayAsMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
.Add(fDisplayAsMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
||||||
.Add(fEditableCheckBox, 3, 0)
|
.Add(fEditableCheckBox, 3, 0)
|
||||||
@@ -261,15 +259,12 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
|
|||||||
.Add(fWidthControl->CreateTextViewLayoutItem(), 1, 2, 3)
|
.Add(fWidthControl->CreateTextViewLayoutItem(), 1, 2, 3)
|
||||||
.Add(fAlignmentMenuField->CreateLabelLayoutItem(), 0, 3)
|
.Add(fAlignmentMenuField->CreateLabelLayoutItem(), 0, 3)
|
||||||
.Add(fAlignmentMenuField->CreateMenuBarLayoutItem(), 1, 3, 3)
|
.Add(fAlignmentMenuField->CreateMenuBarLayoutItem(), 1, 3, 3)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding)))
|
||||||
))
|
|
||||||
.Add(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
.Add(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
||||||
.Add(BSpaceLayoutItem::CreateGlue())
|
.Add(BSpaceLayoutItem::CreateGlue())
|
||||||
.Add(BSpaceLayoutItem::CreateGlue())
|
.Add(BSpaceLayoutItem::CreateGlue())
|
||||||
.Add(cancelButton)
|
.Add(cancelButton)
|
||||||
.Add(fAcceptButton)
|
.Add(fAcceptButton)));
|
||||||
)
|
|
||||||
);
|
|
||||||
visibleBox->SetLabel(fVisibleCheckBox);
|
visibleBox->SetLabel(fVisibleCheckBox);
|
||||||
|
|
||||||
fAcceptButton->MakeDefault(true);
|
fAcceptButton->MakeDefault(true);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2006-2010, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -122,10 +122,7 @@ ExtensionWindow::ExtensionWindow(FileTypesWindow* target, BMimeType& type,
|
|||||||
{
|
{
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
|
|
||||||
float padding = 3.0f;
|
float padding = be_control_look->DefaultItemSpacing();
|
||||||
//if (be_control_look)
|
|
||||||
// padding = be_control_look->DefaultItemSpacing();
|
|
||||||
// this seems to be very large!
|
|
||||||
|
|
||||||
fExtensionControl = new BTextControl(B_TRANSLATE("Extension:"),
|
fExtensionControl = new BTextControl(B_TRANSLATE("Extension:"),
|
||||||
extension, NULL);
|
extension, NULL);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2006-2010, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <GridLayoutBuilder.h>
|
#include <GridLayoutBuilder.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
|
#include <LayoutBuilder.h>
|
||||||
#include <Locale.h>
|
#include <Locale.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
@@ -55,10 +56,7 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs)
|
|||||||
B_NOT_V_RESIZABLE | B_NOT_ZOOMABLE
|
B_NOT_V_RESIZABLE | B_NOT_ZOOMABLE
|
||||||
| B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS)
|
| B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS)
|
||||||
{
|
{
|
||||||
float padding = 3.0f;
|
float padding = be_control_look->DefaultItemSpacing();
|
||||||
// if (be_control_look)
|
|
||||||
// padding = be_control_look->DefaultItemSpacing();
|
|
||||||
// too big!
|
|
||||||
|
|
||||||
// "File Type" group
|
// "File Type" group
|
||||||
BBox* fileTypeBox = new BBox("file type BBox");
|
BBox* fileTypeBox = new BBox("file type BBox");
|
||||||
@@ -84,8 +82,7 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs)
|
|||||||
.Add(fTypeControl, 0, 0, 2, 1)
|
.Add(fTypeControl, 0, 0, 2, 1)
|
||||||
.Add(fSelectTypeButton, 0, 1)
|
.Add(fSelectTypeButton, 0, 1)
|
||||||
.Add(fSameTypeAsButton, 1, 1)
|
.Add(fSameTypeAsButton, 1, 1)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
);
|
|
||||||
|
|
||||||
// "Icon" group
|
// "Icon" group
|
||||||
|
|
||||||
@@ -121,17 +118,15 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs)
|
|||||||
.Add(fPreferredField, 0, 0, 2, 1)
|
.Add(fPreferredField, 0, 0, 2, 1)
|
||||||
.Add(fSelectAppButton, 0, 1)
|
.Add(fSelectAppButton, 0, 1)
|
||||||
.Add(fSameAppAsButton, 1, 1)
|
.Add(fSameAppAsButton, 1, 1)
|
||||||
.Add(BSpaceLayoutItem::CreateGlue(), 3, 0, 1, 2)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
.SetInsets(padding, padding, padding, padding)
|
|
||||||
);
|
|
||||||
|
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
BLayoutBuilder::Group<>(this, B_HORIZONTAL, padding)
|
||||||
AddChild(BGridLayoutBuilder(padding, padding)
|
.AddGroup(B_VERTICAL, padding)
|
||||||
.Add(fileTypeBox, 0, 0, 1, 2)
|
.Add(fileTypeBox)
|
||||||
.Add(iconBox, 1, 1, 1, 2)
|
.Add(preferredBox)
|
||||||
.Add(preferredBox, 0, 2, 1, 2)
|
.End()
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding)
|
||||||
);
|
.Add(iconBox);
|
||||||
|
|
||||||
fTypeControl->MakeFocus(true);
|
fTypeControl->MakeFocus(true);
|
||||||
BMimeType::StartWatching(this);
|
BMimeType::StartWatching(this);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2006-2010, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -117,6 +117,7 @@ TypeIconView::TypeIconView(const char* name)
|
|||||||
: IconView(name)
|
: IconView(name)
|
||||||
{
|
{
|
||||||
ShowEmptyFrame(false);
|
ShowEmptyFrame(false);
|
||||||
|
SetIconSize(48);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -150,7 +151,8 @@ TypeIconView::Draw(BRect updateRect)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DISABLED_LABEL_TINT));
|
SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
||||||
|
B_DISABLED_LABEL_TINT));
|
||||||
SetLowColor(ViewColor());
|
SetLowColor(ViewColor());
|
||||||
|
|
||||||
font_height fontHeight;
|
font_height fontHeight;
|
||||||
@@ -218,7 +220,8 @@ TypeIconView::BitmapRect() const
|
|||||||
|
|
||||||
ExtensionListView::ExtensionListView(const char* name,
|
ExtensionListView::ExtensionListView(const char* name,
|
||||||
list_view_type type, uint32 flags)
|
list_view_type type, uint32 flags)
|
||||||
: DropTargetListView(name, type, flags)
|
:
|
||||||
|
DropTargetListView(name, type, flags)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +238,8 @@ ExtensionListView::MessageReceived(BMessage* message)
|
|||||||
// create extension list
|
// create extension list
|
||||||
BList list;
|
BList list;
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
for (int32 index = 0; message->FindRef("refs", index++, &ref) == B_OK; ) {
|
for (int32 index = 0; message->FindRef("refs", index, &ref) == B_OK;
|
||||||
|
index++) {
|
||||||
const char* point = strchr(ref.name, '.');
|
const char* point = strchr(ref.name, '.');
|
||||||
if (point != NULL && point[1])
|
if (point != NULL && point[1])
|
||||||
list.AddItem(strdup(++point));
|
list.AddItem(strdup(++point));
|
||||||
@@ -261,7 +265,8 @@ ExtensionListView::AcceptsDrag(const BMessage* message)
|
|||||||
int32 count = 0;
|
int32 count = 0;
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
|
|
||||||
for (int32 index = 0; message->FindRef("refs", index++, &ref) == B_OK; ) {
|
for (int32 index = 0; message->FindRef("refs", index, &ref) == B_OK;
|
||||||
|
index++) {
|
||||||
const char* point = strchr(ref.name, '.');
|
const char* point = strchr(ref.name, '.');
|
||||||
if (point != NULL && point[1])
|
if (point != NULL && point[1])
|
||||||
count++;
|
count++;
|
||||||
@@ -298,25 +303,20 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
|
|||||||
showRule = false;
|
showRule = false;
|
||||||
|
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
float padding = 3.0f;
|
|
||||||
BAlignment labelAlignment = BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP);
|
float padding = be_control_look->DefaultItemSpacing();
|
||||||
if (be_control_look) {
|
BAlignment labelAlignment = be_control_look->DefaultLabelAlignment();
|
||||||
// padding = be_control_look->DefaultItemSpacing();
|
BAlignment fullAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT);
|
||||||
// this seems to be very large!
|
|
||||||
labelAlignment = be_control_look->DefaultLabelAlignment();
|
|
||||||
}
|
|
||||||
BAlignment fullAlignment =
|
|
||||||
BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT);
|
|
||||||
|
|
||||||
// add the menu
|
// add the menu
|
||||||
BMenuBar* menuBar = new BMenuBar("");
|
BMenuBar* menuBar = new BMenuBar("");
|
||||||
|
|
||||||
BMenu* menu = new BMenu(B_TRANSLATE("File"));
|
BMenu* menu = new BMenu(B_TRANSLATE("File"));
|
||||||
BMenuItem* item;
|
BMenuItem* item = new BMenuItem(
|
||||||
menu->AddItem(item = new BMenuItem(
|
B_TRANSLATE("New resource file" B_UTF8_ELLIPSIS), NULL, 'N',
|
||||||
B_TRANSLATE("New resource file" B_UTF8_ELLIPSIS),
|
B_COMMAND_KEY);
|
||||||
NULL, 'N', B_COMMAND_KEY));
|
|
||||||
item->SetEnabled(false);
|
item->SetEnabled(false);
|
||||||
|
menu->AddItem(item);
|
||||||
|
|
||||||
BMenu* recentsMenu = BRecentFilesList::NewFileListMenu(
|
BMenu* recentsMenu = BRecentFilesList::NewFileListMenu(
|
||||||
B_TRANSLATE("Open" B_UTF8_ELLIPSIS), NULL, NULL,
|
B_TRANSLATE("Open" B_UTF8_ELLIPSIS), NULL, NULL,
|
||||||
@@ -365,6 +365,7 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
|
|||||||
|
|
||||||
fTypeListView = new MimeTypeListView("typeview", NULL, showIcons, false);
|
fTypeListView = new MimeTypeListView("typeview", NULL, showIcons, false);
|
||||||
fTypeListView->SetSelectionMessage(new BMessage(kMsgTypeSelected));
|
fTypeListView->SetSelectionMessage(new BMessage(kMsgTypeSelected));
|
||||||
|
fTypeListView->SetExplicitMinSize(BSize(200, B_SIZE_UNSET));
|
||||||
|
|
||||||
BScrollView* typeListScrollView = new BScrollView("scrollview",
|
BScrollView* typeListScrollView = new BScrollView("scrollview",
|
||||||
fTypeListView, B_FRAME_EVENTS | B_WILL_DRAW, false, true);
|
fTypeListView, B_FRAME_EVENTS | B_WILL_DRAW, false, true);
|
||||||
@@ -378,8 +379,7 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
|
|||||||
.Add(BSpaceLayoutItem::CreateGlue(), 1)
|
.Add(BSpaceLayoutItem::CreateGlue(), 1)
|
||||||
.Add(fIconView, 3)
|
.Add(fIconView, 3)
|
||||||
.Add(BSpaceLayoutItem::CreateGlue(), 1)
|
.Add(BSpaceLayoutItem::CreateGlue(), 1)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
);
|
|
||||||
|
|
||||||
// "File Recognition" group
|
// "File Recognition" group
|
||||||
|
|
||||||
@@ -392,6 +392,8 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
|
|||||||
|
|
||||||
fAddExtensionButton = new BButton("add ext",
|
fAddExtensionButton = new BButton("add ext",
|
||||||
B_TRANSLATE("Add" B_UTF8_ELLIPSIS), new BMessage(kMsgAddExtension));
|
B_TRANSLATE("Add" B_UTF8_ELLIPSIS), new BMessage(kMsgAddExtension));
|
||||||
|
fAddExtensionButton->SetExplicitMaxSize(
|
||||||
|
BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
||||||
|
|
||||||
fRemoveExtensionButton = new BButton("remove ext", B_TRANSLATE("Remove"),
|
fRemoveExtensionButton = new BButton("remove ext", B_TRANSLATE("Remove"),
|
||||||
new BMessage(kMsgRemoveExtension));
|
new BMessage(kMsgRemoveExtension));
|
||||||
@@ -411,14 +413,13 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
|
|||||||
fRuleControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
|
fRuleControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
|
||||||
fRuleControl->Hide();
|
fRuleControl->Hide();
|
||||||
|
|
||||||
BView* recognitionBoxGrid =
|
BView* recognitionBoxGrid = BGridLayoutBuilder(padding, padding / 2)
|
||||||
BGridLayoutBuilder(padding, padding)
|
.Add(fExtensionLabel->LabelView(), 0, 0)
|
||||||
.Add(fExtensionLabel->LabelView(), 0, 0)
|
.Add(scrollView, 0, 1, 2, 3)
|
||||||
.Add(scrollView, 0, 1, 2, 3)
|
.Add(fAddExtensionButton, 2, 1)
|
||||||
.Add(fAddExtensionButton, 2, 1)
|
.Add(fRemoveExtensionButton, 2, 2)
|
||||||
.Add(fRemoveExtensionButton, 2, 2)
|
.Add(fRuleControl, 0, 4, 3, 1)
|
||||||
.Add(fRuleControl, 0, 4, 3, 1)
|
.SetInsets(padding, padding, padding, padding);
|
||||||
.SetInsets(padding, padding, padding, padding);
|
|
||||||
|
|
||||||
recognitionBoxGrid->SetExplicitAlignment(fullAlignment);
|
recognitionBoxGrid->SetExplicitAlignment(fullAlignment);
|
||||||
fRecognitionBox->AddChild(recognitionBoxGrid);
|
fRecognitionBox->AddChild(recognitionBoxGrid);
|
||||||
@@ -436,16 +437,14 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
|
|||||||
fDescriptionControl = new BTextControl("description",
|
fDescriptionControl = new BTextControl("description",
|
||||||
B_TRANSLATE("Description:"), "", new BMessage(kMsgDescriptionEntered));
|
B_TRANSLATE("Description:"), "", new BMessage(kMsgDescriptionEntered));
|
||||||
|
|
||||||
fDescriptionBox->AddChild(BGridLayoutBuilder(padding, padding)
|
fDescriptionBox->AddChild(BGridLayoutBuilder(padding / 2, padding / 2)
|
||||||
.Add(fInternalNameView->LabelView(), 0, 0)
|
.Add(fInternalNameView->LabelView(), 0, 0)
|
||||||
.Add(fInternalNameView->TextView(), 1, 0)
|
.Add(fInternalNameView->TextView(), 1, 0)
|
||||||
.Add(fTypeNameControl->CreateLabelLayoutItem(), 0, 1)
|
.Add(fTypeNameControl->CreateLabelLayoutItem(), 0, 1)
|
||||||
.Add(fTypeNameControl->CreateTextViewLayoutItem(), 1, 1, 2)
|
.Add(fTypeNameControl->CreateTextViewLayoutItem(), 1, 1, 2)
|
||||||
.Add(fDescriptionControl->CreateLabelLayoutItem(), 0, 2)
|
.Add(fDescriptionControl->CreateLabelLayoutItem(), 0, 2)
|
||||||
.Add(fDescriptionControl->CreateTextViewLayoutItem(), 1, 2, 2)
|
.Add(fDescriptionControl->CreateTextViewLayoutItem(), 1, 2, 2)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// "Preferred Application" group
|
// "Preferred Application" group
|
||||||
|
|
||||||
@@ -466,20 +465,21 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
|
|||||||
B_TRANSLATE("Same as" B_UTF8_ELLIPSIS),
|
B_TRANSLATE("Same as" B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kMsgSamePreferredAppAs));
|
new BMessage(kMsgSamePreferredAppAs));
|
||||||
|
|
||||||
fPreferredBox->AddChild(
|
fPreferredBox->AddChild(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
||||||
BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
.Add(fPreferredField)
|
||||||
.Add(fPreferredField)
|
.Add(fSelectButton)
|
||||||
.Add(fSelectButton)
|
.Add(fSameAsButton)
|
||||||
.Add(fSameAsButton)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
.SetInsets(padding, padding, padding, padding)
|
|
||||||
);
|
|
||||||
|
|
||||||
// "Extra Attributes" group
|
// "Extra Attributes" group
|
||||||
|
|
||||||
fAttributeBox = new BBox("Attribute Box");
|
fAttributeBox = new BBox("Attribute Box");
|
||||||
fAttributeBox->SetLabel(B_TRANSLATE("Extra attributes"));
|
fAttributeBox->SetLabel(B_TRANSLATE("Extra attributes"));
|
||||||
|
|
||||||
fAddAttributeButton = new BButton("add attr",
|
fAddAttributeButton = new BButton("add attr",
|
||||||
"Add" B_UTF8_ELLIPSIS, new BMessage(kMsgAddAttribute));
|
"Add" B_UTF8_ELLIPSIS, new BMessage(kMsgAddAttribute));
|
||||||
|
fAddAttributeButton->SetExplicitMaxSize(
|
||||||
|
BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
||||||
|
|
||||||
fRemoveAttributeButton = new BButton("remove attr", B_TRANSLATE("Remove"),
|
fRemoveAttributeButton = new BButton("remove attr", B_TRANSLATE("Remove"),
|
||||||
new BMessage(kMsgRemoveAttribute));
|
new BMessage(kMsgRemoveAttribute));
|
||||||
@@ -493,32 +493,27 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
|
|||||||
BScrollView* attributesScroller = new BScrollView("scrollview attr",
|
BScrollView* attributesScroller = new BScrollView("scrollview attr",
|
||||||
fAttributeListView, B_FRAME_EVENTS | B_WILL_DRAW, false, true);
|
fAttributeListView, B_FRAME_EVENTS | B_WILL_DRAW, false, true);
|
||||||
|
|
||||||
fAttributeBox->AddChild(BGridLayoutBuilder(padding, padding)
|
fAttributeBox->AddChild(BGridLayoutBuilder(padding, padding / 2)
|
||||||
.Add(attributesScroller, 0, 0, 2, 3)
|
.Add(attributesScroller, 0, 0, 2, 3)
|
||||||
.Add(fAddAttributeButton, 2, 0)
|
.Add(fAddAttributeButton, 2, 0)
|
||||||
.Add(fRemoveAttributeButton, 2, 1)
|
.Add(fRemoveAttributeButton, 2, 1)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding));
|
||||||
);
|
|
||||||
|
|
||||||
|
BView* topView = BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
||||||
BView* topView =
|
|
||||||
BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding)
|
||||||
.Add(BGroupLayoutBuilder(B_VERTICAL, padding)
|
.Add(BGroupLayoutBuilder(B_VERTICAL, padding)
|
||||||
.Add(typeListScrollView)
|
.Add(typeListScrollView)
|
||||||
.Add(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
.Add(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
||||||
.Add(addTypeButton).Add(fRemoveTypeButton)
|
.Add(addTypeButton)
|
||||||
)
|
.Add(fRemoveTypeButton)
|
||||||
)
|
.AddGlue()))
|
||||||
// Right side
|
// Right side
|
||||||
.Add(BGroupLayoutBuilder(B_VERTICAL, padding)
|
.Add(BGroupLayoutBuilder(B_VERTICAL, padding)
|
||||||
.Add(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
.Add(BGroupLayoutBuilder(B_HORIZONTAL, padding)
|
||||||
.Add(fIconBox, 1).Add(fRecognitionBox, 3)
|
.Add(fIconBox, 1).Add(fRecognitionBox, 3))
|
||||||
)
|
|
||||||
.Add(fDescriptionBox)
|
.Add(fDescriptionBox)
|
||||||
.Add(fPreferredBox)
|
.Add(fPreferredBox)
|
||||||
.Add(fAttributeBox, 5)
|
.Add(fAttributeBox, 5));
|
||||||
);
|
|
||||||
|
|
||||||
//topView->SetExplicitAlignment(fullAlignment);
|
//topView->SetExplicitAlignment(fullAlignment);
|
||||||
//topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
//topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
* Copyright 2006-2010, Axel Dörfler, axeld@pinc-software.de.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -92,9 +92,7 @@ NewFileTypeWindow::NewFileTypeWindow(FileTypesWindow* target,
|
|||||||
fAddButton = new BButton(B_TRANSLATE("Add type"),
|
fAddButton = new BButton(B_TRANSLATE("Add type"),
|
||||||
new BMessage(kMsgAddType));
|
new BMessage(kMsgAddType));
|
||||||
|
|
||||||
float padding = 3.0f;
|
float padding = be_control_look->DefaultItemSpacing();
|
||||||
// if (be_control_look)
|
|
||||||
// padding = be_control_look->DefaultItemSpacing();
|
|
||||||
|
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
AddChild(BGridLayoutBuilder(padding, padding)
|
AddChild(BGridLayoutBuilder(padding, padding)
|
||||||
@@ -107,8 +105,7 @@ NewFileTypeWindow::NewFileTypeWindow(FileTypesWindow* target,
|
|||||||
.Add(new BButton(B_TRANSLATE("Cancel"),
|
.Add(new BButton(B_TRANSLATE("Cancel"),
|
||||||
new BMessage(B_QUIT_REQUESTED)), 1, 2)
|
new BMessage(B_QUIT_REQUESTED)), 1, 2)
|
||||||
.Add(fAddButton, 2, 2)
|
.Add(fAddButton, 2, 2)
|
||||||
.SetColumnWeight(0, 3)
|
.SetColumnWeight(0, 3));
|
||||||
);
|
|
||||||
|
|
||||||
BAlignment fullSize = BAlignment(B_ALIGN_USE_FULL_WIDTH,
|
BAlignment fullSize = BAlignment(B_ALIGN_USE_FULL_WIDTH,
|
||||||
B_ALIGN_USE_FULL_HEIGHT);
|
B_ALIGN_USE_FULL_HEIGHT);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
* Copyright 2006-2010, Axel Dörfler, axeld@pinc-software.de.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ const uint32 kMsgTypeSelected = 'tpsl';
|
|||||||
const uint32 kMsgSelected = 'seld';
|
const uint32 kMsgSelected = 'seld';
|
||||||
|
|
||||||
|
|
||||||
TypeListWindow::TypeListWindow(const char* currentType,
|
TypeListWindow::TypeListWindow(const char* currentType, uint32 what,
|
||||||
uint32 what, BWindow* target)
|
BWindow* target)
|
||||||
:
|
:
|
||||||
BWindow(BRect(100, 100, 360, 440), B_TRANSLATE("Choose type"),
|
BWindow(BRect(100, 100, 360, 440), B_TRANSLATE("Choose type"),
|
||||||
B_MODAL_WINDOW,
|
B_MODAL_WINDOW,
|
||||||
@@ -34,10 +34,7 @@ TypeListWindow::TypeListWindow(const char* currentType,
|
|||||||
fTarget(target),
|
fTarget(target),
|
||||||
fWhat(what)
|
fWhat(what)
|
||||||
{
|
{
|
||||||
float padding = 3.0f;
|
float padding = be_control_look->DefaultItemSpacing();
|
||||||
//if (be_control_look)
|
|
||||||
// padding = be_control_look->DefaultItemSpacing();
|
|
||||||
// seems too big
|
|
||||||
|
|
||||||
fSelectButton = new BButton("select", B_TRANSLATE("Done"),
|
fSelectButton = new BButton("select", B_TRANSLATE("Done"),
|
||||||
new BMessage(kMsgSelected));
|
new BMessage(kMsgSelected));
|
||||||
|
|||||||
Reference in New Issue
Block a user