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

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

[Wesnoth-cvs-commits] wesnoth/src theme.hpp theme.cpp editor/editor.cpp


From: Bram Ridder
Subject: [Wesnoth-cvs-commits] wesnoth/src theme.hpp theme.cpp editor/editor.cpp
Date: Wed, 20 Jul 2005 02:27:11 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Bram Ridder <address@hidden>    05/07/20 06:27:11

Modified files:
        src            : theme.hpp theme.cpp 
        src/editor     : editor.cpp 

Log message:
        Fixed bug #13851
        Tooltips were not visible at lower resolutions.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/theme.hpp.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/theme.cpp.diff?tr1=1.39&tr2=1.40&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/editor.cpp.diff?tr1=1.109&tr2=1.110&r1=text&r2=text

Patches:
Index: wesnoth/src/editor/editor.cpp
diff -u wesnoth/src/editor/editor.cpp:1.109 wesnoth/src/editor/editor.cpp:1.110
--- wesnoth/src/editor/editor.cpp:1.109 Sun Jul 17 14:01:21 2005
+++ wesnoth/src/editor/editor.cpp       Wed Jul 20 06:27:11 2005
@@ -138,13 +138,20 @@
  */
 void map_editor::load_tooltips()
 {
-        // Add tooltips to all buttons
+       // Clear all previous tooltips
+       tooltips::clear_tooltips();
+       
+       // Add tooltips to all buttons
        const theme &t = gui_.get_theme();
         const std::vector<theme::menu> &menus = t.menus();
         std::vector<theme::menu>::const_iterator it;
         for (it = menus.begin(); it != menus.end(); it++) {
                
-               const SDL_Rect draw_rect = (*it).get_location();
+               // Get the button's screen location
+               SDL_Rect screen;
+               screen.x = 0; screen.y = 0; screen.w = gui_.x(); screen.h = 
gui_.y();
+               
+               const SDL_Rect tooltip_rect = (*it).location(screen);
                std::string text = "";
 
                const std::vector<std::string> &menu_items = (*it).items();
@@ -174,7 +181,7 @@
                }
         
                if(text != "")
-                       tooltips::add_tooltip(draw_rect, text);
+                       tooltips::add_tooltip(tooltip_rect, text);
         }
 }
 
@@ -788,6 +795,7 @@
        update_l_button_palette();
        palette_.draw(true);
        brush_.draw(true);
+       load_tooltips();
 }
 
 void map_editor::highlight_selected_hexes(const bool clear_old) {
Index: wesnoth/src/theme.cpp
diff -u wesnoth/src/theme.cpp:1.39 wesnoth/src/theme.cpp:1.40
--- wesnoth/src/theme.cpp:1.39  Sun Jul 17 14:01:21 2005
+++ wesnoth/src/theme.cpp       Wed Jul 20 06:27:11 2005
@@ -429,8 +429,6 @@
 
 const std::vector<std::string>& theme::menu::items() const { return items_; }
 
-const SDL_Rect& theme::menu::get_location(void) const { return 
object::get_location(); }
-
 theme::theme(const config& cfg, const SDL_Rect& 
screen):cfg_(resolve_rects(cfg)){
        set_resolution(screen);
 }
Index: wesnoth/src/theme.hpp
diff -u wesnoth/src/theme.hpp:1.10 wesnoth/src/theme.hpp:1.11
--- wesnoth/src/theme.hpp:1.10  Sun Jul 17 14:01:21 2005
+++ wesnoth/src/theme.hpp       Wed Jul 20 06:27:11 2005
@@ -113,8 +113,6 @@
                const std::string& image() const;
 
                const std::vector<std::string>& items() const;
-
-               const SDL_Rect& get_location(void) const;
        private:
                bool context_;
                std::string title_, image_;




reply via email to

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