3DRender prefernces: Remove image, add drop down.
* Add a drop down to force a rendering engine. * This is cosmetic and doesn't do anything (yet) * We actually are a preference panel now!
This commit is contained in:
parent
ab992e7851
commit
608a156784
@ -17,8 +17,6 @@ resource app_version {
|
||||
long_info = "3D Rendering ©2009-2012 Haiku, Inc."
|
||||
};
|
||||
|
||||
resource(1, "logo.png") #'PNG ' import "logo.png";
|
||||
|
||||
resource vector_icon {
|
||||
$"6E636966060500020006023B10B737F036BA1A993D466848C719BEBE20009192"
|
||||
$"92FFD5D5D5020016023900000000000000003EE0004AE00048E0005EF884C702"
|
||||
|
@ -17,7 +17,6 @@ local sources =
|
||||
ExtensionsList.cpp
|
||||
ExtensionsView.cpp
|
||||
InfoView.cpp
|
||||
LogoView.cpp
|
||||
;
|
||||
|
||||
Includes [ FGristFiles $(sources) ] : $(HAIKU_MESA_HEADERS_DEPENDENCY) ;
|
||||
|
@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009 Haiku Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Stephan Aßmus <superstippi@gmx.de>
|
||||
* Artur Wyszynski <harakash@gmail.com>
|
||||
*/
|
||||
|
||||
#include "LogoView.h"
|
||||
|
||||
#include <Bitmap.h>
|
||||
#include <GroupLayout.h>
|
||||
#include <Message.h>
|
||||
#include <TranslationUtils.h>
|
||||
#include <TranslatorFormats.h>
|
||||
|
||||
|
||||
LogoView::LogoView()
|
||||
:
|
||||
BView("LogoView", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE, NULL),
|
||||
fLogo(NULL)
|
||||
{
|
||||
SetViewColor(255, 255, 255);
|
||||
fLogo = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "logo.png");
|
||||
if (fLogo) {
|
||||
SetExplicitMinSize(
|
||||
BSize(fLogo->Bounds().Width(), fLogo->Bounds().Height() + 6));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LogoView::~LogoView()
|
||||
{
|
||||
delete fLogo;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LogoView::Draw(BRect update)
|
||||
{
|
||||
if (!fLogo)
|
||||
return;
|
||||
|
||||
BRect bounds(Bounds());
|
||||
BPoint placement;
|
||||
placement.x = (bounds.left + bounds.right - fLogo->Bounds().Width()) / 2;
|
||||
placement.y = (bounds.top + bounds.bottom - fLogo->Bounds().Height()) / 2;
|
||||
|
||||
DrawBitmap(fLogo, placement);
|
||||
rgb_color borderColor = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
||||
B_DARKEN_3_TINT);
|
||||
SetHighColor(borderColor);
|
||||
StrokeLine(bounds.LeftBottom(), bounds.RightBottom());
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LogoView::GetPreferredSize(float* _width, float* _height)
|
||||
{
|
||||
float width = 0.0;
|
||||
float height = 0.0;
|
||||
if (fLogo) {
|
||||
width = fLogo->Bounds().Width();
|
||||
height = fLogo->Bounds().Height();
|
||||
}
|
||||
if (_width)
|
||||
*_width = width;
|
||||
if (_height)
|
||||
*_height = height;
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009 Haiku Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Stephan Aßmus <superstippi@gmx.de>
|
||||
* Artur Wyszynski <harakash@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef LOGO_VIEW_H
|
||||
#define LOGO_VIEW_H
|
||||
|
||||
|
||||
#include <View.h>
|
||||
|
||||
class LogoView : public BView {
|
||||
public:
|
||||
LogoView();
|
||||
virtual ~LogoView();
|
||||
|
||||
virtual void Draw(BRect update);
|
||||
virtual void GetPreferredSize(float* _width, float* _height);
|
||||
|
||||
private:
|
||||
BBitmap* fLogo;
|
||||
};
|
||||
|
||||
#endif /* LOGO_VIEW_H */
|
@ -13,13 +13,13 @@
|
||||
|
||||
#include <GLView.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <MenuField.h>
|
||||
#include <SpaceLayoutItem.h>
|
||||
#include <TabView.h>
|
||||
|
||||
#include "CapabilitiesView.h"
|
||||
#include "ExtensionsView.h"
|
||||
#include "InfoView.h"
|
||||
#include "LogoView.h"
|
||||
|
||||
|
||||
OpenGLView::OpenGLView()
|
||||
@ -34,7 +34,21 @@ OpenGLView::OpenGLView()
|
||||
|
||||
glView->LockGL();
|
||||
|
||||
LogoView *logoView = new LogoView();
|
||||
BMenu* menu = new BMenu("Automatic");
|
||||
menu->SetRadioMode(true);
|
||||
menu->SetLabelFromMarked(true);
|
||||
menu->AddItem(new BMenuItem("Automatic",
|
||||
new BMessage(MENU_AUTO_MESSAGE)));
|
||||
menu->AddSeparatorItem();
|
||||
menu->AddItem(new BMenuItem("Force Software Rasterizer",
|
||||
new BMessage(MENU_SWRAST_MESSAGE)));
|
||||
menu->AddItem(new BMenuItem("Force Gallium Software Pipe",
|
||||
new BMessage(MENU_SWPIPE_MESSAGE)));
|
||||
menu->AddItem(new BMenuItem("Force Gallium LLVM Pipe",
|
||||
new BMessage(MENU_SWLLVM_MESSAGE)));
|
||||
BMenuField* menuField = new BMenuField("renderer",
|
||||
"3D Rendering Engine:", menu);
|
||||
menuField->SetEnabled(false);
|
||||
|
||||
BTabView *tabView = new BTabView("tab view", B_WIDTH_FROM_LABEL);
|
||||
tabView->AddTab(new InfoView());
|
||||
@ -45,12 +59,12 @@ OpenGLView::OpenGLView()
|
||||
|
||||
GroupLayout()->SetSpacing(0);
|
||||
BLayoutBuilder::Group<>(this)
|
||||
.SetInsets(0, 0, 0, 0)
|
||||
.Add(logoView)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
|
||||
.Add(menuField)
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.Add(tabView)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
|
||||
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,6 +13,13 @@
|
||||
|
||||
#include <GroupView.h>
|
||||
|
||||
|
||||
#define MENU_AUTO_MESSAGE 'auto'
|
||||
#define MENU_SWRAST_MESSAGE 'swrt'
|
||||
#define MENU_SWPIPE_MESSAGE 'swpi'
|
||||
#define MENU_SWLLVM_MESSAGE 'swll'
|
||||
|
||||
|
||||
class OpenGLView : public BGroupView {
|
||||
public:
|
||||
OpenGLView();
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
Loading…
Reference in New Issue
Block a user