Better appearance for dropdown and context menus
This commit is contained in:
parent
2abb2b2c9f
commit
bc2acb9c08
@ -31,13 +31,13 @@ void ContextMenu::Show(ui::Point position)
|
||||
buttons.clear();
|
||||
|
||||
Position = position;
|
||||
Size.Y = items.size()*15;
|
||||
Size.Y = items.size()*16;
|
||||
Size.X = 100;
|
||||
|
||||
int currentY = 1;
|
||||
for(int i = 0; i < items.size(); i++)
|
||||
{
|
||||
Button * tempButton = new Button(Point(1, currentY), Point(Size.X-2, 14), items[i].Text);
|
||||
Button * tempButton = new Button(Point(1, currentY), Point(Size.X-2, 16), items[i].Text);
|
||||
tempButton->Appearance = Appearance;
|
||||
tempButton->Enabled = items[i].Enabled;
|
||||
tempButton->SetActionCallback(new ItemSelectedAction(this, items[i].ID));
|
||||
|
@ -34,14 +34,14 @@ public:
|
||||
}
|
||||
};
|
||||
DropDownWindow(DropDown * dropDown):
|
||||
Window(ui::Point(dropDown->Position.X+dropDown->GetParentWindow()->Position.X-5, dropDown->Position.Y+dropDown->GetParentWindow()->Position.Y-3), ui::Point(dropDown->Size.X+10, 1+dropDown->options.size()*15)),
|
||||
Window(ui::Point(dropDown->Position.X+dropDown->GetParentWindow()->Position.X-5, dropDown->Position.Y+dropDown->GetParentWindow()->Position.Y-3), ui::Point(dropDown->Size.X+10, 1+dropDown->options.size()*16)),
|
||||
dropDown(dropDown),
|
||||
appearance(dropDown->Appearance)
|
||||
{
|
||||
int currentY = 1;
|
||||
for(int i = 0; i < dropDown->options.size(); i++)
|
||||
{
|
||||
Button * tempButton = new Button(Point(1, currentY), Point(Size.X-2, 14), dropDown->options[i].first);
|
||||
Button * tempButton = new Button(Point(1, currentY), Point(Size.X-2, 16), dropDown->options[i].first);
|
||||
tempButton->Appearance = appearance;
|
||||
tempButton->SetActionCallback(new ItemSelectedAction(this, dropDown->options[i].first));
|
||||
AddComponent(tempButton);
|
||||
|
Loading…
Reference in New Issue
Block a user