GUI2: used widget
class specifier to refer to visibility in all places
Since both styled_widget and window inherit from widget, all usecases actually referred to the same thing, but this makes that much clearer.
This commit is contained in:
parent
99142b037c
commit
d5bd92304f
10 changed files with 17 additions and 17 deletions
|
@ -369,7 +369,7 @@ void addon_manager::pre_show(window& window)
|
|||
if(!desktop::open_object_is_supported()) {
|
||||
// No point in displaying the button on platforms that can't do
|
||||
// open_object().
|
||||
url_go_button.set_visible(styled_widget::visibility::invisible);
|
||||
url_go_button.set_visible(widget::visibility::invisible);
|
||||
}
|
||||
|
||||
connect_signal_mouse_left_click(
|
||||
|
|
|
@ -180,7 +180,7 @@ void game_version::pre_show(window& window)
|
|||
if(!desktop::open_object_is_supported()) {
|
||||
// No point in displaying these on platforms that can't do
|
||||
// open_object().
|
||||
browse_w.set_visible(styled_widget::visibility::invisible);
|
||||
browse_w.set_visible(widget::visibility::invisible);
|
||||
}
|
||||
|
||||
if(!desktop::clipboard::available()) {
|
||||
|
|
|
@ -261,7 +261,7 @@ void mp_create_game::pre_show(window& win)
|
|||
|
||||
// No mods, hide the header
|
||||
if(mod_list.get_item_count() <= 0) {
|
||||
find_widget<styled_widget>(&win, "mods_header", false).set_visible(window::visibility::invisible);
|
||||
find_widget<styled_widget>(&win, "mods_header", false).set_visible(widget::visibility::invisible);
|
||||
} else {
|
||||
on_mod_select(win);
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ int mp_options_helper::remove_nodes_for_type(const std::string& type)
|
|||
void mp_options_helper::update_status_label()
|
||||
{
|
||||
// No custom options, display a message
|
||||
no_options_notice_.set_visible(options_tree_.empty() ? window::visibility::visible : window::visibility::invisible);
|
||||
no_options_notice_.set_visible(options_tree_.empty() ? widget::visibility::visible : widget::visibility::invisible);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
|
@ -197,7 +197,7 @@ void preferences_dialog::update_friends_list_controls(window& window, listbox& l
|
|||
find_widget<button>(&window, "remove", false).set_active(!list_empty);
|
||||
|
||||
find_widget<label>(&window, "no_friends_notice", false).set_visible(
|
||||
list_empty ? window::visibility::visible : window::visibility::invisible);
|
||||
list_empty ? widget::visibility::visible : widget::visibility::invisible);
|
||||
}
|
||||
|
||||
void preferences_dialog::add_friend_list_entry(const bool is_friend, text_box& textbox, window& window)
|
||||
|
@ -575,11 +575,11 @@ void preferences_dialog::post_build(window& window)
|
|||
assert(main_grid);
|
||||
|
||||
grid& details_grid = find_widget<grid>(main_grid, "prefs_setter_grid", false);
|
||||
details_grid.set_visible(styled_widget::visibility::invisible);
|
||||
details_grid.set_visible(widget::visibility::invisible);
|
||||
|
||||
// The toggle widget for toggle-type options (hidden for other types)
|
||||
toggle_button& toggle_box = find_widget<toggle_button>(main_grid, "value_toggle", false);
|
||||
toggle_box.set_visible(styled_widget::visibility::hidden);
|
||||
toggle_box.set_visible(widget::visibility::hidden);
|
||||
|
||||
if(!option["description"].empty()) {
|
||||
find_widget<styled_widget>(main_grid, "description", false).set_label(option["description"]);
|
||||
|
@ -589,7 +589,7 @@ void preferences_dialog::post_build(window& window)
|
|||
case ADVANCED_PREF_TYPE::TOGGLE: {
|
||||
//main_grid->remove_child("setter");
|
||||
|
||||
toggle_box.set_visible(styled_widget::visibility::visible);
|
||||
toggle_box.set_visible(widget::visibility::visible);
|
||||
toggle_box.set_value(get(pref_name, option["default"].to_bool()));
|
||||
|
||||
connect_signal_mouse_left_click(toggle_box, std::bind(
|
||||
|
@ -927,12 +927,12 @@ void preferences_dialog::on_advanced_prefs_list_select(listbox& list, window& wi
|
|||
|
||||
if(has_description || (selected_type != ADVANCED_PREF_TYPE::SPECIAL && selected_type != ADVANCED_PREF_TYPE::TOGGLE)) {
|
||||
find_widget<widget>(get_advanced_row_grid(list, selected_row), "prefs_setter_grid", false)
|
||||
.set_visible(styled_widget::visibility::visible);
|
||||
.set_visible(widget::visibility::visible);
|
||||
}
|
||||
|
||||
if(last_selected_item_ != selected_row) {
|
||||
find_widget<widget>(get_advanced_row_grid(list, last_selected_item_), "prefs_setter_grid", false)
|
||||
.set_visible(styled_widget::visibility::invisible);
|
||||
.set_visible(widget::visibility::invisible);
|
||||
|
||||
last_selected_item_ = selected_row;
|
||||
}
|
||||
|
|
|
@ -442,7 +442,7 @@ void title_screen::pre_show(window& win)
|
|||
});
|
||||
|
||||
if(game_config_manager::get()->game_config().child_range("core").size() <= 1) {
|
||||
find_widget<button>(&win, "cores", false).set_visible(window::visibility::invisible);
|
||||
find_widget<button>(&win, "cores", false).set_visible(widget::visibility::invisible);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -210,13 +210,13 @@ void wml_error::pre_show(window& window)
|
|||
{
|
||||
if(!have_files_) {
|
||||
styled_widget& filelist = find_widget<styled_widget>(&window, "files", false);
|
||||
filelist.set_visible(styled_widget::visibility::invisible);
|
||||
filelist.set_visible(widget::visibility::invisible);
|
||||
}
|
||||
|
||||
if(!have_post_summary_) {
|
||||
styled_widget& post_summary
|
||||
= find_widget<styled_widget>(&window, "post_summary", false);
|
||||
post_summary.set_visible(styled_widget::visibility::invisible);
|
||||
post_summary.set_visible(widget::visibility::invisible);
|
||||
}
|
||||
|
||||
button& copy_button = find_widget<button>(&window, "copy", false);
|
||||
|
|
|
@ -416,7 +416,7 @@ lobby_chat_window* chatbox::search_create_window(const std::string& name,
|
|||
std::bind(&chatbox::close_window_button_callback, this, open_windows_.back(), _3, _4));
|
||||
|
||||
if(!allow_close) {
|
||||
close_button.set_visible(styled_widget::visibility::hidden);
|
||||
close_button.set_visible(widget::visibility::hidden);
|
||||
}
|
||||
|
||||
return &open_windows_.back();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "gui/widgets/selectable_item.hpp"
|
||||
#include "gui/widgets/toggle_button.hpp"
|
||||
#include "gui/widgets/toggle_panel.hpp"
|
||||
#include "gui/widgets/window.hpp" // For window::visibility
|
||||
#include "gui/widgets/window.hpp" // For widget::visibility
|
||||
#include "wml_exception.hpp"
|
||||
|
||||
namespace gui2
|
||||
|
@ -658,7 +658,7 @@ public:
|
|||
virtual bool get_item_shown(const unsigned index) const override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
return items_[index]->shown && items_[index]->child_grid.get_visible() != window::visibility::invisible;
|
||||
return items_[index]->shown && items_[index]->child_grid.get_visible() != widget::visibility::invisible;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1396,7 +1396,7 @@ void window::signal_handler_click_dismiss(const event::ui_event event,
|
|||
static bool is_active(const widget* wgt)
|
||||
{
|
||||
if(const styled_widget* control = dynamic_cast<const styled_widget*>(wgt)) {
|
||||
return control->get_active() && control->get_visible() == window::visibility::visible;
|
||||
return control->get_active() && control->get_visible() == widget::visibility::visible;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue