wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src/widgets file_chooser.cpp file_choos...


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src/widgets file_chooser.cpp file_choos...
Date: Thu, 18 Nov 2004 14:50:25 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    04/11/18 19:44:33

Modified files:
        src/widgets    : file_chooser.cpp file_chooser.hpp 

Log message:
        Remove unused function

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/file_chooser.cpp.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/file_chooser.hpp.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: wesnoth/src/widgets/file_chooser.cpp
diff -u wesnoth/src/widgets/file_chooser.cpp:1.13 
wesnoth/src/widgets/file_chooser.cpp:1.14
--- wesnoth/src/widgets/file_chooser.cpp:1.13   Thu Nov 18 19:33:34 2004
+++ wesnoth/src/widgets/file_chooser.cpp        Thu Nov 18 19:44:32 2004
@@ -46,32 +46,6 @@
        update_file_lists();
 }
 
-void file_chooser::adjust_layout() {
-       const int current_path_y = location().y;
-       current_path_rect_.y = current_path_y;
-       current_path_rect_.w = width();
-       current_path_rect_.x = location().x;
-       current_path_rect_.h = 18;
-       const int file_list_y = current_path_y + current_path_rect_.h + 10;
-       const int filename_textbox_y = location().y + height() - 
filename_textbox_.height();
-       const int file_list_height = filename_textbox_y  - file_list_y - 10 - 
32;
-
-       const int delete_button_x = location().x + width() - 
delete_button_.width();
-       const int delete_button_y = file_list_y + file_list_height + 5;
-       delete_button_.set_location(delete_button_x, delete_button_y);
-
-       file_list_.set_width(width());
-       filename_textbox_.set_width(width());
-
-       file_list_.set_location(location().x, file_list_y);
-       filename_textbox_.set_location(location().x, filename_textbox_y);
-
-       file_list_.set_max_height(file_list_height);
-       // When the layout has changed we want to redisplay the files to
-       // make them fit into the newly adjusted widget.
-       set_dirty(true);
-}
-
 void file_chooser::display_current_files() {
        std::vector<std::string> to_show;
        if (!is_root(current_dir_)) {
@@ -255,7 +229,26 @@
 }
 
 void file_chooser::update_location(SDL_Rect const &rect) {
-       adjust_layout();
+       const int current_path_y = rect.y;
+       current_path_rect_.y = current_path_y;
+       current_path_rect_.w = rect.w;
+       current_path_rect_.x = rect.x;
+       current_path_rect_.h = 18;
+       const int file_list_y = current_path_y + current_path_rect_.h + 10;
+       const int filename_textbox_y = rect.y + rect.h - 
filename_textbox_.height();
+       const int file_list_height = filename_textbox_y  - file_list_y - 10 - 
32;
+
+       const int delete_button_x = rect.x + rect.w - delete_button_.width();
+       const int delete_button_y = file_list_y + file_list_height + 5;
+       delete_button_.set_location(delete_button_x, delete_button_y);
+
+       file_list_.set_width(rect.w);
+       filename_textbox_.set_width(rect.w);
+
+       file_list_.set_location(rect.x, file_list_y);
+       filename_textbox_.set_location(rect.x, filename_textbox_y);
+
+       file_list_.set_max_height(file_list_height);
 }
 
 std::string file_chooser::get_path(const std::string file_or_dir) const {
Index: wesnoth/src/widgets/file_chooser.hpp
diff -u wesnoth/src/widgets/file_chooser.hpp:1.6 
wesnoth/src/widgets/file_chooser.hpp:1.7
--- wesnoth/src/widgets/file_chooser.hpp:1.6    Thu Nov 18 19:33:34 2004
+++ wesnoth/src/widgets/file_chooser.hpp        Thu Nov 18 19:44:32 2004
@@ -65,9 +65,6 @@
        /// Return true if the path is the root of the filesystem.
        bool is_root(const std::string path) const;
 
-       /// Adjust the layout of the widget.
-       void adjust_layout();
-
        /// Show the files in the current directory.
        void display_current_files();
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]