From e58db5592e07238681a11e2cb9d2088faacd2602 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 27 Oct 2021 17:09:32 +0100 Subject: [PATCH] ThemeEditor: Update value edit boxes when loading a theme file Previously, these would continue to show the previously entered values, until you interacted with the ComboBoxes. --- Userland/Applications/ThemeEditor/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp index 2cf4224f54..8755dd774c 100644 --- a/Userland/Applications/ThemeEditor/main.cpp +++ b/Userland/Applications/ThemeEditor/main.cpp @@ -173,6 +173,12 @@ int main(int argc, char** argv) preview_widget.on_theme_load_from_file = [&](String const& new_path) { path = new_path; update_window_title(); + + auto selected_color_role = color_combo_box.model()->index(color_combo_box.selected_index()).data(GUI::ModelRole::Custom).to_color_role(); + color_input.set_color(preview_widget.preview_palette().color(selected_color_role)); + + auto selected_metric_role = metric_combo_box.model()->index(metric_combo_box.selected_index()).data(GUI::ModelRole::Custom).to_metric_role(); + metric_input.set_value(preview_widget.preview_palette().metric(selected_metric_role), GUI::AllowCallback::No); }; auto save_to_result = [&](FileSystemAccessClient::Result const& result) {