Revert "timage: allowed use of width/height keys for specific image size"

This reverts commit 05340bb81f.
This commit is contained in:
Charles Dang 2016-08-15 14:30:49 +11:00
parent ddc8d84c06
commit 156ac4cf93
4 changed files with 2 additions and 43 deletions

View file

@ -1477,16 +1477,6 @@
min="0"
max="-1"
super="generic/widget_instance"
[key]
name="width"
type="unsigned"
default=0
[/key]
[key]
name="height"
type="unsigned"
default=0
[/key]
[/tag]
[tag]
name="instance"

View file

@ -24,8 +24,6 @@
[image]
name = "(text)"
w = "(width)"
h = "(height)"
[/image]
[/draw]

View file

@ -49,9 +49,6 @@ tpoint timage::calculate_best_size() const
const tpoint maximum = get_config_maximum_size();
tpoint result = {image->w, image->h};
if(best_size_ != tpoint()) {
result = best_size_;
}
if(minimum.x > 0 && result.x < minimum.x) {
DBG_GUI_L << LOG_HEADER << " increase width to minimum.\n";
@ -165,10 +162,7 @@ timage_definition::tresolution::tresolution(const config& cfg)
namespace implementation
{
tbuilder_image::tbuilder_image(const config& cfg)
: tbuilder_control(cfg)
, width(cfg["width"])
, height(cfg["height"])
tbuilder_image::tbuilder_image(const config& cfg) : tbuilder_control(cfg)
{
}
@ -178,15 +172,6 @@ twidget* tbuilder_image::build() const
init_control(widget);
const game_logic::map_formula_callable& size = get_screen_size_variables();
const unsigned w = width(size);
const unsigned h = height(size);
if(w || h) {
widget->set_best_size(tpoint(w, h));
}
DBG_GUI_G << "Window builder: placed image '" << id << "' with definition '"
<< definition << "'.\n";

View file

@ -29,7 +29,7 @@ namespace gui2
class timage : public tcontrol
{
public:
timage() : tcontrol(COUNT), best_size_(0, 0)
timage() : tcontrol(COUNT)
{
}
@ -61,11 +61,6 @@ public:
virtual bool can_mouse_focus() const override { return !tooltip().empty(); }
void set_best_size(const tpoint& best_size)
{
best_size_ = best_size;
}
/***** ***** ***** ***** layout functions ***** ***** ***** *****/
private:
@ -98,9 +93,6 @@ private:
COUNT
};
/** When we're used as a fixed size item, this holds the best size. */
tpoint best_size_;
/** See @ref tcontrol::get_control_type. */
virtual const std::string& get_control_type() const override;
};
@ -128,12 +120,6 @@ struct tbuilder_image : public tbuilder_control
using tbuilder_control::build;
/** The width of the widget. */
tformula<unsigned> width;
/** The height of the widget. */
tformula<unsigned> height;
twidget* build() const;
};