gui.utils.settings_helper

File:

EuljiroBible/gui/utils/settings_helper.py

Author:

Benjamin Jaedon Choi - https://github.com/saintbenjamin

Affiliated Church:

The Eulji-ro Presbyterian Church [대한예수교장로회(통합) 을지로교회]

Address:

The Eulji-ro Presbyterian Church, 24-10, Eulji-ro 20-gil, Jung-gu, Seoul 04549, South Korea

Telephone:

+82-2-2266-3070

E-mail:

euljirochurch [at] G.M.A.I.L. (replace [at] with @ and G.M.A.I.L as you understood.)

License:

MIT License with Attribution Requirement (see LICENSE file for details); Copyright (c) 2025 The Eulji-ro Presbyterian Church.

Provides helper functions for extracting and updating settings based on user interface widget states, especially overlay-related UI components.

gui.utils.settings_helper.update_overlay_settings(settings, widget_overlays)[source]

Collect overlay display settings from UI widgets and update the settings dictionary.

This function reads the current state of overlay-related UI controls (font, size, weight, colors, transparency, and display mode) and writes their values into the provided settings dictionary using standardized keys.

It is designed to be called whenever overlay UI controls change, ensuring that runtime behavior and persisted configuration remain consistent.

Parameters:
  • settings (dict) – Application settings dictionary to update in-place.

  • widget_overlays (dict) –

    Mapping of overlay-related UI widgets. Expected keys and widget types:

    • ”font_family_combo” (QComboBox | QFontComboBox):

      Font family selector.

    • ”font_size_combo” (QComboBox):

      Font size selector (text convertible to int).

    • ”font_weight_combo” (QComboBox):

      Font weight selector (Qt weight stored as item data).

    • ”alpha_slider” (QSlider):

      Background transparency slider (0–100).

    • ”text_color_btn” (QPushButton):

      Button whose palette color represents text color.

    • ”bg_color_btn” (QPushButton):

      Button whose palette color represents background color.

    • ”mode_combo” (QComboBox):

      Overlay mode selector (index 0 = fullscreen, 1 = resizable).

Returns:

The updated settings dictionary containing overlay display configuration.

Return type:

dict