Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
Settings Class Reference

App-wide UI settings: layout metrics, the colour palette, and font colours. More...

#include <settings.h>

Inheritance diagram for Settings:
Collaboration diagram for Settings:

Public Member Functions

 Settings (SaveFile *file)
void setColorScheme (QColor primary, QColor secondary)
 Recolour the palette at runtime.
int getPreviewTilesetIndex ()
 Index of previewTileset (backs the property).

Public Attributes

int headerHeight = 80
int headerShadowHeight = 20
bool infoBtnPressed = false
QString previewTileset = "Overworld"
bool previewOutdoor = true
QColor textColorLight = QColor("#efefef")
QColor textColorMid = QColor("#757575")
QColor textColorDark = QColor("#212121")
QColor primaryColor = QColor("#d81b60")
QColor primaryColorLight = QColor("#ff5c8d")
QColor primaryColorDark = QColor("#a00037")
QColor errorColor = QColor("red")
QColor dividerColor = QColor("#BDBDBD")
QColor accentColor = QColor("#607D8B")
QColor fontColorNormal = QColor("#616161")
QColor fontColorControl = QColor("#7B1FA2")
QColor fontColorPicture = QColor("#303F9F")
QColor fontColorSingle = QColor("#9E9D24")
QColor fontColorMulti = QColor("#FF6F00")
QColor fontColorVar = QColor("#388E3C")

Protected Member Functions

void dataChanged ()
 React to the save's data changing.

Protected Attributes

SaveFilefile
 The live save (held for data-reactive settings).

Detailed Description

App-wide UI settings: layout metrics, the colour palette, and font colours.

The single source of truth the QML reads for theming and layout – header sizing, the Material-style colour palette (text/primary/divider/accent), the per-font-category colours used by the keyboard, and the name-preview tileset choice. Exposed to QML as brg.settings. setColorScheme() recolours the palette at runtime; it holds the SaveFile so a few settings can react to data changes.

See also
Bridge.

Definition at line 34 of file settings.h.

Constructor & Destructor Documentation

◆ Settings()

Settings::Settings ( SaveFile * file)
Parameters
filethe live save (a few settings react to it).

Definition at line 58 of file settings.cpp.

References dataChanged(), SaveFile::dataExpandedChanged(), and file.

Member Function Documentation

◆ dataChanged()

void Settings::dataChanged ( )
protected

React to the save's data changing.

Definition at line 90 of file settings.cpp.

References file, MapsDB::getIndAt(), MapsDB::inst(), OUTDOOR, previewOutdoor, and previewTileset.

Referenced by Settings().

◆ getPreviewTilesetIndex()

int Settings::getPreviewTilesetIndex ( )

Index of previewTileset (backs the property).

Definition at line 76 of file settings.cpp.

References previewTileset, and tilesetOrder.

◆ setColorScheme()

void Settings::setColorScheme ( QColor primary,
QColor secondary )

Recolour the palette at runtime.

Definition at line 67 of file settings.cpp.

References accentColor, primaryColor, primaryColorDark, and primaryColorLight.

Member Data Documentation

◆ accentColor

QColor Settings::accentColor = QColor("#607D8B")

Definition at line 121 of file settings.h.

Referenced by setColorScheme().

◆ dividerColor

QColor Settings::dividerColor = QColor("#BDBDBD")

Definition at line 120 of file settings.h.

◆ errorColor

QColor Settings::errorColor = QColor("red")

Definition at line 118 of file settings.h.

◆ file

SaveFile* Settings::file
protected

The live save (held for data-reactive settings).

Definition at line 134 of file settings.h.

Referenced by dataChanged(), and Settings().

◆ fontColorControl

QColor Settings::fontColorControl = QColor("#7B1FA2")

Definition at line 124 of file settings.h.

◆ fontColorMulti

QColor Settings::fontColorMulti = QColor("#FF6F00")

Definition at line 127 of file settings.h.

◆ fontColorNormal

QColor Settings::fontColorNormal = QColor("#616161")

Definition at line 123 of file settings.h.

◆ fontColorPicture

QColor Settings::fontColorPicture = QColor("#303F9F")

Definition at line 125 of file settings.h.

◆ fontColorSingle

QColor Settings::fontColorSingle = QColor("#9E9D24")

Definition at line 126 of file settings.h.

◆ fontColorVar

QColor Settings::fontColorVar = QColor("#388E3C")

Definition at line 128 of file settings.h.

◆ headerHeight

int Settings::headerHeight = 80
See also
headerHeight property.

Definition at line 94 of file settings.h.

◆ headerShadowHeight

int Settings::headerShadowHeight = 20
See also
headerShadowHeight property.

Definition at line 95 of file settings.h.

◆ infoBtnPressed

bool Settings::infoBtnPressed = false
See also
infoBtnPressed property.

Definition at line 98 of file settings.h.

◆ previewOutdoor

bool Settings::previewOutdoor = true
See also
previewOutdoor property.

Definition at line 102 of file settings.h.

Referenced by dataChanged().

◆ previewTileset

QString Settings::previewTileset = "Overworld"
See also
previewTileset property.

Definition at line 101 of file settings.h.

Referenced by dataChanged(), and getPreviewTilesetIndex().

◆ primaryColor

QColor Settings::primaryColor = QColor("#d81b60")

Definition at line 110 of file settings.h.

Referenced by setColorScheme().

◆ primaryColorDark

QColor Settings::primaryColorDark = QColor("#a00037")

Definition at line 112 of file settings.h.

Referenced by setColorScheme().

◆ primaryColorLight

QColor Settings::primaryColorLight = QColor("#ff5c8d")

Definition at line 111 of file settings.h.

Referenced by setColorScheme().

◆ textColorDark

QColor Settings::textColorDark = QColor("#212121")

Definition at line 108 of file settings.h.

◆ textColorLight

QColor Settings::textColorLight = QColor("#efefef")

Definition at line 106 of file settings.h.

◆ textColorMid

QColor Settings::textColorMid = QColor("#757575")

Definition at line 107 of file settings.h.


The documentation for this class was generated from the following files: