diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-27 22:01:22 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-27 22:01:22 (GMT) |
| commit | 58ba7f8800403c572bae99115facc808c6dc34a3 (patch) | |
| tree | 3a9a80114ac7aecc4251597eee5385f762fd3e56 /src/preview/PreviewView.cpp | |
| parent | 07525180c2f8065c61dfd38bb273ff0f0a8abc85 (diff) | |
| download | powder-58ba7f8800403c572bae99115facc808c6dc34a3.zip powder-58ba7f8800403c572bae99115facc808c6dc34a3.tar.gz | |
Stop freeing memory twice, also clear signs correctly
Diffstat (limited to 'src/preview/PreviewView.cpp')
| -rw-r--r-- | src/preview/PreviewView.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/preview/PreviewView.cpp b/src/preview/PreviewView.cpp index 8c69b7b..4ab54b2 100644 --- a/src/preview/PreviewView.cpp +++ b/src/preview/PreviewView.cpp @@ -25,7 +25,9 @@ PreviewView::PreviewView(): v->c->Exit(); } }; - openButton = new ui::Button(ui::Point(0, Size.Y-16), ui::Point(100, 16), "Open"); + openButton = new ui::Button(ui::Point(0, Size.Y-16), ui::Point(75, 16), "Open"); + openButton->SetAlignment(AlignLeft, AlignMiddle); + openButton->SetIcon(IconOpen); openButton->SetActionCallback(new OpenAction(this)); AddComponent(openButton); @@ -33,7 +35,7 @@ PreviewView::PreviewView(): saveNameLabel->SetAlignment(AlignLeft, AlignBottom); AddComponent(saveNameLabel); - authorDateLabel = new ui::Label(ui::Point(5, (YRES/2)+5+16), ui::Point(100, 16), ""); + authorDateLabel = new ui::Label(ui::Point(5, (YRES/2)+5+14), ui::Point(100, 16), ""); authorDateLabel->SetAlignment(AlignLeft, AlignBottom); AddComponent(authorDateLabel); } @@ -52,6 +54,7 @@ void PreviewView::OnDraw() g->draw_image(savePreview->Data, (Position.X+1)+(((XRES/2)-savePreview->Size.X)/2), (Position.Y+1)+(((YRES/2)-savePreview->Size.Y)/2), savePreview->Size.X, savePreview->Size.Y, 255); } g->drawrect(Position.X, Position.Y, XRES/2, YRES/2, 255, 255, 255, 100); + g->draw_line(Position.X+XRES/2, Position.Y, Position.X+XRES/2, Position.Y+Size.Y, 255, 255, 255, XRES+BARSIZE); } void PreviewView::OnMouseDown(int x, int y, unsigned button) @@ -66,10 +69,12 @@ void PreviewView::NotifySaveChanged(PreviewModel * sender) if(save) { saveNameLabel->SetText(save->name); + authorDateLabel->SetText("\bgAuthor:\bw " + save->userName + " \bgDate:\bw "); } else { saveNameLabel->SetText(""); + authorDateLabel->SetText(""); } } @@ -89,7 +94,5 @@ void PreviewView::NotifyPreviewChanged(PreviewModel * sender) } PreviewView::~PreviewView() { - delete openButton; - delete saveNameLabel; } |
