Skip to content

Refactor theme settings dialog into a two-column editor#899

Merged
multiplex55 merged 1 commit intomasterfrom
codex/refactor-theme-settings-dialog-ui-layout
Feb 20, 2026
Merged

Refactor theme settings dialog into a two-column editor#899
multiplex55 merged 1 commit intomasterfrom
codex/refactor-theme-settings-dialog-ui-layout

Conversation

@multiplex55
Copy link
Owner

Motivation

  • Reduce excessive vertical stacking in the Theme settings dialog and make related controls readable side-by-side.
  • Improve color-row compactness for easier comparison and editing of RGBA values.
  • Keep existing section-level "Reset section defaults" semantics and the action bar behavior unchanged while making reset logic clearer.
  • Add unit tests for non-UI logic to guard against regressions in defaults and section resets.

Description

  • Widened the Theme settings window by changing the default width to 980.0 and reorganized the content into a two-column layout using ui.columns(2, ...) in src/gui/theme_settings_dialog.rs.
  • Placed section_base_mode, section_core_surfaces, and section_text_and_links in the left column, and section_widgets, section_selection, section_semantic plus preview in the right column.
  • Extracted section-reset logic into focused helpers (reset_core_surfaces_to_mode_defaults, reset_text_and_links_to_mode_defaults, reset_widgets_to_mode_defaults, reset_selection_to_mode_defaults, reset_semantic_to_mode_defaults) and wired existing "Reset section defaults" buttons to these helpers without changing their semantics.
  • Made color_row(...) more compact by adding a fixed LABEL_WIDTH, setting a minimum row height, and tightening horizontal spacing while preserving color_edit_button_srgba RGBA editing behavior.
  • Added a #[cfg(test)] mod tests with unit tests that cover defaults_for_mode(...) and regression tests asserting each section-reset helper updates only its intended fields.

Testing

  • Ran cargo fmt --all which completed successfully.
  • Executed cargo test theme_settings_dialog -- --nocapture but the build failed due to a missing system dependency required by a transitive crate (alsa-sys failed looking up alsa.pc via pkg-config), so the newly added unit tests could not be run in this environment.
  • The added tests are pure logic/state-transition checks and should pass in a development environment where system dependencies for the full crate build are available.

Codex Task

@multiplex55 multiplex55 merged commit 688e9a6 into master Feb 20, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/refactor-theme-settings-dialog-ui-layout branch February 20, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant