PackageInstaller: Cleanup PackageWindow

* Also center main package installation window on screen.
This commit is contained in:
Stephan Aßmus
2014-02-16 12:12:23 +01:00
parent ef18b77adc
commit 2a7d988dc5
3 changed files with 18 additions and 23 deletions
+7 -11
View File
@@ -11,34 +11,30 @@
#include <Application.h>
#include <Catalog.h>
#include <GroupLayout.h>
#include <Locale.h>
#include "PackageView.h"
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "PackageWindow"
PackageWindow::PackageWindow(const entry_ref *ref)
PackageWindow::PackageWindow(const entry_ref* ref)
:
BWindow(BRect(100, 100, 600, 300),
B_TRANSLATE_SYSTEM_NAME("PackageInstaller"),
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE)
{
//SetLayout(new BGroupLayout(B_HORIZONTAL));
PackageView* view = new PackageView(Bounds(), ref);
AddChild(view);
fBackground = new PackageView(Bounds(), ref);
AddChild(fBackground);
ResizeTo(Bounds().Width(), fBackground->Bounds().Height());
ResizeTo(Bounds().Width(), view->Bounds().Height());
CenterOnScreen();
}
PackageWindow::~PackageWindow()
{
RemoveChild(fBackground);
delete fBackground;
}
+10 -12
View File
@@ -5,28 +5,26 @@
* Author:
* Łukasz 'Sil2100' Zemczak <[email protected]>
*/
#ifndef PACKAGEWINDOW_H
#define PACKAGEWINDOW_H
#ifndef PACKAGE_WINDOW_H
#define PACKAGE_WINDOW_H
#include "PackageView.h"
#include <Window.h>
#include <Entry.h>
struct entry_ref;
const uint32 P_WINDOW_QUIT = 'PiWq';
class PackageWindow : public BWindow {
public:
PackageWindow(const entry_ref *refs);
virtual ~PackageWindow();
public:
PackageWindow(const entry_ref* ref);
virtual ~PackageWindow();
virtual void Quit();
private:
PackageView *fBackground;
virtual void Quit();
};
#endif
#endif // PACKAGE_WINDOW_H
+1
View File
@@ -17,6 +17,7 @@
#include <FilePanel.h>
#include <List.h>
#include <Locale.h>
#include <Path.h>
#include <TextView.h>
#include <stdio.h>