diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-06-27 17:08:16 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-06-27 17:08:16 +0200 |
commit | f662e0714773b49807ecf33fcbe620fc7dd3b9c7 (patch) | |
tree | 04a90e81a921d2e7787b9a5baf2e7c567b7300f4 | |
parent | 7907ef835d17cd01c14203c239dc017cbe8605a3 (diff) | |
parent | 04f6435aa86ffa63e1fec915f5bd6715a4ddf05c (diff) | |
download | redot-engine-f662e0714773b49807ecf33fcbe620fc7dd3b9c7.tar.gz |
Merge pull request #92504 from ckaiser/audiostreamplayer-light-mode
Fix AudioStreamPlayer icons, improve audio resource picker styling
-rw-r--r-- | editor/editor_resource_picker.cpp | 8 | ||||
-rw-r--r-- | editor/icons/AudioStreamPlayer.svg | 2 | ||||
-rw-r--r-- | editor/icons/AudioStreamPlayer2D.svg | 2 | ||||
-rw-r--r-- | editor/icons/AudioStreamPlayer3D.svg | 2 |
4 files changed, 6 insertions, 8 deletions
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index a895219e6f..4cd44e3020 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -1065,7 +1065,7 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) { } edit_button = memnew(Button); - edit_button->set_flat(true); + edit_button->set_flat(false); edit_button->set_toggle_mode(true); edit_button->connect(SceneStringName(pressed), callable_mp(this, &EditorResourcePicker::_update_menu)); add_child(edit_button); @@ -1268,8 +1268,6 @@ void EditorAudioStreamPicker::_preview_draw() { if (audio_stream->get_length() > 0 && size.width > 0) { rect.size.height *= 0.5; - stream_preview_rect->draw_rect(rect, Color(0, 0, 0, 1)); - Ref<AudioStreamPreview> preview = AudioStreamPreviewGenerator::get_singleton()->generate_preview(audio_stream); float preview_len = preview->get_length(); @@ -1325,8 +1323,8 @@ void EditorAudioStreamPicker::_preview_draw() { text = audio_stream->get_class().replace_first("AudioStream", ""); } - stream_preview_rect->draw_texture(icon, Point2i(EDSCALE * 2, rect.position.y + (rect.size.height - icon->get_height()) / 2), icon_modulate); - stream_preview_rect->draw_string(font, Point2i(EDSCALE * 2 + icon->get_width(), rect.position.y + font->get_ascent(font_size) + (rect.size.height - font->get_height(font_size)) / 2), text, HORIZONTAL_ALIGNMENT_CENTER, size.width - 4 * EDSCALE - icon->get_width()); + stream_preview_rect->draw_texture(icon, Point2i(EDSCALE * 4, rect.position.y + (rect.size.height - icon->get_height()) / 2), icon_modulate); + stream_preview_rect->draw_string(font, Point2i(EDSCALE * 4 + icon->get_width(), rect.position.y + font->get_ascent(font_size) + (rect.size.height - font->get_height(font_size)) / 2), text, HORIZONTAL_ALIGNMENT_CENTER, size.width - 4 * EDSCALE - icon->get_width(), font_size, get_theme_color(SNAME("font_color"), EditorStringName(Editor))); } EditorAudioStreamPicker::EditorAudioStreamPicker() : diff --git a/editor/icons/AudioStreamPlayer.svg b/editor/icons/AudioStreamPlayer.svg index 98a1650f6f..a3c4ad8e35 100644 --- a/editor/icons/AudioStreamPlayer.svg +++ b/editor/icons/AudioStreamPlayer.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="16" height="16" version="1.0" viewBox="0 0 2.4 2.4"><path fill="#e0e0e0" stroke="#e0e0e0" stroke-linejoin="round" stroke-width=".176" d="M1.382.335.777.858H.204v.673h.564l.614.531Z"/><path fill="none" stroke="#e0e0e0" stroke-linecap="round" stroke-width=".176" d="M1.718.572c.275.374.275.882 0 1.256M1.947.343c.402.5.402 1.213 0 1.714"/></svg>
\ No newline at end of file +<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="16" height="16" version="1.0" viewBox="0 0 2.4 2.4"><path fill="#e0e0e0" stroke="#e0e0e0" stroke-linejoin="round" stroke-width=".176" d="M1.382.335.777.858H.204v.673h.564l.614.531Z"/><path fill="none" stroke="#e0e0e0" stroke-linecap="round" stroke-width=".176" d="M1.718.572a1.06 1.06 0 0 1 0 1.256M1.947.343c.402.5.402 1.213 0 1.714"/></svg>
\ No newline at end of file diff --git a/editor/icons/AudioStreamPlayer2D.svg b/editor/icons/AudioStreamPlayer2D.svg index 3a5c5c29af..fa60e30238 100644 --- a/editor/icons/AudioStreamPlayer2D.svg +++ b/editor/icons/AudioStreamPlayer2D.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="16" height="16" version="1.0" viewBox="0 0 2.4 2.4"><path fill="#8da5f3" stroke="#8da5f3" stroke-linejoin="round" stroke-width=".176" d="M1.382.335.777.858H.204v.673h.564l.614.531Z"/><path fill="none" stroke="#8da5f3" stroke-linecap="round" stroke-width=".176" d="M1.718.572c.275.374.275.882 0 1.256M1.947.343c.402.5.402 1.213 0 1.714"/></svg>
\ No newline at end of file +<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="16" height="16" version="1.0" viewBox="0 0 2.4 2.4"><path fill="#8da5f3" stroke="#8da5f3" stroke-linejoin="round" stroke-width=".176" d="M1.382.335.777.858H.204v.673h.564l.614.531Z"/><path fill="none" stroke="#8da5f3" stroke-linecap="round" stroke-width=".176" d="M1.718.572a1.06 1.06 0 0 1 0 1.256M1.947.343c.402.5.402 1.213 0 1.714"/></svg>
\ No newline at end of file diff --git a/editor/icons/AudioStreamPlayer3D.svg b/editor/icons/AudioStreamPlayer3D.svg index c0480d0c7d..f6be929e61 100644 --- a/editor/icons/AudioStreamPlayer3D.svg +++ b/editor/icons/AudioStreamPlayer3D.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="16" height="16" version="1.0" viewBox="0 0 2.4 2.4"><path fill="#fc7f7f" stroke="#fc7f7f" stroke-linejoin="round" stroke-width=".176" d="M1.382.335.777.858H.204v.673h.564l.614.531Z"/><path fill="none" stroke="#fc7f7f" stroke-linecap="round" stroke-width=".176" d="M1.718.572c.275.374.275.882 0 1.256M1.947.343c.402.5.402 1.213 0 1.714"/></svg>
\ No newline at end of file +<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="16" height="16" version="1.0" viewBox="0 0 2.4 2.4"><path fill="#fc7f7f" stroke="#fc7f7f" stroke-linejoin="round" stroke-width=".176" d="M1.382.335.777.858H.204v.673h.564l.614.531Z"/><path fill="none" stroke="#fc7f7f" stroke-linecap="round" stroke-width=".176" d="M1.718.572a1.06 1.06 0 0 1 0 1.256M1.947.343c.402.5.402 1.213 0 1.714"/></svg>
\ No newline at end of file |