Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
dlg_settings.cpp File Reference

Implementation of the main settings dialog (thin frame around SettingsView). More...

#include "dlg_settings.h"
#include "../../../client/settings/cache_settings.h"
#include "../main.h"
#include "../settings_page/abstract_settings_page.h"
#include "libcockatrice/card/database/card_database.h"
#include "libcockatrice/card/database/card_database_loader.h"
#include "libcockatrice/card/database/card_database_manager.h"
#include <QApplication>
#include <QCloseEvent>
#include <QDir>
#include <QGuiApplication>
#include <QHBoxLayout>
#include <QMessageBox>
#include <QMessageLogger>
#include <QPushButton>
#include <QRect>
#include <QScreen>
#include <QSize>
#include <QVBoxLayout>
#include <QWidget>
#include <QtGlobal>
#include <libcockatrice/settings/paths_settings.h>
#include <libcockatrice/settings/personal_settings.h>
Include dependency graph for dlg_settings.cpp:

Functions

static QSize calculateDialogSize (const QSize &hostSize, const QSize &availableSize, const QSize &minimumSize)
 Calculates the initial dialog size from the host window or screen.

Variables

static constexpr int MIN_DIALOG_WIDTH = 750
static constexpr int MIN_DIALOG_HEIGHT = 700
static constexpr int MAX_DIALOG_WIDTH = 1280
static constexpr double DIALOG_SIZE_RATIO = 0.9

Detailed Description

Implementation of the main settings dialog (thin frame around SettingsView).

Function Documentation

◆ calculateDialogSize()

QSize calculateDialogSize ( const QSize & hostSize,
const QSize & availableSize,
const QSize & minimumSize )
static

Calculates the initial dialog size from the host window or screen.

Parameters
hostSizeSize of the hosting main window, or empty when parentless
availableSizeAvailable screen area the dialog must fit into
minimumSizeMinimum dialog size already applied via setMinimumSize
Returns
Target size at ~90% of the host with small margins, clamped to fit
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ DIALOG_SIZE_RATIO

double DIALOG_SIZE_RATIO = 0.9
staticconstexpr

◆ MAX_DIALOG_WIDTH

int MAX_DIALOG_WIDTH = 1280
staticconstexpr

◆ MIN_DIALOG_HEIGHT

int MIN_DIALOG_HEIGHT = 700
staticconstexpr

◆ MIN_DIALOG_WIDTH

int MIN_DIALOG_WIDTH = 750
staticconstexpr