本文整理汇总了C++中Popup::set_size方法的典型用法代码示例。如果您正苦于以下问题:C++ Popup::set_size方法的具体用法?C++ Popup::set_size怎么用?C++ Popup::set_size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Popup
的用法示例。
在下文中一共展示了Popup::set_size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _notification
void ColorPicker::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
btn_pick->set_icon(get_icon("screen_picker", "ColorPicker"));
bt_add_preset->set_icon(get_icon("add_preset"));
_update_controls();
} break;
case NOTIFICATION_ENTER_TREE: {
btn_pick->set_icon(get_icon("screen_picker", "ColorPicker"));
bt_add_preset->set_icon(get_icon("add_preset"));
_update_color();
#ifdef TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint()) {
PoolColorArray saved_presets = EditorSettings::get_singleton()->get_project_metadata("color_picker", "presets", PoolColorArray());
for (int i = 0; i < saved_presets.size(); i++) {
add_preset(saved_presets[i]);
}
}
#endif
} break;
case NOTIFICATION_PARENTED: {
for (int i = 0; i < 4; i++)
set_margin((Margin)i, get_constant("margin"));
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
Popup *p = Object::cast_to<Popup>(get_parent());
if (p)
p->set_size(Size2(get_combined_minimum_size().width + get_constant("margin") * 2, get_combined_minimum_size().height + get_constant("margin") * 2));
} break;
case MainLoop::NOTIFICATION_WM_QUIT_REQUEST: {
if (screen != NULL) {
if (screen->is_visible()) {
screen->hide();
}
}
} break;
}
}