From 8522ef247b89a52a01ddde1813911eb63108e7d9 Mon Sep 17 00:00:00 2001 From: Adam Hartford Date: Mon, 18 Jun 2012 23:35:10 +0000 Subject: [PATCH] Fixed minor UI issues in Screenshot (Ticket #8378) Signed-off-by: Alex Wilson --- src/apps/screenshot/Jamfile | 1 - src/apps/screenshot/PreviewView.cpp | 30 ------------------------ src/apps/screenshot/PreviewView.h | 21 ----------------- src/apps/screenshot/ScreenshotWindow.cpp | 8 ++++--- src/apps/screenshot/ScreenshotWindow.h | 3 +-- 5 files changed, 6 insertions(+), 57 deletions(-) delete mode 100644 src/apps/screenshot/PreviewView.cpp delete mode 100644 src/apps/screenshot/PreviewView.h diff --git a/src/apps/screenshot/Jamfile b/src/apps/screenshot/Jamfile index 32ccccd9fe..182e475ec2 100644 --- a/src/apps/screenshot/Jamfile +++ b/src/apps/screenshot/Jamfile @@ -7,7 +7,6 @@ UsePrivateHeaders interface ; Application Screenshot : ScreenshotApp.cpp ScreenshotWindow.cpp - PreviewView.cpp Utility.cpp : be $(HAIKU_LOCALE_LIBS) tracker translation $(TARGET_LIBSUPC++) : ScreenshotApp.rdef diff --git a/src/apps/screenshot/PreviewView.cpp b/src/apps/screenshot/PreviewView.cpp deleted file mode 100644 index 8bedac23df..0000000000 --- a/src/apps/screenshot/PreviewView.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2009, Philippe Saint-Pierre, stpere@gmail.com - * Distributed under the terms of the MIT License. - */ - -#include "PreviewView.h" - - -#include - - -PreviewView::PreviewView() - : - BView("preview", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE) -{ -} - - -PreviewView::~PreviewView() -{ -} - - -void -PreviewView::Draw(BRect updateRect) -{ - BRect rect = Frame(); - be_control_look->DrawTextControlBorder(this, rect, rect, - ui_color(B_PANEL_BACKGROUND_COLOR)); -} diff --git a/src/apps/screenshot/PreviewView.h b/src/apps/screenshot/PreviewView.h deleted file mode 100644 index de34d089be..0000000000 --- a/src/apps/screenshot/PreviewView.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2009, Philippe Saint-Pierre, stpere@gmail.com - * Distributed under the terms of the MIT License. - */ -#ifndef PREVIEW_VIEW_H -#define PREVIEW_VIEW_H - - -#include - - -class PreviewView : public BView { -public: - PreviewView(); - ~PreviewView(); - -protected: - virtual void Draw(BRect updateRect); -}; - -#endif /* PREVIEW_VIEW_H */ diff --git a/src/apps/screenshot/ScreenshotWindow.cpp b/src/apps/screenshot/ScreenshotWindow.cpp index eea254ffdd..f3bee39381 100644 --- a/src/apps/screenshot/ScreenshotWindow.cpp +++ b/src/apps/screenshot/ScreenshotWindow.cpp @@ -41,7 +41,6 @@ #include #include -#include "PreviewView.h" #include "Utility.h" @@ -174,11 +173,13 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent, BMenuField* menuLocation = new BMenuField(B_TRANSLATE("Save in:"), fOutputPathMenu); + menuLocation->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fTranslatorMenu = new BMenu(B_TRANSLATE("Please select")); _SetupTranslatorMenu(); BMenuField* menuFormat = new BMenuField(B_TRANSLATE("Save as:"), fTranslatorMenu); + menuFormat->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); BButton* showSettings = new BButton("", B_TRANSLATE("Settings"B_UTF8_ELLIPSIS), new BMessage(kSettings)); @@ -193,12 +194,13 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent, const float kSpacing = be_control_look->DefaultItemSpacing(); const float kLabelSpacing = be_control_look->DefaultLabelSpacing(); - fPreview = new PreviewView(); + fPreview = new BView("preview", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE); + BBox *previewBox = new BBox(B_FANCY_BORDER, fPreview); BLayoutBuilder::Group<>(this, B_VERTICAL, 0) .SetInsets(kSpacing) .AddGroup(B_HORIZONTAL, kSpacing) - .Add(fPreview) + .Add(previewBox) .AddGroup(B_VERTICAL, 0) .Add(fActiveWindow) .Add(fWindowBorder) diff --git a/src/apps/screenshot/ScreenshotWindow.h b/src/apps/screenshot/ScreenshotWindow.h index 4b24c1f0c0..036a9b4380 100644 --- a/src/apps/screenshot/ScreenshotWindow.h +++ b/src/apps/screenshot/ScreenshotWindow.h @@ -26,7 +26,6 @@ class BPath; class BTextControl; class BTextView; -class PreviewView; class Utility; @@ -58,7 +57,7 @@ private: const Utility& fUtility; - PreviewView* fPreview; + BView* fPreview; BCheckBox* fActiveWindow; BTextControl* fDelayControl; BCheckBox* fWindowBorder;