Cosmetic change for the border around the screenshot preview, as suggested in #3367.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30593 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -6,6 +6,7 @@ UsePrivateHeaders interface ;
|
|||||||
Application Screenshot :
|
Application Screenshot :
|
||||||
main.cpp
|
main.cpp
|
||||||
PNGDump.cpp
|
PNGDump.cpp
|
||||||
|
PreviewView.cpp
|
||||||
Screenshot.cpp
|
Screenshot.cpp
|
||||||
ScreenshotWindow.cpp
|
ScreenshotWindow.cpp
|
||||||
: be tracker translation libpng.so libz.so
|
: be tracker translation libpng.so libz.so
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009, Philippe Saint-Pierre, [email protected]
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "PreviewView.h"
|
||||||
|
#include <ControlLook.h>
|
||||||
|
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009, Philippe Saint-Pierre, [email protected]
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PREVIEW_VIEW_H
|
||||||
|
#define PREVIEW_VIEW_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <View.h>
|
||||||
|
|
||||||
|
|
||||||
|
class PreviewView : public BView {
|
||||||
|
public:
|
||||||
|
PreviewView();
|
||||||
|
~PreviewView();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void Draw(BRect updateRect);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* PREVIEW_VIEW_H */
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include "PNGDump.h"
|
#include "PNGDump.h"
|
||||||
|
|
||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
@@ -324,9 +323,7 @@ ScreenshotWindow::_SetupFirstLayoutItem(BCardLayout* layout)
|
|||||||
void
|
void
|
||||||
ScreenshotWindow::_SetupSecondLayoutItem(BCardLayout* layout)
|
ScreenshotWindow::_SetupSecondLayoutItem(BCardLayout* layout)
|
||||||
{
|
{
|
||||||
fPreviewBox = new BBox(BRect(0.0, 0.0, 200.0, 150.0));
|
fPreview = new PreviewView();
|
||||||
fPreviewBox->SetExplicitMinSize(BSize(200.0, B_SIZE_UNSET));
|
|
||||||
fPreviewBox->SetFlags(fPreviewBox->Flags() | B_FULL_UPDATE_ON_RESIZE);
|
|
||||||
|
|
||||||
fNameControl = new BTextControl("", "Name:", "screenshot1", NULL);
|
fNameControl = new BTextControl("", "Name:", "screenshot1", NULL);
|
||||||
|
|
||||||
@@ -354,7 +351,7 @@ ScreenshotWindow::_SetupSecondLayoutItem(BCardLayout* layout)
|
|||||||
|
|
||||||
layout->AddView(1, BGroupLayoutBuilder(B_VERTICAL)
|
layout->AddView(1, BGroupLayoutBuilder(B_VERTICAL)
|
||||||
.Add(BGroupLayoutBuilder(B_HORIZONTAL, 10.0)
|
.Add(BGroupLayoutBuilder(B_HORIZONTAL, 10.0)
|
||||||
.Add(fPreviewBox)
|
.Add(fPreview)
|
||||||
.AddGroup(B_VERTICAL)
|
.AddGroup(B_VERTICAL)
|
||||||
.Add(gridLayout->View())
|
.Add(gridLayout->View())
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
@@ -514,13 +511,13 @@ ScreenshotWindow::_UpdatePreviewPanel()
|
|||||||
fScreenshot->Bounds().Width()) * width;
|
fScreenshot->Bounds().Width()) * width;
|
||||||
}
|
}
|
||||||
|
|
||||||
fPreviewBox->SetExplicitMinSize(BSize(width, height));
|
fPreview->SetExplicitMinSize(BSize(width, height));
|
||||||
fPreviewBox->SetExplicitMaxSize(BSize(width, height));
|
fPreview->SetExplicitMaxSize(BSize(width, height));
|
||||||
|
|
||||||
fPreviewBox->ClearViewBitmap();
|
|
||||||
fPreviewBox->SetViewBitmap(fScreenshot, fScreenshot->Bounds(),
|
|
||||||
fPreviewBox->Bounds(), B_FOLLOW_ALL, 0);
|
|
||||||
|
|
||||||
|
fPreview->ClearViewBitmap();
|
||||||
|
fPreview->SetViewBitmap(fScreenshot, fScreenshot->Bounds(),
|
||||||
|
fPreview->Bounds(), B_FOLLOW_ALL, 0);
|
||||||
|
|
||||||
BCardLayout* layout = dynamic_cast<BCardLayout*> (GetLayout());
|
BCardLayout* layout = dynamic_cast<BCardLayout*> (GetLayout());
|
||||||
if (layout)
|
if (layout)
|
||||||
layout->SetVisibleItem(1L);
|
layout->SetVisibleItem(1L);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
|
#include "PreviewView.h"
|
||||||
|
|
||||||
class BBitmap;
|
class BBitmap;
|
||||||
class BBox;
|
class BBox;
|
||||||
@@ -57,7 +58,7 @@ private:
|
|||||||
void _SaveScreenshotSilent() const;
|
void _SaveScreenshotSilent() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BBox* fPreviewBox;
|
PreviewView* fPreview;
|
||||||
BRadioButton* fActiveWindow;
|
BRadioButton* fActiveWindow;
|
||||||
BRadioButton* fWholeDesktop;
|
BRadioButton* fWholeDesktop;
|
||||||
BTextControl* fDelayControl;
|
BTextControl* fDelayControl;
|
||||||
|
|||||||
Reference in New Issue
Block a user