icon(0),
pressed(false)
{
+ input_type = INPUT_NAVIGATION;
set_text(t);
}
-void Button::autosize_special(const Part &part, Geometry &ageom)
+void Button::autosize_special(const Part &part, Geometry &ageom) const
{
if(part.get_name()=="text")
text.autosize(part, ageom);
GL::MeshBuilder bld(part_cache.create_mesh(part, *icon));
bld.color(1.0f, 1.0f, 1.0f);
- bld.begin(GL::QUADS);
+ bld.begin(GL::TRIANGLE_STRIP);
+ bld.texcoord(0, 1);
+ bld.vertex(rgeom.x, rgeom.y+rgeom.h);
bld.texcoord(0, 0);
bld.vertex(rgeom.x, rgeom.y);
- bld.texcoord(1, 0);
- bld.vertex(rgeom.x+rgeom.w, rgeom.y);
bld.texcoord(1, 1);
bld.vertex(rgeom.x+rgeom.w, rgeom.y+rgeom.h);
- bld.texcoord(0, 1);
- bld.vertex(rgeom.x, rgeom.y+rgeom.h);
+ bld.texcoord(1, 0);
+ bld.vertex(rgeom.x+rgeom.w, rgeom.y);
bld.end();
}
}
}
}
+bool Button::navigate(Navigation nav)
+{
+ if(nav==NAV_ACTIVATE)
+ signal_clicked.emit();
+ else
+ return false;
+
+ return true;
+}
+
void Button::on_style_change()
{
text.set_style(style);