mail[Wesnoth-commits] r40296 - /trunk/src/gui/dialogs/game_load.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on December 20, 2009 - 16:55:
Author: mordante
Date: Sun Dec 20 16:55:27 2009
New Revision: 40296

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40296&view=rev
Log:
The load game dialog uses the new set_row_visible.

Still needs some more tuning to avoid the last invalidate_layout call.

Modified:
    trunk/src/gui/dialogs/game_load.cpp

Modified: trunk/src/gui/dialogs/game_load.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/game_load.cpp?rev=40296&r1=40295&r2=40296&view=diff
==============================================================================
--- trunk/src/gui/dialogs/game_load.cpp (original)
+++ trunk/src/gui/dialogs/game_load.cpp Sun Dec 20 16:55:27 2009
@@ -128,8 +128,6 @@
 
                list.add_row(data);
        }
-
-       window.invalidate_layout();
 }
 
 void tgame_load::list_item_clicked(twindow& window)
@@ -153,11 +151,12 @@
                tgrid* row = list.get_row_grid(i);
 
                if (text == ""){
-                       row->set_visible(twidget::VISIBLE);
+                       list.set_row_visible(i, true);
                }
                else{
                        tgrid::iterator it = row->begin();
-                       tlabel& filename_label = find_widget<tlabel>(*it, 
"filename", false);
+                       tlabel& filename_label =
+                                       find_widget<tlabel>(*it, "filename", 
false);
 
                        bool found = false;
                        foreach (const std::string& word, words){
@@ -173,14 +172,10 @@
                                }
                        }
 
-                       if (found)
-                               row->set_visible(twidget::VISIBLE);
-                       else
-                               row->set_visible(twidget::INVISIBLE);
-               }
-       }
-
-       window.invalidate_layout();
+                       list.set_row_visible(i
+                                       , !found ? twidget::VISIBLE : 
twidget::INVISIBLE);
+               }
+       }
 
        return false;
 }




Related Messages


Powered by MHonArc, Updated Sun Dec 20 17:20:10 2009