hrev43715 adds 1 changeset to branch 'master' old head: ab992e7851d74b283caf076ce05f76d406e857c2 new head: 608a156784f3c31eaba3347277d09c659dd1fee9 ---------------------------------------------------------------------------- 608a156: 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! [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev43715 Commit: 608a156784f3c31eaba3347277d09c659dd1fee9 URL: http://cgit.haiku-os.org/haiku/commit/?id=608a156 Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Fri Feb 3 11:45:13 2012 UTC ---------------------------------------------------------------------------- 7 files changed, 27 insertions(+), 108 deletions(-) src/preferences/3drendering/3DRendering.rdef | 2 - src/preferences/3drendering/Jamfile | 1 - src/preferences/3drendering/LogoView.cpp | 71 ---------------------- src/preferences/3drendering/LogoView.h | 28 --------- src/preferences/3drendering/OpenGLView.cpp | 26 ++++++-- src/preferences/3drendering/OpenGLView.h | 7 ++ src/preferences/3drendering/logo.png | Bin 14773 -> 0 bytes ---------------------------------------------------------------------------- diff --git a/src/preferences/3drendering/3DRendering.rdef b/src/preferences/3drendering/3DRendering.rdef index f2539b1..b4aa908 100644 --- a/src/preferences/3drendering/3DRendering.rdef +++ b/src/preferences/3drendering/3DRendering.rdef @@ -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" diff --git a/src/preferences/3drendering/Jamfile b/src/preferences/3drendering/Jamfile index bed8510..bc3f07f 100644 --- a/src/preferences/3drendering/Jamfile +++ b/src/preferences/3drendering/Jamfile @@ -17,7 +17,6 @@ local sources = ExtensionsList.cpp ExtensionsView.cpp InfoView.cpp - LogoView.cpp ; Includes [ FGristFiles $(sources) ] : $(HAIKU_MESA_HEADERS_DEPENDENCY) ; diff --git a/src/preferences/3drendering/LogoView.cpp b/src/preferences/3drendering/LogoView.cpp deleted file mode 100644 index 4095ca3..0000000 --- a/src/preferences/3drendering/LogoView.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2009 Haiku Inc. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Stephan Aßmus <superstippi@xxxxxx> - * Artur Wyszynski <harakash@xxxxxxxxx> - */ - -#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; -} diff --git a/src/preferences/3drendering/LogoView.h b/src/preferences/3drendering/LogoView.h deleted file mode 100644 index 700f1df..0000000 --- a/src/preferences/3drendering/LogoView.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2009 Haiku Inc. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Stephan Aßmus <superstippi@xxxxxx> - * Artur Wyszynski <harakash@xxxxxxxxx> - */ - -#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 */ diff --git a/src/preferences/3drendering/OpenGLView.cpp b/src/preferences/3drendering/OpenGLView.cpp index fd676b3..3b34504 100644 --- a/src/preferences/3drendering/OpenGLView.cpp +++ b/src/preferences/3drendering/OpenGLView.cpp @@ -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); } diff --git a/src/preferences/3drendering/OpenGLView.h b/src/preferences/3drendering/OpenGLView.h index 58263df..479e3cd 100644 --- a/src/preferences/3drendering/OpenGLView.h +++ b/src/preferences/3drendering/OpenGLView.h @@ -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(); diff --git a/src/preferences/3drendering/logo.png b/src/preferences/3drendering/logo.png deleted file mode 100644 index 6f86548..0000000 Binary files a/src/preferences/3drendering/logo.png and /dev/null differ