Cleanup part 5.
The full redraw flag is no longer needed since widgets are always fully redrawn now.
This commit is contained in:
parent
1e6c5a88d6
commit
2a23ba1884
20 changed files with 1 additions and 107 deletions
|
@ -4,8 +4,6 @@
|
|||
###
|
||||
|
||||
#define _GUI_STATE GROOVE_LEFT GROOVE_RIGHT POSITIONER_LEFT POSITIONER_RIGHT IMAGE_SUFFIX
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
#
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
[state_enabled]
|
||||
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
[text]
|
||||
|
@ -47,8 +45,6 @@
|
|||
|
||||
[state_disabled]
|
||||
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
[text]
|
||||
|
|
|
@ -26,8 +26,6 @@
|
|||
|
||||
[state_enabled]
|
||||
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
[/draw]
|
||||
|
||||
|
@ -35,8 +33,6 @@
|
|||
|
||||
[state_disabled]
|
||||
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
[/draw]
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
[state_enabled]
|
||||
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
[/draw]
|
||||
|
||||
|
@ -31,8 +29,6 @@
|
|||
|
||||
[state_disabled]
|
||||
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
[/draw]
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
###
|
||||
|
||||
#define _GUI_STATE IMAGE_SUFFIX GROOVE_COLOUR TEXT_COLOUR RIGHT_OFFSET TEXT_OFFSET TEXT_WIDTH FONT_SIZE
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
#
|
||||
|
|
|
@ -83,8 +83,6 @@
|
|||
|
||||
[state_enabled]
|
||||
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
{_GUI_DRAW_BORDER ({GUI__FONT_COLOUR_ENABLED__TITLE}) }
|
||||
|
@ -99,8 +97,6 @@
|
|||
|
||||
[state_disabled]
|
||||
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
{_GUI_DRAW_BORDER ({GUI__FONT_COLOUR_DISABLED__TITLE}) }
|
||||
|
@ -113,8 +109,6 @@
|
|||
|
||||
[state_focussed]
|
||||
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
{_GUI_DRAW_BORDER ({GUI__FONT_COLOUR_ENABLED__TITLE}) }
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
text_font_size = {FONT_SIZE}
|
||||
|
||||
[state_enabled]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -49,7 +48,6 @@
|
|||
[/state_enabled]
|
||||
|
||||
[state_disabled]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -64,7 +62,6 @@
|
|||
[/state_disabled]
|
||||
|
||||
[state_focussed]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -83,7 +80,6 @@
|
|||
###
|
||||
|
||||
[state_enabled_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -98,7 +94,6 @@
|
|||
[/state_enabled_selected]
|
||||
|
||||
[state_disabled_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -113,7 +108,6 @@
|
|||
[/state_disabled_selected]
|
||||
|
||||
[state_focussed_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
text_font_size = 0
|
||||
|
||||
[state_enabled]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -44,7 +43,6 @@
|
|||
[/state_enabled]
|
||||
|
||||
[state_disabled]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -55,7 +53,6 @@
|
|||
[/state_disabled]
|
||||
|
||||
[state_focussed]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -70,7 +67,6 @@
|
|||
###
|
||||
|
||||
[state_enabled_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -81,7 +77,6 @@
|
|||
[/state_enabled_selected]
|
||||
|
||||
[state_disabled_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -92,7 +87,6 @@
|
|||
[/state_disabled_selected]
|
||||
|
||||
[state_focussed_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
text_font_size = {FONT_SIZE}
|
||||
|
||||
[state_enabled]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -59,7 +58,6 @@
|
|||
[/state_enabled]
|
||||
|
||||
[state_disabled]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -71,7 +69,6 @@
|
|||
[/state_disabled]
|
||||
|
||||
[state_focussed]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -87,7 +84,6 @@
|
|||
###
|
||||
|
||||
[state_enabled_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -99,7 +95,6 @@
|
|||
[/state_enabled_selected]
|
||||
|
||||
[state_disabled_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -111,7 +106,6 @@
|
|||
[/state_disabled_selected]
|
||||
|
||||
[state_focussed_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
text_font_size = {FONT_SIZE}
|
||||
|
||||
[state_enabled]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -67,7 +66,6 @@
|
|||
[/state_enabled]
|
||||
|
||||
[state_disabled]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -80,7 +78,6 @@
|
|||
[/state_disabled]
|
||||
|
||||
[state_focussed]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -97,7 +94,6 @@
|
|||
###
|
||||
|
||||
[state_enabled_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -110,7 +106,6 @@
|
|||
[/state_enabled_selected]
|
||||
|
||||
[state_disabled_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
@ -123,7 +118,6 @@
|
|||
[/state_disabled_selected]
|
||||
|
||||
[state_focussed_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
max_height = 0
|
||||
|
||||
[state_enabled]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
{_GUI_RECT ({GUI__BACKGROUND_COLOUR_ENABLED}) }
|
||||
|
@ -39,7 +38,6 @@
|
|||
[/state_enabled]
|
||||
|
||||
[state_disabled]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
{_GUI_RECT ({GUI__BACKGROUND_COLOUR_DISABLED}) }
|
||||
|
@ -48,7 +46,6 @@
|
|||
[/state_disabled]
|
||||
|
||||
[state_focussed]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
{_GUI_RECT ({GUI__BACKGROUND_COLOUR_ENABLED}) }
|
||||
|
@ -61,7 +58,6 @@
|
|||
###
|
||||
|
||||
[state_enabled_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
{GUI__LISTBOX_SELECTED_CELL}
|
||||
|
@ -70,7 +66,6 @@
|
|||
[/state_enabled_selected]
|
||||
|
||||
[state_disabled_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
{GUI__LISTBOX_SELECTED_CELL}
|
||||
|
@ -79,7 +74,6 @@
|
|||
[/state_disabled_selected]
|
||||
|
||||
[state_focussed_selected]
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
{GUI__LISTBOX_SELECTED_CELL}
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
[state_enabled]
|
||||
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
[rectangle]
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
###
|
||||
|
||||
#define _GUI_STATE GROOVE_TOP GROOVE_BOTTOM POSITIONER_TOP POSITIONER_BOTTOM IMAGE_SUFFIX
|
||||
full_redraw = "true"
|
||||
|
||||
[draw]
|
||||
|
||||
#
|
||||
|
|
|
@ -238,12 +238,6 @@ void tcontrol::set_label(const t_string& label)
|
|||
set_dirty();
|
||||
}
|
||||
|
||||
bool tcontrol::needs_full_redraw() const
|
||||
{
|
||||
assert(config());
|
||||
return config()->state[get_state()].full_redraw;
|
||||
}
|
||||
|
||||
void tcontrol::update_canvas()
|
||||
{
|
||||
const int max_width = get_text_maximum_width();
|
||||
|
|
|
@ -236,9 +236,6 @@ protected:
|
|||
|
||||
/***** ***** ***** ***** miscellaneous ***** ***** ***** *****/
|
||||
|
||||
/** Does the widget need to restore the surface before (re)painting? */
|
||||
virtual bool needs_full_redraw() const;
|
||||
|
||||
/**
|
||||
* Updates the canvas(ses).
|
||||
*
|
||||
|
|
|
@ -55,15 +55,6 @@ public:
|
|||
/** Inherited from tcontrol. */
|
||||
bool does_block_easy_close() const { return false; }
|
||||
|
||||
/**
|
||||
* Inherited from tcontrol.
|
||||
*
|
||||
* Since the old minimap might be smaller we always need to do a full
|
||||
* redraw. Also the new map might be no map in which case the old one would
|
||||
* be shown.
|
||||
*/
|
||||
bool needs_full_redraw() const { return true; }
|
||||
|
||||
/***** ***** ***** setters / getters for members ***** ****** *****/
|
||||
|
||||
void set_map_data(const std::string& map_data)
|
||||
|
|
|
@ -437,7 +437,6 @@ void tcontrol_definition::load_resolutions(const config::child_list& resolution_
|
|||
}
|
||||
|
||||
tstate_definition::tstate_definition(const config* cfg) :
|
||||
full_redraw(cfg ? utils::string_bool((*cfg)["full_redraw"]) : false),
|
||||
canvas()
|
||||
{
|
||||
/*WIKI
|
||||
|
@ -450,9 +449,6 @@ tstate_definition::tstate_definition(const config* cfg) :
|
|||
* Atm this is rather focussed on the drawing part, might change later.
|
||||
* Keys:
|
||||
* @start_table = config
|
||||
* full_redraw (bool = false) Does this state need a full redraw when
|
||||
* it's being drawn? Normally only required
|
||||
* if the widget is (partly) transparent.
|
||||
* draw (section) Section with drawing directions for a canvas.
|
||||
* @end_table
|
||||
*
|
||||
|
@ -755,8 +751,6 @@ tminimap_definition::tresolution::tresolution(const config& cfg) :
|
|||
* == Minimap ==
|
||||
*
|
||||
* The definition of a normal minimap.
|
||||
* NOTE in the draw section of the minimap the value of full_redraw is ignored,
|
||||
* the minimap is always fully redrawn.
|
||||
*
|
||||
* The following states exist:
|
||||
* * state_enabled, the minimap is enabled.
|
||||
|
@ -1049,8 +1043,7 @@ ttoggle_panel_definition::tresolution::tresolution(const config& cfg) :
|
|||
top_border(lexical_cast_default<unsigned>(cfg["top_border"])),
|
||||
bottom_border(lexical_cast_default<unsigned>(cfg["bottom_border"])),
|
||||
left_border(lexical_cast_default<unsigned>(cfg["left_border"])),
|
||||
right_border(lexical_cast_default<unsigned>(cfg["right_border"])),
|
||||
state_change_full_redraw(utils::string_bool(cfg["state_change_full_redraw"], true))
|
||||
right_border(lexical_cast_default<unsigned>(cfg["right_border"]))
|
||||
{
|
||||
/*WIKI
|
||||
* @page = GUIToolkitWML
|
||||
|
@ -1068,15 +1061,6 @@ ttoggle_panel_definition::tresolution::tresolution(const config& cfg) :
|
|||
* bottom_border (unsigned = 0) The size which isn't used for the client area.
|
||||
* left_border (unsigned = 0) The size which isn't used for the client area.
|
||||
* right_border (unsigned = 0) The size which isn't used for the client area.
|
||||
* state_change_full_redraw (bool = true)
|
||||
* When the state of the toggle panel changes
|
||||
* it can change it's background. If that
|
||||
* happens all child items need to redraw
|
||||
* themselves and need to modify their cached
|
||||
* background. Set this variable to true if
|
||||
* that's the case, in case of doubt set it to
|
||||
* true, it might give a small performance hit
|
||||
* but the drawing will always be correct.
|
||||
* @end_table
|
||||
*
|
||||
* The following layers exist:
|
||||
|
|
|
@ -85,8 +85,6 @@ private:
|
|||
public:
|
||||
tstate_definition(const config* cfg);
|
||||
|
||||
bool full_redraw;
|
||||
|
||||
tcanvas canvas;
|
||||
};
|
||||
|
||||
|
@ -329,8 +327,6 @@ struct ttoggle_panel_definition : public tcontrol_definition
|
|||
|
||||
unsigned left_border;
|
||||
unsigned right_border;
|
||||
|
||||
bool state_change_full_redraw;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -159,10 +159,6 @@ void ttoggle_panel::set_state(const tstate state)
|
|||
boost::intrusive_ptr<const ttoggle_panel_definition::tresolution> conf =
|
||||
boost::dynamic_pointer_cast<const ttoggle_panel_definition::tresolution>(config());
|
||||
assert(conf);
|
||||
|
||||
if(conf->state_change_full_redraw) {
|
||||
set_background_changed();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace gui2
|
||||
|
|
|
@ -195,14 +195,6 @@ public:
|
|||
/** Inherited from twidget. */
|
||||
tdialog* dialog() { return owner_; }
|
||||
|
||||
/**
|
||||
* Inherited from tcontrol.
|
||||
*
|
||||
* @todo See whether we're required or simply can inherit. If needed we need
|
||||
* to be implemented properly
|
||||
*/
|
||||
bool needs_full_redraw() const { return false; }
|
||||
|
||||
/** Inherited from tcontainer_. */
|
||||
twidget* find_widget(const std::string& id, const bool must_be_active)
|
||||
{ return tcontainer_::find_widget(id, must_be_active); }
|
||||
|
|
Loading…
Add table
Reference in a new issue