Popups are now windows also (broken!)

This commit is contained in:
Juan Linietsky 2020-03-12 09:37:40 -03:00
parent 543fb1c4da
commit 441f1a5fe9
159 changed files with 3311 additions and 3285 deletions

View file

@ -215,20 +215,20 @@ void AnimationBezierTrackEdit::_draw_line_clipped(const Vector2 &p_from, const V
void AnimationBezierTrackEdit::_notification(int p_what) {
if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) {
bezier_icon = get_icon("KeyBezierPoint", "EditorIcons");
bezier_handle_icon = get_icon("KeyBezierHandle", "EditorIcons");
selected_icon = get_icon("KeyBezierSelected", "EditorIcons");
bezier_icon = get_theme_icon("KeyBezierPoint", "EditorIcons");
bezier_handle_icon = get_theme_icon("KeyBezierHandle", "EditorIcons");
selected_icon = get_theme_icon("KeyBezierSelected", "EditorIcons");
if (handle_mode_option->get_item_count() == 0) {
handle_mode_option->add_icon_item(get_icon("BezierHandlesFree", "EditorIcons"), TTR("Free"), HANDLE_MODE_FREE);
handle_mode_option->add_icon_item(get_icon("BezierHandlesBalanced", "EditorIcons"), TTR("Balanced"), HANDLE_MODE_BALANCED);
handle_mode_option->add_icon_item(get_icon("BezierHandlesMirror", "EditorIcons"), TTR("Mirror"), HANDLE_MODE_MIRROR);
handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesFree", "EditorIcons"), TTR("Free"), HANDLE_MODE_FREE);
handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesBalanced", "EditorIcons"), TTR("Balanced"), HANDLE_MODE_BALANCED);
handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesMirror", "EditorIcons"), TTR("Mirror"), HANDLE_MODE_MIRROR);
}
}
if (p_what == NOTIFICATION_RESIZED) {
int right_limit = get_size().width - timeline->get_buttons_width();
int hsep = get_constant("hseparation", "ItemList");
int vsep = get_constant("vseparation", "ItemList");
int hsep = get_theme_constant("hseparation", "ItemList");
int vsep = get_theme_constant("vseparation", "ItemList");
handle_mode_option->set_position(Vector2(right_limit + hsep, get_size().height - handle_mode_option->get_combined_minimum_size().height - vsep));
handle_mode_option->set_size(Vector2(timeline->get_buttons_width() - hsep * 2, handle_mode_option->get_combined_minimum_size().height));
@ -240,15 +240,15 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
int limit = timeline->get_name_limit();
if (has_focus()) {
Color accent = get_color("accent_color", "Editor");
Color accent = get_theme_color("accent_color", "Editor");
accent.a *= 0.7;
draw_rect(Rect2(Point2(), get_size()), accent, false);
}
Ref<Font> font = get_font("font", "Label");
Color color = get_color("font_color", "Label");
int hsep = get_constant("hseparation", "ItemList");
int vsep = get_constant("vseparation", "ItemList");
Ref<Font> font = get_theme_font("font", "Label");
Color color = get_theme_color("font_color", "Label");
int hsep = get_theme_constant("hseparation", "ItemList");
int vsep = get_theme_constant("vseparation", "ItemList");
Color linecolor = color;
linecolor.a = 0.2;
@ -258,7 +258,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
draw_line(Point2(right_limit, 0), Point2(right_limit, get_size().height), linecolor);
Ref<Texture2D> close_icon = get_icon("Close", "EditorIcons");
Ref<Texture2D> close_icon = get_theme_icon("Close", "EditorIcons");
close_icon_rect.position = Vector2(get_size().width - close_icon->get_width() - hsep, hsep);
close_icon_rect.size = close_icon->get_size();
@ -340,7 +340,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
subtracks[i] = rect;
} else {
Color ac = get_color("accent_color", "Editor");
Color ac = get_theme_color("accent_color", "Editor");
ac.a = 0.5;
draw_rect(rect, ac);
}
@ -349,7 +349,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
vofs += font->get_height() + vsep;
}
Color accent = get_color("accent_color", "Editor");
Color accent = get_theme_color("accent_color", "Editor");
{ //guides
float min_left_scale = font->get_height() + vsep;
@ -391,7 +391,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
{ //draw OTHER curves
float scale = timeline->get_zoom_scale();
Ref<Texture2D> point = get_icon("KeyValue", "EditorIcons");
Ref<Texture2D> point = get_theme_icon("KeyValue", "EditorIcons");
for (Map<int, Color>::Element *E = subtrack_colors.front(); E; E = E->next()) {
_draw_track(E->key(), E->get());
@ -410,7 +410,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
}
//draw edited curve
const Color highlight = get_color("highlight_color", "Editor");
const Color highlight = get_theme_color("highlight_color", "Editor");
_draw_track(track, highlight);
}
@ -540,7 +540,7 @@ void AnimationBezierTrackEdit::_play_position_draw() {
int px = (-timeline->get_value() + play_position_pos) * scale + timeline->get_name_limit();
if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) {
Color color = get_color("accent_color", "Editor");
Color color = get_theme_color("accent_color", "Editor");
play_position->draw_line(Point2(px, 0), Point2(px, h), color);
}
}
@ -657,9 +657,9 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
menu->add_icon_item(bezier_icon, TTR("Insert Key Here"), MENU_KEY_INSERT);
if (selection.size()) {
menu->add_separator();
menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Duplicate Selected Key(s)"), MENU_KEY_DUPLICATE);
menu->add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), TTR("Duplicate Selected Key(s)"), MENU_KEY_DUPLICATE);
menu->add_separator();
menu->add_icon_item(get_icon("Remove", "EditorIcons"), TTR("Delete Selected Key(s)"), MENU_KEY_DELETE);
menu->add_icon_item(get_theme_icon("Remove", "EditorIcons"), TTR("Delete Selected Key(s)"), MENU_KEY_DELETE);
}
menu->set_as_minsize();