mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-24 15:43:54 -07:00
[LayoutSettings] Refactor how widgetSize settings are managed (#6594)
This commit is contained in:
parent
1eb6027443
commit
ac7ff3a0e9
8 changed files with 92 additions and 211 deletions
|
|
@ -75,7 +75,7 @@ AbstractTabDeckEditor::AbstractTabDeckEditor(TabSupervisor *_tabSupervisor) : Ta
|
||||||
&AbstractTabDeckEditor::refreshShortcuts);
|
&AbstractTabDeckEditor::refreshShortcuts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractTabDeckEditor::registerDockWidget(QMenu *_viewMenu, QDockWidget *widget)
|
void AbstractTabDeckEditor::registerDockWidget(QMenu *_viewMenu, QDockWidget *widget, const QSize &defaultSize)
|
||||||
{
|
{
|
||||||
QMenu *menu = _viewMenu->addMenu(QString());
|
QMenu *menu = _viewMenu->addMenu(QString());
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ void AbstractTabDeckEditor::registerDockWidget(QMenu *_viewMenu, QDockWidget *wi
|
||||||
connect(filter, &VisibilityChangeListener::visibilityChanged, aVisible,
|
connect(filter, &VisibilityChangeListener::visibilityChanged, aVisible,
|
||||||
[aVisible](bool visible) { aVisible->setChecked(visible); });
|
[aVisible](bool visible) { aVisible->setChecked(visible); });
|
||||||
|
|
||||||
dockToActions.insert(widget, {menu, aVisible, aFloating});
|
dockToActions.insert(widget, {menu, aVisible, aFloating, defaultSize});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -274,13 +274,14 @@ protected:
|
||||||
QMenu *menu; ///< The menu containing the actions
|
QMenu *menu; ///< The menu containing the actions
|
||||||
QAction *aVisible; ///< The menu action that toggles visibility
|
QAction *aVisible; ///< The menu action that toggles visibility
|
||||||
QAction *aFloating; ///< The menu action that toggles floating
|
QAction *aFloating; ///< The menu action that toggles floating
|
||||||
|
QSize defaultSize; ///< The default size of the dock
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief registers a QDockWidget as a managed dock widget. Creates the associated actions and menu, adds them to
|
* @brief registers a QDockWidget as a managed dock widget. Creates the associated actions and menu, adds them to
|
||||||
* the viewMenu, and connects those actions to the tab's slots.
|
* the viewMenu, and connects those actions to the tab's slots.
|
||||||
*/
|
*/
|
||||||
void registerDockWidget(QMenu *_viewMenu, QDockWidget *widget);
|
void registerDockWidget(QMenu *_viewMenu, QDockWidget *widget, const QSize &defaultSize);
|
||||||
|
|
||||||
/** @brief Confirms deck open action based on settings and modified state.
|
/** @brief Confirms deck open action based on settings and modified state.
|
||||||
* @param openInSameTabIfBlank Whether to reuse same tab if blank.
|
* @param openInSameTabIfBlank Whether to reuse same tab if blank.
|
||||||
|
|
|
||||||
|
|
@ -54,11 +54,11 @@ void TabDeckEditor::createMenus()
|
||||||
|
|
||||||
viewMenu = new QMenu(this);
|
viewMenu = new QMenu(this);
|
||||||
|
|
||||||
registerDockWidget(viewMenu, cardDatabaseDockWidget);
|
registerDockWidget(viewMenu, cardDatabaseDockWidget, {500, 500});
|
||||||
registerDockWidget(viewMenu, cardInfoDockWidget);
|
registerDockWidget(viewMenu, cardInfoDockWidget, {250, 500});
|
||||||
registerDockWidget(viewMenu, deckDockWidget);
|
registerDockWidget(viewMenu, deckDockWidget, {250, 360});
|
||||||
registerDockWidget(viewMenu, filterDockWidget);
|
registerDockWidget(viewMenu, filterDockWidget, {250, 250});
|
||||||
registerDockWidget(viewMenu, printingSelectorDockWidget);
|
registerDockWidget(viewMenu, printingSelectorDockWidget, {525, 250});
|
||||||
|
|
||||||
connect(&SettingsCache::instance(), &SettingsCache::overrideAllCardArtWithPersonalPreferenceChanged, this,
|
connect(&SettingsCache::instance(), &SettingsCache::overrideAllCardArtWithPersonalPreferenceChanged, this,
|
||||||
[this](bool enabled) { dockToActions[printingSelectorDockWidget].menu->setEnabled(!enabled); });
|
[this](bool enabled) { dockToActions[printingSelectorDockWidget].menu->setEnabled(!enabled); });
|
||||||
|
|
@ -144,20 +144,14 @@ void TabDeckEditor::loadLayout()
|
||||||
restoreGeometry(layouts.getDeckEditorGeometry());
|
restoreGeometry(layouts.getDeckEditorGeometry());
|
||||||
}
|
}
|
||||||
|
|
||||||
cardDatabaseDockWidget->setMinimumSize(layouts.getDeckEditorCardDatabaseSize());
|
for (auto it = dockToActions.constKeyValueBegin(); it != dockToActions.constKeyValueEnd(); ++it) {
|
||||||
cardDatabaseDockWidget->setMaximumSize(layouts.getDeckEditorCardDatabaseSize());
|
auto dockWidget = it->first;
|
||||||
|
auto actions = it->second;
|
||||||
|
|
||||||
cardInfoDockWidget->setMinimumSize(layouts.getDeckEditorCardSize());
|
QSize size = layouts.getDeckEditorWidgetSize(dockWidget->objectName(), actions.defaultSize);
|
||||||
cardInfoDockWidget->setMaximumSize(layouts.getDeckEditorCardSize());
|
dockWidget->setMinimumSize(size);
|
||||||
|
dockWidget->setMaximumSize(size);
|
||||||
filterDockWidget->setMinimumSize(layouts.getDeckEditorFilterSize());
|
}
|
||||||
filterDockWidget->setMaximumSize(layouts.getDeckEditorFilterSize());
|
|
||||||
|
|
||||||
deckDockWidget->setMinimumSize(layouts.getDeckEditorDeckSize());
|
|
||||||
deckDockWidget->setMaximumSize(layouts.getDeckEditorDeckSize());
|
|
||||||
|
|
||||||
printingSelectorDockWidget->setMinimumSize(layouts.getDeckEditorPrintingSelectorSize());
|
|
||||||
printingSelectorDockWidget->setMaximumSize(layouts.getDeckEditorPrintingSelectorSize());
|
|
||||||
|
|
||||||
QTimer::singleShot(100, this, &TabDeckEditor::freeDocksSize);
|
QTimer::singleShot(100, this, &TabDeckEditor::freeDocksSize);
|
||||||
}
|
}
|
||||||
|
|
@ -208,11 +202,10 @@ bool TabDeckEditor::eventFilter(QObject *o, QEvent *e)
|
||||||
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
||||||
layouts.setDeckEditorLayoutState(saveState());
|
layouts.setDeckEditorLayoutState(saveState());
|
||||||
layouts.setDeckEditorGeometry(saveGeometry());
|
layouts.setDeckEditorGeometry(saveGeometry());
|
||||||
layouts.setDeckEditorCardDatabaseSize(cardDatabaseDockWidget->size());
|
|
||||||
layouts.setDeckEditorCardSize(cardInfoDockWidget->size());
|
for (auto dockWidget : dockToActions.keys()) {
|
||||||
layouts.setDeckEditorFilterSize(filterDockWidget->size());
|
layouts.setDeckEditorWidgetSize(dockWidget->objectName(), dockWidget->size());
|
||||||
layouts.setDeckEditorDeckSize(deckDockWidget->size());
|
}
|
||||||
layouts.setDeckEditorPrintingSelectorSize(printingSelectorDockWidget->size());
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1034,12 +1034,12 @@ void TabGame::createViewMenuItems()
|
||||||
{
|
{
|
||||||
viewMenu = new QMenu(this);
|
viewMenu = new QMenu(this);
|
||||||
|
|
||||||
registerDockWidget(viewMenu, cardInfoDock);
|
registerDockWidget(viewMenu, cardInfoDock, {250, 360});
|
||||||
registerDockWidget(viewMenu, messageLayoutDock);
|
registerDockWidget(viewMenu, messageLayoutDock, {250, 200});
|
||||||
registerDockWidget(viewMenu, playerListDock);
|
registerDockWidget(viewMenu, playerListDock, {250, 50});
|
||||||
|
|
||||||
if (replayDock) {
|
if (replayDock) {
|
||||||
registerDockWidget(viewMenu, replayDock);
|
registerDockWidget(viewMenu, replayDock, {900, 100});
|
||||||
}
|
}
|
||||||
|
|
||||||
viewMenu->addSeparator();
|
viewMenu->addSeparator();
|
||||||
|
|
@ -1051,7 +1051,7 @@ void TabGame::createViewMenuItems()
|
||||||
addTabMenu(viewMenu);
|
addTabMenu(viewMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabGame::registerDockWidget(QMenu *_viewMenu, QDockWidget *widget)
|
void TabGame::registerDockWidget(QMenu *_viewMenu, QDockWidget *widget, const QSize &defaultSize)
|
||||||
{
|
{
|
||||||
QMenu *menu = _viewMenu->addMenu(QString());
|
QMenu *menu = _viewMenu->addMenu(QString());
|
||||||
|
|
||||||
|
|
@ -1078,7 +1078,7 @@ void TabGame::registerDockWidget(QMenu *_viewMenu, QDockWidget *widget)
|
||||||
connect(filter, &VisibilityChangeListener::visibilityChanged, aVisible,
|
connect(filter, &VisibilityChangeListener::visibilityChanged, aVisible,
|
||||||
[aVisible](bool visible) { aVisible->setChecked(visible); });
|
[aVisible](bool visible) { aVisible->setChecked(visible); });
|
||||||
|
|
||||||
dockToActions.insert(widget, {menu, aVisible, aFloating});
|
dockToActions.insert(widget, {menu, aVisible, aFloating, defaultSize});
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabGame::loadLayout()
|
void TabGame::loadLayout()
|
||||||
|
|
@ -1088,24 +1088,27 @@ void TabGame::loadLayout()
|
||||||
restoreGeometry(layouts.getReplayPlayAreaGeometry());
|
restoreGeometry(layouts.getReplayPlayAreaGeometry());
|
||||||
restoreState(layouts.getReplayPlayAreaLayoutState());
|
restoreState(layouts.getReplayPlayAreaLayoutState());
|
||||||
|
|
||||||
cardInfoDock->setMinimumSize(layouts.getReplayCardInfoSize());
|
for (auto it = dockToActions.constKeyValueBegin(); it != dockToActions.constKeyValueEnd(); ++it) {
|
||||||
cardInfoDock->setMaximumSize(layouts.getReplayCardInfoSize());
|
auto dockWidget = it->first;
|
||||||
messageLayoutDock->setMinimumSize(layouts.getReplayMessageLayoutSize());
|
auto actions = it->second;
|
||||||
messageLayoutDock->setMaximumSize(layouts.getReplayMessageLayoutSize());
|
|
||||||
playerListDock->setMinimumSize(layouts.getReplayPlayerListSize());
|
QSize size = layouts.getReplayPlayAreaWidgetSize(dockWidget->objectName(), actions.defaultSize);
|
||||||
playerListDock->setMaximumSize(layouts.getReplayPlayerListSize());
|
dockWidget->setMinimumSize(size);
|
||||||
replayDock->setMinimumSize(layouts.getReplayReplaySize());
|
dockWidget->setMaximumSize(size);
|
||||||
replayDock->setMaximumSize(layouts.getReplayReplaySize());
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
restoreGeometry(layouts.getGamePlayAreaGeometry());
|
restoreGeometry(layouts.getGamePlayAreaGeometry());
|
||||||
restoreState(layouts.getGamePlayAreaLayoutState());
|
restoreState(layouts.getGamePlayAreaLayoutState());
|
||||||
|
|
||||||
cardInfoDock->setMinimumSize(layouts.getGameCardInfoSize());
|
for (auto it = dockToActions.constKeyValueBegin(); it != dockToActions.constKeyValueEnd(); ++it) {
|
||||||
cardInfoDock->setMaximumSize(layouts.getGameCardInfoSize());
|
auto dockWidget = it->first;
|
||||||
messageLayoutDock->setMinimumSize(layouts.getGameMessageLayoutSize());
|
auto actions = it->second;
|
||||||
messageLayoutDock->setMaximumSize(layouts.getGameMessageLayoutSize());
|
|
||||||
playerListDock->setMinimumSize(layouts.getGamePlayerListSize());
|
QSize size = layouts.getGamePlayAreaWidgetSize(dockWidget->objectName(), actions.defaultSize);
|
||||||
playerListDock->setMaximumSize(layouts.getGamePlayerListSize());
|
dockWidget->setMinimumSize(size);
|
||||||
|
dockWidget->setMaximumSize(size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QTimer::singleShot(100, this, &TabGame::freeDocksSize);
|
QTimer::singleShot(100, this, &TabGame::freeDocksSize);
|
||||||
|
|
@ -1333,16 +1336,17 @@ void TabGame::hideEvent(QHideEvent *event)
|
||||||
if (replayDock) {
|
if (replayDock) {
|
||||||
layouts.setReplayPlayAreaState(saveState());
|
layouts.setReplayPlayAreaState(saveState());
|
||||||
layouts.setReplayPlayAreaGeometry(saveGeometry());
|
layouts.setReplayPlayAreaGeometry(saveGeometry());
|
||||||
layouts.setReplayCardInfoSize(cardInfoDock->size());
|
|
||||||
layouts.setReplayMessageLayoutSize(messageLayoutDock->size());
|
for (auto dockWidget : dockToActions.keys()) {
|
||||||
layouts.setReplayPlayerListSize(playerListDock->size());
|
layouts.setReplayPlayAreaWidgetSize(dockWidget->objectName(), dockWidget->size());
|
||||||
layouts.setReplayReplaySize(replayDock->size());
|
}
|
||||||
} else {
|
} else {
|
||||||
layouts.setGamePlayAreaState(saveState());
|
layouts.setGamePlayAreaState(saveState());
|
||||||
layouts.setGamePlayAreaGeometry(saveGeometry());
|
layouts.setGamePlayAreaGeometry(saveGeometry());
|
||||||
layouts.setGameCardInfoSize(cardInfoDock->size());
|
|
||||||
layouts.setGameMessageLayoutSize(messageLayoutDock->size());
|
for (auto dockWidget : dockToActions.keys()) {
|
||||||
layouts.setGamePlayerListSize(playerListDock->size());
|
layouts.setGamePlayAreaWidgetSize(dockWidget->objectName(), dockWidget->size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tab::hideEvent(event);
|
Tab::hideEvent(event);
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ private:
|
||||||
QMenu *menu;
|
QMenu *menu;
|
||||||
QAction *aVisible;
|
QAction *aVisible;
|
||||||
QAction *aFloating;
|
QAction *aFloating;
|
||||||
|
QSize defaultSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
QMap<QDockWidget *, DockActions> dockToActions;
|
QMap<QDockWidget *, DockActions> dockToActions;
|
||||||
|
|
@ -117,7 +118,7 @@ private:
|
||||||
void createMenuItems();
|
void createMenuItems();
|
||||||
void createReplayMenuItems();
|
void createReplayMenuItems();
|
||||||
void createViewMenuItems();
|
void createViewMenuItems();
|
||||||
void registerDockWidget(QMenu *_viewMenu, QDockWidget *widget);
|
void registerDockWidget(QMenu *_viewMenu, QDockWidget *widget, const QSize &defaultSize);
|
||||||
void createCardInfoDock(bool bReplay = false);
|
void createCardInfoDock(bool bReplay = false);
|
||||||
void createPlayerListDock(bool bReplay = false);
|
void createPlayerListDock(bool bReplay = false);
|
||||||
void createMessageDock(bool bReplay = false);
|
void createMessageDock(bool bReplay = false);
|
||||||
|
|
|
||||||
|
|
@ -97,10 +97,10 @@ void TabDeckEditorVisual::createMenus()
|
||||||
|
|
||||||
viewMenu = new QMenu(this);
|
viewMenu = new QMenu(this);
|
||||||
|
|
||||||
registerDockWidget(viewMenu, cardInfoDockWidget);
|
registerDockWidget(viewMenu, cardInfoDockWidget, {250, 500});
|
||||||
registerDockWidget(viewMenu, deckDockWidget);
|
registerDockWidget(viewMenu, deckDockWidget, {250, 360});
|
||||||
registerDockWidget(viewMenu, filterDockWidget);
|
registerDockWidget(viewMenu, filterDockWidget, {250, 250});
|
||||||
registerDockWidget(viewMenu, printingSelectorDockWidget);
|
registerDockWidget(viewMenu, printingSelectorDockWidget, {525, 250});
|
||||||
|
|
||||||
viewMenu->addSeparator();
|
viewMenu->addSeparator();
|
||||||
|
|
||||||
|
|
@ -274,17 +274,14 @@ void TabDeckEditorVisual::loadLayout()
|
||||||
restoreGeometry(layouts.getDeckEditorGeometry());
|
restoreGeometry(layouts.getDeckEditorGeometry());
|
||||||
}
|
}
|
||||||
|
|
||||||
cardInfoDockWidget->setMinimumSize(layouts.getDeckEditorCardSize());
|
for (auto it = dockToActions.constKeyValueBegin(); it != dockToActions.constKeyValueEnd(); ++it) {
|
||||||
cardInfoDockWidget->setMaximumSize(layouts.getDeckEditorCardSize());
|
auto dockWidget = it->first;
|
||||||
|
auto actions = it->second;
|
||||||
|
|
||||||
filterDockWidget->setMinimumSize(layouts.getDeckEditorFilterSize());
|
QSize size = layouts.getDeckEditorWidgetSize(dockWidget->objectName(), actions.defaultSize);
|
||||||
filterDockWidget->setMaximumSize(layouts.getDeckEditorFilterSize());
|
dockWidget->setMinimumSize(size);
|
||||||
|
dockWidget->setMaximumSize(size);
|
||||||
deckDockWidget->setMinimumSize(layouts.getDeckEditorDeckSize());
|
}
|
||||||
deckDockWidget->setMaximumSize(layouts.getDeckEditorDeckSize());
|
|
||||||
|
|
||||||
printingSelectorDockWidget->setMinimumSize(layouts.getDeckEditorPrintingSelectorSize());
|
|
||||||
printingSelectorDockWidget->setMaximumSize(layouts.getDeckEditorPrintingSelectorSize());
|
|
||||||
|
|
||||||
QTimer::singleShot(100, this, &TabDeckEditorVisual::freeDocksSize);
|
QTimer::singleShot(100, this, &TabDeckEditorVisual::freeDocksSize);
|
||||||
}
|
}
|
||||||
|
|
@ -349,10 +346,10 @@ bool TabDeckEditorVisual::eventFilter(QObject *o, QEvent *e)
|
||||||
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
||||||
layouts.setDeckEditorLayoutState(saveState());
|
layouts.setDeckEditorLayoutState(saveState());
|
||||||
layouts.setDeckEditorGeometry(saveGeometry());
|
layouts.setDeckEditorGeometry(saveGeometry());
|
||||||
layouts.setDeckEditorCardSize(cardInfoDockWidget->size());
|
|
||||||
layouts.setDeckEditorFilterSize(filterDockWidget->size());
|
for (auto dockWidget : dockToActions.keys()) {
|
||||||
layouts.setDeckEditorDeckSize(deckDockWidget->size());
|
layouts.setDeckEditorWidgetSize(dockWidget->objectName(), dockWidget->size());
|
||||||
layouts.setDeckEditorPrintingSelectorSize(printingSelectorDockWidget->size());
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,59 +47,15 @@ void LayoutsSettings::setDeckEditorGeometry(const QByteArray &value)
|
||||||
setValue(value, GEOMETRY_PROP, GROUP_DECK_EDITOR);
|
setValue(value, GEOMETRY_PROP, GROUP_DECK_EDITOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize LayoutsSettings::getDeckEditorCardDatabaseSize()
|
void LayoutsSettings::setDeckEditorWidgetSize(const QString &widgetName, const QSize &value)
|
||||||
{
|
{
|
||||||
QVariant previous = getValue("cardDatabase", GROUP_DECK_EDITOR, SIZE_PROP);
|
setValue(value, widgetName, GROUP_DECK_EDITOR, SIZE_PROP);
|
||||||
return previous == QVariant() ? QSize(500, 500) : previous.toSize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayoutsSettings::setDeckEditorCardDatabaseSize(const QSize &value)
|
QSize LayoutsSettings::getDeckEditorWidgetSize(const QString &widgetName, const QSize &defaultValue)
|
||||||
{
|
{
|
||||||
setValue(value, "cardDatabase", GROUP_DECK_EDITOR, SIZE_PROP);
|
QVariant previous = getValue(widgetName, GROUP_DECK_EDITOR, SIZE_PROP);
|
||||||
}
|
return previous == QVariant() ? defaultValue : previous.toSize();
|
||||||
|
|
||||||
QSize LayoutsSettings::getDeckEditorCardSize()
|
|
||||||
{
|
|
||||||
QVariant previous = getValue("card", GROUP_DECK_EDITOR, SIZE_PROP);
|
|
||||||
return previous == QVariant() ? QSize(250, 500) : previous.toSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LayoutsSettings::setDeckEditorCardSize(const QSize &value)
|
|
||||||
{
|
|
||||||
setValue(value, "card", GROUP_DECK_EDITOR, SIZE_PROP);
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize LayoutsSettings::getDeckEditorDeckSize()
|
|
||||||
{
|
|
||||||
QVariant previous = getValue("deck", GROUP_DECK_EDITOR, SIZE_PROP);
|
|
||||||
return previous == QVariant() ? QSize(250, 360) : previous.toSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LayoutsSettings::setDeckEditorDeckSize(const QSize &value)
|
|
||||||
{
|
|
||||||
setValue(value, "deck", GROUP_DECK_EDITOR, SIZE_PROP);
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize LayoutsSettings::getDeckEditorPrintingSelectorSize()
|
|
||||||
{
|
|
||||||
QVariant previous = getValue("printingSelector", GROUP_DECK_EDITOR, SIZE_PROP);
|
|
||||||
return previous == QVariant() ? QSize(525, 250) : previous.toSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LayoutsSettings::setDeckEditorPrintingSelectorSize(const QSize &value)
|
|
||||||
{
|
|
||||||
setValue(value, "printingSelector", GROUP_DECK_EDITOR, SIZE_PROP);
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize LayoutsSettings::getDeckEditorFilterSize()
|
|
||||||
{
|
|
||||||
QVariant previous = getValue("filter", GROUP_DECK_EDITOR, SIZE_PROP);
|
|
||||||
return previous == QVariant() ? QSize(250, 250) : previous.toSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LayoutsSettings::setDeckEditorFilterSize(const QSize &value)
|
|
||||||
{
|
|
||||||
setValue(value, "filter", GROUP_DECK_EDITOR, SIZE_PROP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray LayoutsSettings::getDeckEditorDbHeaderState()
|
QByteArray LayoutsSettings::getDeckEditorDbHeaderState()
|
||||||
|
|
@ -162,37 +118,15 @@ QByteArray LayoutsSettings::getGamePlayAreaGeometry()
|
||||||
return getValue(GEOMETRY_PROP, GROUP_GAME_PLAY_AREA).toByteArray();
|
return getValue(GEOMETRY_PROP, GROUP_GAME_PLAY_AREA).toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize LayoutsSettings::getGameCardInfoSize()
|
void LayoutsSettings::setGamePlayAreaWidgetSize(const QString &widgetName, const QSize &value)
|
||||||
{
|
{
|
||||||
QVariant previous = getValue("cardInfo", GROUP_GAME_PLAY_AREA, SIZE_PROP);
|
setValue(value, widgetName, GROUP_GAME_PLAY_AREA, SIZE_PROP);
|
||||||
return previous == QVariant() ? QSize(250, 360) : previous.toSize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayoutsSettings::setGameCardInfoSize(const QSize &value)
|
QSize LayoutsSettings::getGamePlayAreaWidgetSize(const QString &widgetName, const QSize &defaultValue)
|
||||||
{
|
{
|
||||||
setValue(value, "cardInfo", GROUP_GAME_PLAY_AREA, SIZE_PROP);
|
QVariant previous = getValue(widgetName, GROUP_GAME_PLAY_AREA, SIZE_PROP);
|
||||||
}
|
return previous == QVariant() ? defaultValue : previous.toSize();
|
||||||
|
|
||||||
QSize LayoutsSettings::getGameMessageLayoutSize()
|
|
||||||
{
|
|
||||||
QVariant previous = getValue("messageLayout", GROUP_GAME_PLAY_AREA, SIZE_PROP);
|
|
||||||
return previous == QVariant() ? QSize(250, 250) : previous.toSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LayoutsSettings::setGameMessageLayoutSize(const QSize &value)
|
|
||||||
{
|
|
||||||
setValue(value, "messageLayout", GROUP_GAME_PLAY_AREA, SIZE_PROP);
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize LayoutsSettings::getGamePlayerListSize()
|
|
||||||
{
|
|
||||||
QVariant previous = getValue("playerList", GROUP_GAME_PLAY_AREA, SIZE_PROP);
|
|
||||||
return previous == QVariant() ? QSize(250, 50) : previous.toSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LayoutsSettings::setGamePlayerListSize(const QSize &value)
|
|
||||||
{
|
|
||||||
setValue(value, "playerList", GROUP_GAME_PLAY_AREA, SIZE_PROP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayoutsSettings::setReplayPlayAreaGeometry(const QByteArray &value)
|
void LayoutsSettings::setReplayPlayAreaGeometry(const QByteArray &value)
|
||||||
|
|
@ -215,46 +149,13 @@ QByteArray LayoutsSettings::getReplayPlayAreaGeometry()
|
||||||
return getValue(GEOMETRY_PROP, GROUP_REPLAY_PLAY_AREA).toByteArray();
|
return getValue(GEOMETRY_PROP, GROUP_REPLAY_PLAY_AREA).toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize LayoutsSettings::getReplayCardInfoSize()
|
void LayoutsSettings::setReplayPlayAreaWidgetSize(const QString &widgetName, const QSize &value)
|
||||||
{
|
{
|
||||||
QVariant previous = getValue("cardInfo", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
|
setValue(value, widgetName, GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
|
||||||
return previous == QVariant() ? QSize(250, 360) : previous.toSize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayoutsSettings::setReplayCardInfoSize(const QSize &value)
|
QSize LayoutsSettings::getReplayPlayAreaWidgetSize(const QString &widgetName, const QSize &defaultValue)
|
||||||
{
|
{
|
||||||
setValue(value, "cardInfo", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
|
QVariant previous = getValue(widgetName, GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
|
||||||
}
|
return previous == QVariant() ? defaultValue : previous.toSize();
|
||||||
|
}
|
||||||
QSize LayoutsSettings::getReplayMessageLayoutSize()
|
|
||||||
{
|
|
||||||
QVariant previous = getValue("messageLayout", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
|
|
||||||
return previous == QVariant() ? QSize(250, 200) : previous.toSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LayoutsSettings::setReplayMessageLayoutSize(const QSize &value)
|
|
||||||
{
|
|
||||||
setValue(value, "messageLayout", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize LayoutsSettings::getReplayPlayerListSize()
|
|
||||||
{
|
|
||||||
QVariant previous = getValue("playerList", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
|
|
||||||
return previous == QVariant() ? QSize(250, 50) : previous.toSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LayoutsSettings::setReplayPlayerListSize(const QSize &value)
|
|
||||||
{
|
|
||||||
setValue(value, "playerList", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize LayoutsSettings::getReplayReplaySize()
|
|
||||||
{
|
|
||||||
QVariant previous = getValue("replay", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
|
|
||||||
return previous == QVariant() ? QSize(900, 100) : previous.toSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LayoutsSettings::setReplayReplaySize(const QSize &value)
|
|
||||||
{
|
|
||||||
setValue(value, "replay", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
|
|
||||||
}
|
|
||||||
|
|
@ -21,11 +21,8 @@ public:
|
||||||
|
|
||||||
void setDeckEditorLayoutState(const QByteArray &value);
|
void setDeckEditorLayoutState(const QByteArray &value);
|
||||||
void setDeckEditorGeometry(const QByteArray &value);
|
void setDeckEditorGeometry(const QByteArray &value);
|
||||||
void setDeckEditorCardDatabaseSize(const QSize &value);
|
void setDeckEditorWidgetSize(const QString &widgetName, const QSize &value);
|
||||||
void setDeckEditorCardSize(const QSize &value);
|
|
||||||
void setDeckEditorDeckSize(const QSize &value);
|
|
||||||
void setDeckEditorPrintingSelectorSize(const QSize &value);
|
|
||||||
void setDeckEditorFilterSize(const QSize &value);
|
|
||||||
void setDeckEditorDbHeaderState(const QByteArray &value);
|
void setDeckEditorDbHeaderState(const QByteArray &value);
|
||||||
void setSetsDialogHeaderState(const QByteArray &value);
|
void setSetsDialogHeaderState(const QByteArray &value);
|
||||||
void setSetsDialogGeometry(const QByteArray &value);
|
void setSetsDialogGeometry(const QByteArray &value);
|
||||||
|
|
@ -33,26 +30,18 @@ public:
|
||||||
|
|
||||||
void setGamePlayAreaGeometry(const QByteArray &value);
|
void setGamePlayAreaGeometry(const QByteArray &value);
|
||||||
void setGamePlayAreaState(const QByteArray &value);
|
void setGamePlayAreaState(const QByteArray &value);
|
||||||
void setGameCardInfoSize(const QSize &value);
|
void setGamePlayAreaWidgetSize(const QString &widgetName, const QSize &value);
|
||||||
void setGameMessageLayoutSize(const QSize &value);
|
|
||||||
void setGamePlayerListSize(const QSize &value);
|
|
||||||
|
|
||||||
void setReplayPlayAreaGeometry(const QByteArray &value);
|
void setReplayPlayAreaGeometry(const QByteArray &value);
|
||||||
void setReplayPlayAreaState(const QByteArray &value);
|
void setReplayPlayAreaState(const QByteArray &value);
|
||||||
void setReplayCardInfoSize(const QSize &value);
|
void setReplayPlayAreaWidgetSize(const QString &widgetName, const QSize &value);
|
||||||
void setReplayMessageLayoutSize(const QSize &value);
|
|
||||||
void setReplayPlayerListSize(const QSize &value);
|
|
||||||
void setReplayReplaySize(const QSize &value);
|
|
||||||
|
|
||||||
QByteArray getMainWindowGeometry();
|
QByteArray getMainWindowGeometry();
|
||||||
|
|
||||||
QByteArray getDeckEditorLayoutState();
|
QByteArray getDeckEditorLayoutState();
|
||||||
QByteArray getDeckEditorGeometry();
|
QByteArray getDeckEditorGeometry();
|
||||||
QSize getDeckEditorCardDatabaseSize();
|
QSize getDeckEditorWidgetSize(const QString &widgetName, const QSize &defaultValue = {});
|
||||||
QSize getDeckEditorCardSize();
|
|
||||||
QSize getDeckEditorDeckSize();
|
|
||||||
QSize getDeckEditorPrintingSelectorSize();
|
|
||||||
QSize getDeckEditorFilterSize();
|
|
||||||
QByteArray getDeckEditorDbHeaderState();
|
QByteArray getDeckEditorDbHeaderState();
|
||||||
QByteArray getSetsDialogHeaderState();
|
QByteArray getSetsDialogHeaderState();
|
||||||
QByteArray getSetsDialogGeometry();
|
QByteArray getSetsDialogGeometry();
|
||||||
|
|
@ -60,16 +49,11 @@ public:
|
||||||
|
|
||||||
QByteArray getGamePlayAreaLayoutState();
|
QByteArray getGamePlayAreaLayoutState();
|
||||||
QByteArray getGamePlayAreaGeometry();
|
QByteArray getGamePlayAreaGeometry();
|
||||||
QSize getGameCardInfoSize();
|
QSize getGamePlayAreaWidgetSize(const QString &widgetName, const QSize &defaultValue = {});
|
||||||
QSize getGameMessageLayoutSize();
|
|
||||||
QSize getGamePlayerListSize();
|
|
||||||
|
|
||||||
QByteArray getReplayPlayAreaLayoutState();
|
QByteArray getReplayPlayAreaLayoutState();
|
||||||
QByteArray getReplayPlayAreaGeometry();
|
QByteArray getReplayPlayAreaGeometry();
|
||||||
QSize getReplayCardInfoSize();
|
QSize getReplayPlayAreaWidgetSize(const QString &widgetName, const QSize &defaultValue = {});
|
||||||
QSize getReplayMessageLayoutSize();
|
|
||||||
QSize getReplayPlayerListSize();
|
|
||||||
QSize getReplayReplaySize();
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue