diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-02-12 16:47:01 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-02-12 16:47:01 (GMT) |
| commit | afe9e061e1d173731d8a5122c397a2caf4fe61ab (patch) | |
| tree | f045221d8718c44b8af516cb58bdb45c3c74114b /src/search/SearchView.cpp | |
| parent | d25384c36c427d4afd71f87f8282b1a981c4b563 (diff) | |
| download | powder-afe9e061e1d173731d8a5122c397a2caf4fe61ab.zip powder-afe9e061e1d173731d8a5122c397a2caf4fe61ab.tar.gz | |
Better names for sort, allow showing own saves
Diffstat (limited to 'src/search/SearchView.cpp')
| -rw-r--r-- | src/search/SearchView.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/search/SearchView.cpp b/src/search/SearchView.cpp index 584b7e3..5bcbe06 100644 --- a/src/search/SearchView.cpp +++ b/src/search/SearchView.cpp @@ -27,7 +27,7 @@ SearchView::SearchView(): v->doSearch(); } }; - searchField = new ui::Textbox(ui::Point(60, 10), ui::Point((XRES+BARSIZE)-((50*2)+16+10+50+10), 16), ""); + searchField = new ui::Textbox(ui::Point(60, 10), ui::Point((XRES+BARSIZE)-((60*2)+16+10+50+10), 16), ""); searchField->SetAlignment(AlignLeft, AlignBottom); searchField->SetActionCallback(new SearchAction(this)); @@ -41,9 +41,9 @@ SearchView::SearchView(): v->c->ChangeSort(); } }; - sortButton = new ui::Button(ui::Point(XRES+BARSIZE-50-50-16-10, 10), ui::Point(50, 16), "Sort"); + sortButton = new ui::Button(ui::Point(XRES+BARSIZE-60-60-16-10+5, 10), ui::Point(60, 16), "Sort"); sortButton->SetActionCallback(new SortAction(this)); - sortButton->SetAlignment(AlignLeft, AlignBottom); + sortButton->SetAlignment(AlignCentre, AlignBottom); AddComponent(sortButton); class MyOwnAction : public ui::ButtonAction @@ -56,10 +56,12 @@ SearchView::SearchView(): v->c->ShowOwn(sender->GetToggleState()); } }; - ownButton = new ui::Button(ui::Point(XRES+BARSIZE-50-16-10, 10), ui::Point(50, 16), "My Own"); + ownButton = new ui::Button(ui::Point(XRES+BARSIZE-60-16-10+10, 10), ui::Point(60, 16), "My Own"); ownButton->SetTogglable(true); ownButton->SetActionCallback(new MyOwnAction(this)); - ownButton->SetAlignment(AlignLeft, AlignBottom); + if(!Client::Ref().GetAuthUser().ID) + ownButton->Enabled = false; + ownButton->SetAlignment(AlignCentre, AlignBottom); AddComponent(ownButton); class NextPageAction : public ui::ButtonAction @@ -110,12 +112,12 @@ SearchView::~SearchView() void SearchView::NotifySortChanged(SearchModel * sender) { - sortButton->SetText("Sort: "+sender->GetSort()); + sortButton->SetText("Show "+sender->GetSort()); } void SearchView::NotifyShowOwnChanged(SearchModel * sender) { - sortButton->SetToggleState(sender->GetShowOwn()); + ownButton->SetToggleState(sender->GetShowOwn()); } void SearchView::NotifyPageChanged(SearchModel * sender) |
