Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-10-07 21:42:50 +0000
committerStijn Buys <ingar@osirion.org>2012-10-07 21:42:50 +0000
commit4131fcb1b53dc85ced61ff2cc41889811c8a2aaf (patch)
treec1638afb195ae02d481d1fa69509f61da0cb1e07 /src/ui
parent9ce4282b3c309bb838888264f2e68c0b458224ac (diff)
Added Widget::EventClicked and Widget::EventDoubleClicked,
made ModelView::clear() work according to specification.
Diffstat (limited to 'src/ui')
-rwxr-xr-xsrc/ui/modelview.cc18
-rwxr-xr-xsrc/ui/modelview.h2
-rw-r--r--src/ui/widget.h4
3 files changed, 17 insertions, 7 deletions
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc
index e4975a3..8069ac7 100755
--- a/src/ui/modelview.cc
+++ b/src/ui/modelview.cc
@@ -22,7 +22,7 @@ namespace ui
{
const float LIGHT_DISTANCE = -10.0f;
-const float LIGHT_ATTENUATION = 0.2f;
+const float LIGHT_ATTENUATION = 0.5f;
ModelView::ModelView(Widget *parent) : Widget(parent)
{
@@ -50,7 +50,7 @@ void ModelView::print(const size_t indent) const
con_print << aux::pad_left(marker, indent*2) << label() << " \"" << modelname() << "\"" << std::endl;
}
-void ModelView::clear()
+void ModelView::reset()
{
set_background(false);
@@ -66,9 +66,15 @@ void ModelView::clear()
modelview_globebright = false;
}
+void ModelView::clear()
+{
+ reset();
+ modelview_mode = Model;
+}
+
void ModelView::set_globetexturename(const std::string & texturename, const bool bright, const std::string & coronaname)
{
- clear();
+ reset();
modelview_globetexturename.assign(texturename);
modelview_globecoronaname.assign(coronaname);
modelview_globebright = bright;
@@ -76,7 +82,7 @@ void ModelView::set_globetexturename(const std::string & texturename, const bool
void ModelView::set_modelname(const std::string & modelname)
{
- clear();
+ reset();
modelview_modelname.assign(modelname);
}
@@ -190,7 +196,7 @@ void ModelView::draw_globe()
math::Vector3f(LIGHT_DISTANCE * reference_radius, 0, 0),
math::Color(1.0f, 1.0f, 1.0f)
);
- light->set_attenuation(LIGHT_ATTENUATION, LIGHT_ATTENUATION, 0.0f);
+ light->set_attenuation(0.0f, LIGHT_ATTENUATION, 0.0f);
render::LightEnvironment lightenv;
lightenv.add(light);
@@ -290,7 +296,7 @@ void ModelView::draw_model()
math::Vector3f(LIGHT_DISTANCE * reference_radius, 0, 0),
math::Color(1.0f, 1.0f, 1.0f)
);
- light->set_attenuation(LIGHT_ATTENUATION, LIGHT_ATTENUATION, 0.0f);
+ light->set_attenuation(0.0f, LIGHT_ATTENUATION, 0.0f);
render::LightEnvironment lightenv;
lightenv.add(light);
diff --git a/src/ui/modelview.h b/src/ui/modelview.h
index d49acc8..4642551 100755
--- a/src/ui/modelview.h
+++ b/src/ui/modelview.h
@@ -100,6 +100,8 @@ protected:
virtual void on_mousemove(const math::Vector2f &cursor);
private:
+ void reset();
+
void draw_model();
void draw_globe();
diff --git a/src/ui/widget.h b/src/ui/widget.h
index ada1f5b..fafdf58 100644
--- a/src/ui/widget.h
+++ b/src/ui/widget.h
@@ -40,7 +40,9 @@ public:
EventSliderChanged = 4,
EventScrollBarChanged = 5,
EventWindowShow = 6,
- EventWindowHide = 7
+ EventWindowHide = 7,
+ EventClicked = 8,
+ EventDoubleClicked = 9
};
/// create a new widget