diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_properties.cpp | 2 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 41 | ||||
-rw-r--r-- | editor/plugins/theme_editor_plugin.cpp | 5 | ||||
-rw-r--r-- | editor/plugins/theme_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_atlas_view.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 14 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 16 |
7 files changed, 51 insertions, 33 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 6638962c72..ee55ec4c0b 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -951,7 +951,7 @@ void EditorPropertyEasing::_drag_easing(const Ref<InputEvent> &p_ev) { const Ref<InputEventMouseMotion> mm = p_ev; - if (mm.is_valid() && mm->get_button_mask() & MOUSE_BUTTON_MASK_LEFT) { + if (dragging && mm.is_valid() && mm->get_button_mask() & MOUSE_BUTTON_MASK_LEFT) { float rel = mm->get_relative().x; if (rel == 0) { return; diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index d5ad638436..2c4f4e2973 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -560,9 +560,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { style_tab_unselected->set_bg_color(dark_color_1); style_tab_unselected->set_expand_margin_size(SIDE_BOTTOM, 0); // Add some spacing between unselected tabs to make them easier to distinguish from each other - style_tab_unselected->set_border_color(dark_color_2); - style_tab_unselected->set_border_width(SIDE_LEFT, Math::round(2 * EDSCALE)); - style_tab_unselected->set_border_width(SIDE_RIGHT, Math::round(2 * EDSCALE)); + style_tab_unselected->set_border_color(Color(0, 0, 0, 0)); + style_tab_unselected->set_border_width(SIDE_LEFT, Math::round(1 * EDSCALE)); + style_tab_unselected->set_border_width(SIDE_RIGHT, Math::round(1 * EDSCALE)); + style_tab_unselected->set_default_margin(SIDE_LEFT, widget_default_margin.x + 2 * EDSCALE); + style_tab_unselected->set_default_margin(SIDE_RIGHT, widget_default_margin.x + 2 * EDSCALE); Ref<StyleBoxFlat> style_tab_disabled = style_tab_selected->duplicate(); style_tab_disabled->set_bg_color(disabled_bg_color); @@ -597,15 +599,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("focus", "MenuButton", style_menu); theme->set_stylebox("disabled", "MenuButton", style_menu); - theme->set_stylebox("normal", "PopupMenu", style_menu); - - Ref<StyleBoxFlat> style_menu_hover = style_widget_hover->duplicate(); - // Don't use rounded corners for hover highlights since the StyleBox touches the PopupMenu's edges. - style_menu_hover->set_corner_radius_all(0); - theme->set_stylebox("hover", "PopupMenu", style_menu_hover); - theme->set_stylebox("focus", "PopupMenu", style_menu); - theme->set_stylebox("disabled", "PopupMenu", style_menu); - theme->set_color("font_color", "MenuButton", font_color); theme->set_color("font_hover_color", "MenuButton", font_hover_color); @@ -711,8 +704,16 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { style_popup_menu->set_default_margin(SIDE_TOP, popup_menu_margin_size); style_popup_menu->set_default_margin(SIDE_RIGHT, 1 * EDSCALE); style_popup_menu->set_default_margin(SIDE_BOTTOM, popup_menu_margin_size); - + // Always display a border for PopupMenus so they can be distinguished from their background. + style_popup_menu->set_border_width_all(1 * EDSCALE); + style_popup_menu->set_border_color(dark_color_2); theme->set_stylebox("panel", "PopupMenu", style_popup_menu); + + Ref<StyleBoxFlat> style_menu_hover = style_widget_hover->duplicate(); + // Don't use rounded corners for hover highlights since the StyleBox touches the PopupMenu's edges. + style_menu_hover->set_corner_radius_all(0); + theme->set_stylebox("hover", "PopupMenu", style_menu_hover); + theme->set_stylebox("separator", "PopupMenu", style_popup_separator); theme->set_stylebox("labeled_separator_left", "PopupMenu", style_popup_labeled_separator_left); theme->set_stylebox("labeled_separator_right", "PopupMenu", style_popup_labeled_separator_right); @@ -929,6 +930,10 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { style_content_panel->set_default_margin(SIDE_RIGHT, margin_size_extra * EDSCALE); style_content_panel->set_default_margin(SIDE_BOTTOM, margin_size_extra * EDSCALE); style_content_panel->set_default_margin(SIDE_LEFT, margin_size_extra * EDSCALE); + // Display border to visually split the body of the container from its possible backgrounds. + style_content_panel->set_border_width(Side::SIDE_TOP, Math::round(2 * EDSCALE)); + style_content_panel->set_border_color(dark_color_2); + theme->set_stylebox("panel", "TabContainer", style_content_panel); // this is the stylebox used in 3d and 2d viewports (no borders) Ref<StyleBoxFlat> style_content_panel_vp = style_content_panel->duplicate(); @@ -936,9 +941,17 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { style_content_panel_vp->set_default_margin(SIDE_TOP, default_margin_size * EDSCALE); style_content_panel_vp->set_default_margin(SIDE_RIGHT, border_width * 2); style_content_panel_vp->set_default_margin(SIDE_BOTTOM, border_width * 2); - theme->set_stylebox("panel", "TabContainer", style_content_panel); theme->set_stylebox("Content", "EditorStyles", style_content_panel_vp); + // These styleboxes can be used on tabs against the base color background (e.g. nested tabs). + Ref<StyleBoxFlat> style_tab_selected_odd = style_tab_selected->duplicate(); + style_tab_selected_odd->set_bg_color(disabled_bg_color); + theme->set_stylebox("tab_selected_odd", "TabContainer", style_tab_selected_odd); + + Ref<StyleBoxFlat> style_content_panel_odd = style_content_panel->duplicate(); + style_content_panel_odd->set_bg_color(disabled_bg_color); + theme->set_stylebox("panel_odd", "TabContainer", style_content_panel_odd); + // Separators theme->set_stylebox("separator", "HSeparator", make_line_stylebox(separator_color, MAX(Math::round(EDSCALE), border_width))); theme->set_stylebox("separator", "VSeparator", make_line_stylebox(separator_color, MAX(Math::round(EDSCALE), border_width), 0, 0, true)); diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 36c1bf3a09..0f7468bead 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -1694,6 +1694,9 @@ void ThemeItemEditorDialog::_notification(int p_what) { edit_items_remove_all->set_icon(get_theme_icon("ThemeRemoveAllItems", "EditorIcons")); import_another_theme_button->set_icon(get_theme_icon("Folder", "EditorIcons")); + + tc->add_theme_style_override("tab_selected", get_theme_stylebox("tab_selected_odd", "TabContainer")); + tc->add_theme_style_override("panel", get_theme_stylebox("panel_odd", "TabContainer")); } break; } } @@ -1707,7 +1710,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog() { get_ok_button()->set_text(TTR("Close")); set_hide_on_ok(false); // Closing may require a confirmation in some cases. - TabContainer *tc = memnew(TabContainer); + tc = memnew(TabContainer); tc->set_tab_align(TabContainer::TabAlign::ALIGN_LEFT); add_child(tc); diff --git a/editor/plugins/theme_editor_plugin.h b/editor/plugins/theme_editor_plugin.h index 5f4de68f45..c42ebf1a19 100644 --- a/editor/plugins/theme_editor_plugin.h +++ b/editor/plugins/theme_editor_plugin.h @@ -181,6 +181,8 @@ class ThemeItemEditorDialog : public AcceptDialog { Ref<Theme> edited_theme; + TabContainer *tc; + ItemList *edit_type_list; LineEdit *edit_add_type_value; String edited_item_type; diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp index 4de2f962bc..4f7eabac24 100644 --- a/editor/plugins/tiles/tile_atlas_view.cpp +++ b/editor/plugins/tiles/tile_atlas_view.cpp @@ -575,7 +575,7 @@ TileAtlasView::TileAtlasView() { // Base tiles. Label *base_tile_label = memnew(Label); - base_tile_label->set_text(TTR("Base tiles")); + base_tile_label->set_text(TTR("Base Tiles")); base_tile_label->set_align(Label::ALIGN_CENTER); left_vbox->add_child(base_tile_label); @@ -623,7 +623,7 @@ TileAtlasView::TileAtlasView() { // Alternative tiles. Label *alternative_tiles_label = memnew(Label); - alternative_tiles_label->set_text(TTR("Alternative tiles")); + alternative_tiles_label->set_text(TTR("Alternative Tiles")); alternative_tiles_label->set_align(Label::ALIGN_CENTER); right_vbox->add_child(alternative_tiles_label); diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index cfc4dff329..5937472e2b 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -154,10 +154,10 @@ void TileMapEditorTilesPlugin::_update_tile_set_sources_list() { if (texture.is_valid()) { sources_list->add_item(vformat("%s - (id:%d)", texture->get_path().get_file(), source_id), texture); } else { - sources_list->add_item(vformat("No texture atlas source - (id:%d)", source_id), missing_texture_texture); + sources_list->add_item(vformat("No Texture Atlas Source - (id:%d)", source_id), missing_texture_texture); } } else { - sources_list->add_item(vformat("Unknown type source - (id:%d)", source_id), missing_texture_texture); + sources_list->add_item(vformat("Unknown Type Source - (id:%d)", source_id), missing_texture_texture); } sources_list->set_item_metadata(i, source_id); } @@ -1671,7 +1671,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { // Random tile checkbox. random_tile_checkbox = memnew(CheckBox); random_tile_checkbox->set_flat(true); - random_tile_checkbox->set_text(TTR("Place random tile")); + random_tile_checkbox->set_text(TTR("Place Random Tile")); random_tile_checkbox->connect("toggled", callable_mp(this, &TileMapEditorTilesPlugin::_on_random_tile_checkbox_toggled)); tools_settings->add_child(random_tile_checkbox); @@ -2798,15 +2798,15 @@ void TileMapEditorTerrainsPlugin::_update_terrains_tree() { String matches; if (tile_set->get_terrain_set_mode(terrain_set_index) == TileSet::TERRAIN_MODE_MATCH_CORNERS_AND_SIDES) { terrain_set_tree_item->set_icon(0, get_theme_icon("TerrainMatchCornersAndSides", "EditorIcons")); - matches = String(TTR("Matches corners and sides")); + matches = String(TTR("Matches Corners and Sides")); } else if (tile_set->get_terrain_set_mode(terrain_set_index) == TileSet::TERRAIN_MODE_MATCH_CORNERS) { terrain_set_tree_item->set_icon(0, get_theme_icon("TerrainMatchCorners", "EditorIcons")); - matches = String(TTR("Matches corners only")); + matches = String(TTR("Matches Corners Only")); } else { terrain_set_tree_item->set_icon(0, get_theme_icon("TerrainMatchSides", "EditorIcons")); - matches = String(TTR("Matches sides only")); + matches = String(TTR("Matches Sides Only")); } - terrain_set_tree_item->set_text(0, vformat("Terrain set %d (%s)", terrain_set_index, matches)); + terrain_set_tree_item->set_text(0, vformat("Terrain Set %d (%s)", terrain_set_index, matches)); terrain_set_tree_item->set_selectable(0, false); for (int terrain_index = 0; terrain_index < tile_set->get_terrains_count(terrain_set_index); terrain_index++) { diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 8492202122..69abbb29f1 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -1669,7 +1669,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { // Tile inspector. tile_inspector_label = memnew(Label); - tile_inspector_label->set_text(TTR("Tile properties:")); + tile_inspector_label->set_text(TTR("Tile Properties:")); tile_inspector_label->hide(); middle_vbox_container->add_child(tile_inspector_label); @@ -1686,7 +1686,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { // Atlas source inspector. atlas_source_inspector_label = memnew(Label); - atlas_source_inspector_label->set_text(TTR("Atlas properties:")); + atlas_source_inspector_label->set_text(TTR("Atlas Properties:")); middle_vbox_container->add_child(atlas_source_inspector_label); atlas_source_proxy_object = memnew(TileSetAtlasSourceProxyObject()); @@ -1724,7 +1724,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tool_select_button->set_toggle_mode(true); tool_select_button->set_pressed(true); tool_select_button->set_button_group(tools_button_group); - tool_select_button->set_tooltip(TTR("Select tiles")); + tool_select_button->set_tooltip(TTR("Select tiles.")); tool_select_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_fix_selected_and_hovered_tiles)); tool_select_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_id_label)); tool_select_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_inspector)); @@ -1736,7 +1736,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tool_add_remove_button->set_flat(true); tool_add_remove_button->set_toggle_mode(true); tool_add_remove_button->set_button_group(tools_button_group); - tool_add_remove_button->set_tooltip(TTR("Add/Remove tiles tool (use the shift key to create big tiles)")); + tool_add_remove_button->set_tooltip(TTR("Add/Remove tiles tool (use the shift key to create big tiles).")); tool_add_remove_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_fix_selected_and_hovered_tiles)); tool_add_remove_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_id_label)); tool_add_remove_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_inspector)); @@ -1748,7 +1748,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tool_add_remove_rect_button->set_flat(true); tool_add_remove_rect_button->set_toggle_mode(true); tool_add_remove_rect_button->set_button_group(tools_button_group); - tool_add_remove_rect_button->set_tooltip(TTR("Add/Remove tiles rectangle tool (use the shift key to create big tiles)")); + tool_add_remove_rect_button->set_tooltip(TTR("Add/Remove tiles rectangle tool (use the shift key to create big tiles).")); tool_add_remove_rect_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_fix_selected_and_hovered_tiles)); tool_add_remove_rect_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_id_label)); tool_add_remove_rect_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_inspector)); @@ -1775,10 +1775,10 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tool_advanced_menu_buttom = memnew(MenuButton); tool_advanced_menu_buttom->set_flat(true); - tool_advanced_menu_buttom->get_popup()->add_item(TTR("Cleanup tiles outside texture"), ADVANCED_CLEANUP_TILES_OUTSIDE_TEXTURE); + tool_advanced_menu_buttom->get_popup()->add_item(TTR("Cleanup Tiles Outside Texture"), ADVANCED_CLEANUP_TILES_OUTSIDE_TEXTURE); tool_advanced_menu_buttom->get_popup()->set_item_disabled(0, true); - tool_advanced_menu_buttom->get_popup()->add_item(TTR("Create tiles in non-transparent texture regions."), ADVANCED_AUTO_CREATE_TILES); - tool_advanced_menu_buttom->get_popup()->add_item(TTR("Remove tiles in fully transparent texture regions."), ADVANCED_AUTO_REMOVE_TILES); + tool_advanced_menu_buttom->get_popup()->add_item(TTR("Create Tiles in Non-Transparent Texture Regions"), ADVANCED_AUTO_CREATE_TILES); + tool_advanced_menu_buttom->get_popup()->add_item(TTR("Remove Tiles in Fully Transparent Texture Regions"), ADVANCED_AUTO_REMOVE_TILES); tool_advanced_menu_buttom->get_popup()->connect("id_pressed", callable_mp(this, &TileSetAtlasSourceEditor::_menu_option)); toolbox->add_child(tool_advanced_menu_buttom); |