]> git.tdb.fi Git - libs/gltk.git/commitdiff
Adjust some slider checks
authorMikko Rasa <tdb@tdb.fi>
Mon, 28 Feb 2011 10:56:14 +0000 (10:56 +0000)
committerMikko Rasa <tdb@tdb.fi>
Mon, 28 Feb 2011 10:56:14 +0000 (10:56 +0000)
source/entry.cpp

index 2dc046646e49af2af9b07967a090e42f041f0c64..a554dbbaf2153135be94f869aebc43fe01f7f862 100644 (file)
@@ -129,7 +129,7 @@ void Entry::render_special(const Part &part) const
                part.get_graphic(state)->render(part.get_geometry().w, part.get_geometry().h);
                GL::pop_matrix();
        }
-       else if(part.get_name()=="slider")
+       else if(part.get_name()=="slider" && multiline)
                slider->render();
 }
 
@@ -263,12 +263,9 @@ void Entry::check_view_range()
        else if(row>=first_row+visible_rows)
                first_row = row+1-visible_rows;
 
-       if(slider)
-       {
-               unsigned scroll = max(text.get_n_lines(), visible_rows)-visible_rows;
-               slider->set_range(0, scroll);
-               slider->set_value(scroll-first_row);
-       }
+       unsigned scroll = max(text.get_n_lines(), visible_rows)-visible_rows;
+       slider->set_range(0, scroll);
+       slider->set_value(scroll-first_row);
 }
 
 void Entry::slider_value_changed(double value)