Skip to content

Commit

Permalink
make PreferredSize optional and clean up a few that are no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
robn committed Jun 6, 2012
1 parent 03592e1 commit f009e7a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/ui/FloatContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

namespace UI {

vector2f FloatContainer::PreferredSize()
{
return vector2f(FLT_MAX, FLT_MAX);
}

void FloatContainer::Layout()
{
LayoutChildren();
Expand Down
3 changes: 2 additions & 1 deletion src/ui/FloatContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ namespace UI {

class FloatContainer : public Container {
public:
virtual vector2f PreferredSize();
virtual void Layout();

void AddWidget(Widget *w, const vector2f &pos, const vector2f &size);
void RemoveWidget(Widget *w);

private:
virtual vector2f PreferredSize() { return 0; }

friend class Context;
FloatContainer(Context *context) : Container(context) {}
};
Expand Down
1 change: 0 additions & 1 deletion src/ui/Grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class Grid : public Container {
Grid(Context *context, const CellSpec &rowSpec, const CellSpec &colSpec) : Container(context), m_rowSpec(rowSpec), m_colSpec(colSpec), m_widgets(m_rowSpec.numCells*m_colSpec.numCells) {}

public:
virtual vector2f PreferredSize() { return 0; }
virtual void Layout();

Grid *SetRow(int rowNum, const WidgetSet &set);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/Widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Widget : public RefCounted {
public:
virtual ~Widget();

virtual vector2f PreferredSize() = 0;
virtual vector2f PreferredSize() { return 0; }
virtual void Layout() {}
virtual void Update() {}
virtual void Draw() = 0;
Expand Down

0 comments on commit f009e7a

Please sign in to comment.